第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

求解! 謝謝

求解! 謝謝

C
qq_待到茶火清涼_0 2017-01-16 15:01:26
/*編寫一程序P112.C實(shí)現(xiàn)以下功能?設(shè)某企業(yè)2006年的產(chǎn)值為5000萬(wàn),?計(jì)劃以后每年的增長(zhǎng)率為x(x從鍵盤輸入,例如輸入8.75表示8.75%),?計(jì)算該企業(yè)的產(chǎn)值在哪年實(shí)現(xiàn)翻番以及翻番時(shí)的產(chǎn)值,?然后輸出(輸出時(shí)以萬(wàn)為單位,應(yīng)考慮有小數(shù))?編程可用素材:printf("Please input x: ")、printf("\nyear = … nian, chanzhi = …。?程序的運(yùn)行效果應(yīng)類似地如圖1所示,圖中的紅色部分是從鍵盤輸入的內(nèi)容。Please input x: 50.6year = 2008 nian, chanzhi = 11340.18*/下面是我編的。。#include <stdio.h>int main(void){?int chanzi = 5000, year = 2006;?float x;?printf("Please input x:");?scanf("%f",&x);?while (chanzi <= 10000)?{??chanzi = chanzi + chanzi * (x / 100);??year++;?} ?printf("year = %d nian, chanzi = %f\n");?return 0;}我編的程序哪里出了問(wèn)題,答案不對(duì)????????????????
查看完整描述

1 回答

已采納
?
望遠(yuǎn)

TA貢獻(xiàn)1017條經(jīng)驗(yàn) 獲得超1032個(gè)贊

#include?<stdio.h>
int?main(void)
{
?float?chanzi?=?5000;//應(yīng)該定義為float,防止丟失精度
?int?year?=?2006;
?float?x;
?printf("Please?input?x:");
?scanf("%f",&x);
?while?(chanzi?<=?10000)
?{
??chanzi?=?chanzi?+?chanzi?*?(x?/?100);
??year++;
?}?
?printf("year?=?%d?nian,?chanzi?=?%.2f\n",year,chanzi);//注意指明要輸出的數(shù)據(jù)是什么,和輸出格式化
?return?0;
}


查看完整回答
反對(duì) 回復(fù) 2017-01-16
  • 1 回答
  • 0 關(guān)注
  • 1572 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)