哈工大C语言spoc作业系统答案Word下载.docx

上传人:b****1 文档编号:13079711 上传时间:2022-10-04 格式:DOCX 页数:69 大小:30.18KB
下载 相关 举报
哈工大C语言spoc作业系统答案Word下载.docx_第1页
第1页 / 共69页
哈工大C语言spoc作业系统答案Word下载.docx_第2页
第2页 / 共69页
哈工大C语言spoc作业系统答案Word下载.docx_第3页
第3页 / 共69页
哈工大C语言spoc作业系统答案Word下载.docx_第4页
第4页 / 共69页
哈工大C语言spoc作业系统答案Word下载.docx_第5页
第5页 / 共69页
点击查看更多>>
下载资源
资源描述

哈工大C语言spoc作业系统答案Word下载.docx

《哈工大C语言spoc作业系统答案Word下载.docx》由会员分享,可在线阅读,更多相关《哈工大C语言spoc作业系统答案Word下载.docx(69页珍藏版)》请在冰豆网上搜索。

哈工大C语言spoc作业系统答案Word下载.docx

break;

-'

a-b);

*'

a*b);

/'

a/b);

default:

Unknownoperator\n"

);

}

Q348.

math.h>

inta;

doubleb,rate;

Pleaseenteryear,capital:

"

%d,%lf"

&

a,&

switch(a)

case1:

rate=0.0225;

rate=%f,deposit=%f\n"

rate,(double)b*(double)pow(1+rate,a));

case2:

rate=0.0243;

case3:

rate=0.0270;

case5:

rate=0.0288;

case8:

rate=0.0300;

Errorrate!

\n"

return0;

Q219.

chara;

PressakeyandthenpressEnter:

%c"

a);

if((a>

='

a'

&

&

a<

z'

)||(a>

A'

Z'

))

ItisanEnglishcharacter!

else

if(a>

=0&

=9)

Itisadigitcharacter!

if(a=='

'

Itisaspacecharacter!

Itisothercharacter!

Q221.

main()

intyear,month;

Inputyear,month:

%d,%d"

year,&

month);

switch(month)

case7:

case8:

case10:

case12:

31days\n"

if((year%4==0&

year%100!

=0)||(year%400==0))

29days\n"

/*闰年的2月有29天*/

28days\n"

/*平年的2月有28天*/

case4:

case6:

case9:

case11:

30days\n"

default:

Inputerror!

Q515.

inta,b;

Inputa,b:

%d,%d"

if(a>

=b)

max=%d\n"

a);

b);

Q1300.

longa;

请输入利润:

%ld"

if(a<

=100000)printf("

奖金是%10.2f"

0.1*a);

if(a>

100000&

a<

=200000)printf("

100000*0.1+(a-100000)*0.075);

200000&

=400000)printf("

奖金

是%10.2f"

100000*0.1+100000*0.075+(a-200000)*0.05);

400000&

=600000)printf("

100000*0.1+100000*0.075+200000*0.05+(a-400000)*0.03);

600000&

=1000000)printf("

100000*0.1+100000*0.075+200000*0.05+200000*0.03+(a-600000)*0.015);

elseprintf("

是%10.2f"

100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(a-1000000)

*0.01);

Q586.

#include<

intyear,month,month2=28;

Pleaseenteryear,month:

year,&

if(year%4==0&

year%100!

=0||year%400==0)

%disleapyear\n"

year);

month2=29;

%disnotleapyear\n"

if(month>

=3&

month<

=5)printf("

Theseasonisspring"

=6&

=8)printf("

Theseasonissummer"

=9&

=11)printf("

Theseasonisautumn"

Theseasoniswinter"

if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)

Thenumberofdaysofthismonthis31\n"

if(month==4||month==6||month==9||month==11)

Thenumberofdaysofthismonthis30\n"

Thenumberofdaysofthismonthis%d\n"

month2);

Q1731.

intx;

floata;

Inputx:

%d"

x);

a=x;

if(x>

0)printf("

y=%f\n"

exp(-a));

if(x<

-exp(a));

y=1.000000\n"

Q480.

inputthevalueofx:

|x|=%d\n"

-x);

x);

Q483.

inputthescore:

=90&

=100)printf("

score=%d-->

A\n"

=80&

90)printf("

B\n"

=70&

80)printf("

C\n"

=60&

70)printf("

D\n"

=0&

60)printf("

E\n"

score=%diserror!

}

Q1903.

floatx;

Pleaseinputx:

%f"

y=%.2f\n"

3*x-1);

if(x>

=10)printf("

exp(x));

Q1246.

floata,b,c;

intflag=1;

%f,%f,%f"

b,&

c

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 党团建设

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1