- 1、本文档共13页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
南大成考C语言课后习题
3.16
#include stdio.h
main()
{double a,b,c,s,v;
printf(input a,b,c:);
scanf(%lf%lf%lf,a,b,c);
s=a*b;
v=a*b*c;
printf(a=%lf,b=%lf,c=%lf\n,a,b,c);
printf(s=%lf,v=%lf,s,v);
}
3.17
#include stdio.h
main()
{int x,y,z;
x=560;
y=x/60;
z=x%60;
printf(%d:%d,y,z);
}
3.18
#include stdio.h
main()
{int x,y;
scanf(%d%d,x,y);
printf(%d\n%d\n,x/y,x%y);
}
3.19
#include stdio.h
main()
{double x,y,z,sum,ave;
printf(Enter x,y,z:);
scanf(%lf%lf%lf,x,y,z);
sum=x+y+z;
ave=sum/3;
ave=ave*10;
ave=ave+0.5;
ave=(int)ave;
ave=ave/10;
printf(%f,ave);
}
3.20
#include stdio.h
main()
{int a,b,c,d;
printf(enter a,b,c:\n);
scanf(%d%d%d,a,b,c);
d=a;a=c;c=b;b=d;
printf(%d %d %d,a,b,c);
}
4.23
#include stdio.h
main()
{int x;
scanf(%d,x);
if(x%2==0)
{printf(it is even number);
getch();}
else
{printf(it is odd number);
getch();}
}
4.24
#include stdio.h
main()
{int a,b,c;
scanf(%d%d%d,a,b,c);
if(abac)
{printf(%d,a);
getch();}
else
{if(bc)
{printf(%d,b);
getch();
}
else
{printf(%d,c);
getch();
}
}
}
5.17
#include stdio.h
#include math.h
main()
{int a,i,sum;
sum=0;
i=1;
for(a=1;fabs(a)101;a=fabs(a)+2)
{i++;
if(i%2==0)
{a*=-1;
sum+=a;
}
else
sum+=a;
}
printf(%d,sum);
getch();
}
5.19
#include stdio.h
main()
{int year,i;
i=0;
for(year=2000;year=3000;year++)
{if(year%400==0||year%4==0year%100)
{printf(%d ,year);
getch();
++i;
{if(i%10==0)
{printf(\n);
getch();
}
else ;
}
}
else ;
}
}
5.20
#include stdio.h
#include math.h
main()
{int k,i,j;
for(k=0;k7;k++)
{for(i=0;ifabs(3-k);i++)
{printf( );
getch();
}
for(j=0;j=6-2*i;j++)
{printf(*);
getch();
}
printf(\n);
getch();
}
}
6.19
#include stdio.h
#include ctype.h
main()
{int n=0;
char ch;
while((ch=getchar())!=\n)
{if(n%3==0)
{putchar(\n);
getch();
}
n++; printf(ch=%c,ASCII=%d ,ch,ch);
getch();
}
}
6.20
#include stdio.h
#include ctype.h
main()
{char ch;
int n=0;
while((ch=getchar())!=\n)
{if(ch=0ch=9)
n=n*10+ch-0;
}
您可能关注的文档
- 河南财经政法大学财务管理期末考试试题1.doc
- 晋城市党政正职.doc
- 双洎河渡槽支架.doc
- 数字电子技术EWB.ppt
- 2012-2013学年第一学期校历及教学进程表.doc
- 2012研究报告汇总.doc
- 直线和圆月考卷.doc
- 中药鉴定学粉末鉴别.ppt
- 新缘五院行总策划.doc
- 暑期社会实践先进个人申报.doc
- 2025年山东胜利职业学院单招语文测试模拟题库完整.docx
- 2025年山东省莱芜市单招语文测试题库审定版.docx
- 2025年山西华澳商贸职业学院单招(语文)测试题库往年题考.docx
- 2025年山东省菏泽地区单招语文测试题库1套.docx
- 2025年山东省莱芜市选调生考试(行政职业能力测验)综合能力题库及答案1套.docx
- 2025年山东科技职业学院单招语文测试题库及参考答案一套.docx
- 2025年山西省大同市行政职业能力测验模拟试题推荐.docx
- 2025年川南幼儿师范高等专科学校单招语文测试题库及参考答案一套.docx
- 2025年山东省青岛市单招语文测试题库及参考答案.docx
- 2025年山东省青岛市单招(语文)测试题库及答案参考.docx
文档评论(0)