- 10
- 0
- 约7.05千字
- 约 23页
- 2021-07-18 发布于山西
- 举报
word可编辑·实用文档
要求在屏幕上输出下一行信息。
This is a c program.
程序:
#includestdio.h
int main()
{
printf(“this is a c program.\n”);
return 0;
}
求两个整数之和。
程序:
#includestdio.h
int main()
{
int a,b,sum;
a=122;
b=234;
sum=a+b;
printf(“sum is %d\n”,sum);
return 0;
}
求两个整数之间的较大者。
程序:
#includestdio.h
int main()
{
int max(int x,int y);
int a,b,c;
scanf(%d,%d,a,b);
c=max(a,b);
printf(max=%d\n,c);
return 0;
}
int max(int x,int y)
{
int z;
if(xy)z=x;
else z=y;
return(z);
}
有人用温度计测量出华氏发表示的温度(如69°F) ,今要求把她转换成以摄氏法表示的温度(如20℃)。
公式:c=5(f-32)/9.
其中f代表华氏温度 ,c代表摄氏温度。
程序:
#includestdio.h
int main()
{
float f,c;
f=64.0;
c=(5.0/9)*
您可能关注的文档
最近下载
- 体例格式12:工学一体化课程《小型网络安装与调试》任务3教学单元2教学单元活动方案.docx VIP
- 水吸收氨气的填料吸收塔设计毕业论文.pdf VIP
- 2024-2025学年初中音乐七年级上册(2024)人教版(2024)教学设计合集.docx
- 西宁市海湖中学2025-2026学年高一上学期期中考试语文试卷(含答案).pdf VIP
- 基于联邦学习的跨区域应急协同决策系统研究.docx
- 湘美版美术 六年级上册 第三单元 第3课《营造活动氛围》课件.ppt
- 2027届广州中考英语项目情境读写综合专项10组.docx VIP
- 冬季施工方案.docx VIP
- 2027届广州中考英语听说考试专项训练10套.docx VIP
- 隐蔽工程验收记录填写方法共87种.docx VIP
原创力文档

文档评论(0)