哈工大C语言spoc作业系统答案Word下载.docx
《哈工大C语言spoc作业系统答案Word下载.docx》由会员分享,可在线阅读,更多相关《哈工大C语言spoc作业系统答案Word下载.docx(69页珍藏版)》请在冰豆网上搜索。
![哈工大C语言spoc作业系统答案Word下载.docx](https://file1.bdocx.com/fileroot1/2022-10/4/4a4923b0-3684-4bda-8a93-0e87eb7706aa/4a4923b0-3684-4bda-8a93-0e87eb7706aa1.gif)
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