2024年4月19日发(作者:)
-
1. 要求在屏幕上输出下一行信息。
This is a c program.
程序:
#include
int main()
{
printf("this is a c program.n〞);
return 0;
}
2. 求两个整数之和。
程序:
#include
int main()
{
int a,b,sum;
a=122;
b=234;
sum=a+b;
printf("sum is %dn〞,sum);
return 0;
}
3. 求两个整数之间的较大者。
. z.
-
程序:
#include
int main()
{
int ma*(int *,int y);
int a,b,c;
scanf("%d,%d",&a,&b);
c=ma*(a,b);
printf("ma*=%dn",c);
return 0;
}
int ma*(int *,int y)
{
int z;
if(*>y)z=*;
else z=y;
return(z);
}
4. 有人用温度计测量出华氏发表示的温度〔如69°
她转换成以摄氏法表示的温度〔如20℃〕。
公式:c=5〔f-32〕/9.
其中f代表华氏温度,c代表摄氏温度。
.
F〕,今要求把
z.


发布评论