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

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

您好,一些關(guān)于C語(yǔ)言小問(wèn)題 ,關(guān)于quit語(yǔ)句!

您好,一些關(guān)于C語(yǔ)言小問(wèn)題 ,關(guān)于quit語(yǔ)句!

C++ C
陪伴而非守候 2021-11-11 11:07:31
printf("use cesius,and enter q to quit.\n");scanf("%f",& temperture);為什么輸入 q 就結(jié)束了求解#include <stdio.h>int main(){const int freezing=0;float temperture;int cold_days =0;int all_days = 0;printf("enter the list of daily low temperture.\n");printf("use cesius,and enter q to quit.\n");while(scanf("%f",& temperture)==1){all_days++;if(temperture<freezing)cold_days++;}if(all_days!=0)printf("%d days total: %.f%% were below freezing.\n",all_days,100.0*(float)cold_days/all_days);if(all_days == 0)printf("NO data entered\n");}
查看完整描述

2 回答

?
守候你守候我

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

程序運(yùn)行時(shí)現(xiàn)執(zhí)行語(yǔ)句“printf("use cesius,and enter q to quit.\n");”在界面上輸出“use cesius,and enter q to quit”接著執(zhí)行到“scanf("%f",& temperture);”時(shí)程序會(huì)等待鍵盤輸入,當(dāng)你輸入“q”時(shí),temperture得到你輸入的“q”值,但是之后沒有語(yǔ)句了,所以程序就結(jié)束了!

查看完整回答
反對(duì) 回復(fù) 2021-11-14
?
慕運(yùn)維8079593

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

printf("use cesius,and enter q to quit.\n");
scanf("%s",& temperture); //%f是浮點(diǎn)型輸入,字符串輸入應(yīng)該用%s

查看完整回答
反對(duì) 回復(fù) 2021-11-14
  • 2 回答
  • 0 關(guān)注
  • 341 瀏覽

添加回答

舉報(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)