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

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

麻煩大神解釋一下這段c代碼

麻煩大神解釋一下這段c代碼

C C++
蘇和666 2017-01-30 11:31:49
//驗(yàn)證輸入 #include<stdio.h> #include<stdbool.h> //驗(yàn)證輸入是一個(gè)整數(shù) long?get_long(void); //驗(yàn)證范圍上下限是否有效 bool?bad_limits(long?begin,?long?end, ????long?low,?long?high); //計(jì)算a-b之間的整數(shù)平方和 double?sum_squares(long?a,?long?b); int?main(void) { ?const?long?MIN?=?-10000000L; ?const?long?MAX?=?+10000000L; ?long?start; ?long?stop; ?double?answer; ?printf("This?program?computes?the?sum?of?the?squares?of" ?"integers?in?a?range.\nThe?lower?bound?should?not" ??"be?less?than?-1000000?and\nthe?upper?bound" ?"should?not?be?more?than?+10000000.\nEnter?the" ?"limits?(enter?0?for?both?limits?to?quit):\n" ?"lower?limit:"); ?start?=?get_long(); ?printf("upper?limit:"); ?stop?=?get_long(); ?while?(start?!=?0?||?stop?!=?0) ?{ ??if?(bad_limits(start,?stop,?MIN,?MAX)) ???printf("Plase?try?again.\n"); ??else ??{ ???answer?=?sum_squares(start,?stop); ???printf("The?sum?of?the?squares?of?the?integers?"); ???printf("form?%ld?to?%ld?is?%g\n", ????start,?stop,?answer); ??} ??printf("Enter?the?limits?(enter?0?for?both" ???"limits?to?quit):\n"); ??printf("lower?limit:?"); ??start?=?get_long(); ??printf("upper?limit:?"); ??stop?=?get_long(); ?} ?printf("Done.\n"); ?return?0; } long?get_long(void) { ?long?input; ?char?ch; ?while?(scanf("%ld"),?&input?!=?1) ?{ ??while?((ch?=?getchar())?!=?'\n') ???putchar(ch); ??printf("?is?not?an?integer.\nPlease?enter?an?"); ??printf("integer?value,?such?as?25,?-178,?or?3:"); ?} ?return?input; } double?sum_squares(long?a,?long?b) { ?double?total?=?0; ?long?i; ?for?(i?=?a;?i?<=?b;?i++) ??total?+=?(double)i?*?(double)i; ?return?total; } bool?bad_limits(long?begin,?long?end, ????long?low,?long?high) { ?bool?not_good?=?false; ?if?(begin?>?end) ?{ ??printf("%ld?isn't?smaller?than?%ld.\n",begin,?end); ??not_good?=?true; ?} ?if?(begin?<?low?||?end?<?low) ?{ ??printf("Values?must?be?%ld?or?greater.\n",?low); ??not_good?=?true; ?} ?if?(begin?>?high?||?end?>?high) ?{ ??printf("Values?must?be?%ld?or?less.\n",?high); ??not_good?=?true; ?} ?return?not_good; }
查看完整描述

1 回答

?
黑山頭山大王

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

不懂,沒學(xué)過C

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

添加回答

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