初学c语言编程

ID:26817334

大小:3.41 MB

页数:14页

时间:2018-11-29

初学c语言编程_第1页
初学c语言编程_第2页
初学c语言编程_第3页
初学c语言编程_第4页
初学c语言编程_第5页
资源描述:

《初学c语言编程》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、#includevoidmain(){inta=10,b=11,c1,c2;printf("c1=%d,c2=%d",c1,c2);c1=++a;c2=b++;printf("c1=%d,c2=%d",c1,c2);a=10;b=1;c1=a--;printf("c1=%d,c2=%d",c1,c2);}#includevoidmain(){floatPI=3.14,r=3,h=6,l,s,v;l=2*PI*r;s=PI*r*r;v=s*h;printf("%1.2f,%1.2f,%1.

2、2f",l,s,v);}#includevoidmain(){chara,b;scanf("%c%c",&a,&b);printf("%c%c",a,b);}#includevoidmain(){chara,b;a=getchar();putchar('a','b');}#includevoidmain(){charc1,c2,c3,c4,c5;c1='C',c2='h';c3='i',c4='n';c5='a';printf("%c%c%c%c%c",c1,c2,c3,c

3、4,c5);c1=c1+4;c2=c2+4;c3=c3+4;c4=c4+4;c5=c5+4;printf("%c%c%c%c%c",c1,c2,c3,c4,c5);}#includevoidmain(){floatc,f;scanf("%f",&f);c=(5.0/9)*(f-32);printf("%2.1f",c);}#includevoidmain(){floata,b,c,s,area;printf("inputa,b,c:");scanf("%f,%f,%f",&a,&b,&c);if(a

4、!=0&&b!=0&&c!=0&&a+b>c&&a+c>b&&b+c>a){s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));printf("area=%f",area);}else{printf("Itisnotatriangle.");}}#includevoidmain(){floata,b,c,x1,x2,p,q;printf("inputa,b,c:");scanf("%f,%f,%f",&a,&b,&c);if(b*b-4*a*c>0){p=(-b)/2*a;q=

5、sqrt(b*b-4*a*c)/2*a;x1=p+q;x2=p-q;printf("%f,%f",x1,x2);}else{printf("b*b-4*a*c<=0");}}#includevoidmain(){intx=3,y=2,l;floata=2.5,b=3.5;l=(x+y)%2+(int)a/(int)b;printf("%d",l);}#includevoidmain(){chara,ch;a=97;ch='a'+'8'-'3';printf("ch=%d",ch);}#incl

6、udevoidmain(){floatscore;printf("inputscore:");scanf("%f",&score);if(score>=60){if(score>=80)printf("ÓÅÐã");elseprintf("¼°¸ñ");}else{printf("²»¼°¸ñ");}}#includevoidmain(){floatscore;printf("inputscore:");scanf("%f",&score);if(score>=80)printf("ÓÅÐã");els

7、eif(score>=60)printf("¼°¸ñ");else{printf("²»¼°¸ñ");}}#includevoidmain(){intnum;printf("inputnum:");scanf("%d",&num);if(num<=100){if(num<=50)printf("num<=50");elseprintf("50150");}}#include

8、io.h>voidmain(){inta,b;scanf("%d%d",&a,&b);switch(a%2){case0:switch(b%2){case0:printf("a,bareeven");break;case

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
正文描述:

《初学c语言编程》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、#includevoidmain(){inta=10,b=11,c1,c2;printf("c1=%d,c2=%d",c1,c2);c1=++a;c2=b++;printf("c1=%d,c2=%d",c1,c2);a=10;b=1;c1=a--;printf("c1=%d,c2=%d",c1,c2);}#includevoidmain(){floatPI=3.14,r=3,h=6,l,s,v;l=2*PI*r;s=PI*r*r;v=s*h;printf("%1.2f,%1.2f,%1.

2、2f",l,s,v);}#includevoidmain(){chara,b;scanf("%c%c",&a,&b);printf("%c%c",a,b);}#includevoidmain(){chara,b;a=getchar();putchar('a','b');}#includevoidmain(){charc1,c2,c3,c4,c5;c1='C',c2='h';c3='i',c4='n';c5='a';printf("%c%c%c%c%c",c1,c2,c3,c

3、4,c5);c1=c1+4;c2=c2+4;c3=c3+4;c4=c4+4;c5=c5+4;printf("%c%c%c%c%c",c1,c2,c3,c4,c5);}#includevoidmain(){floatc,f;scanf("%f",&f);c=(5.0/9)*(f-32);printf("%2.1f",c);}#includevoidmain(){floata,b,c,s,area;printf("inputa,b,c:");scanf("%f,%f,%f",&a,&b,&c);if(a

4、!=0&&b!=0&&c!=0&&a+b>c&&a+c>b&&b+c>a){s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));printf("area=%f",area);}else{printf("Itisnotatriangle.");}}#includevoidmain(){floata,b,c,x1,x2,p,q;printf("inputa,b,c:");scanf("%f,%f,%f",&a,&b,&c);if(b*b-4*a*c>0){p=(-b)/2*a;q=

5、sqrt(b*b-4*a*c)/2*a;x1=p+q;x2=p-q;printf("%f,%f",x1,x2);}else{printf("b*b-4*a*c<=0");}}#includevoidmain(){intx=3,y=2,l;floata=2.5,b=3.5;l=(x+y)%2+(int)a/(int)b;printf("%d",l);}#includevoidmain(){chara,ch;a=97;ch='a'+'8'-'3';printf("ch=%d",ch);}#incl

6、udevoidmain(){floatscore;printf("inputscore:");scanf("%f",&score);if(score>=60){if(score>=80)printf("ÓÅÐã");elseprintf("¼°¸ñ");}else{printf("²»¼°¸ñ");}}#includevoidmain(){floatscore;printf("inputscore:");scanf("%f",&score);if(score>=80)printf("ÓÅÐã");els

7、eif(score>=60)printf("¼°¸ñ");else{printf("²»¼°¸ñ");}}#includevoidmain(){intnum;printf("inputnum:");scanf("%d",&num);if(num<=100){if(num<=50)printf("num<=50");elseprintf("50150");}}#include

8、io.h>voidmain(){inta,b;scanf("%d%d",&a,&b);switch(a%2){case0:switch(b%2){case0:printf("a,bareeven");break;case

显示全部收起
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
关闭