ImageVerifierCode 换一换
格式:DOC , 页数:13 ,大小:25.50KB ,
资源ID:1241762      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-1241762.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(简单易懂的C语言源代码供初学者使用.doc)为本站会员(wj)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

简单易懂的C语言源代码供初学者使用.doc

1、#include main() float pi=3.14159265,r; printf(enter radius:n); scanf(%f,&r); printf(r=%.2f,c=%.2f,area=%.2fn,r,2*pi*r,pi*r*r); system(pause); #include main() int m,n,x,y; printf(inputm,n:n); scanf(%d%d,&m,&n); if (n%2=1) printf(error! n bu shi ji shu!n,n); return; /*n在这里不能是奇数*/ x=(4*m-n)/2; y=(n-2*m

2、)/2; if(x=0)&(y=0) printf(x=%d,y=%dn,x,y); else printf(shu ru cuo wu!n); getch(); #include #include #include main() float a,b,C; printf(enter 3number(a,b,C):n); scanf(%.2f %.2f %.2f,&a,&b,&C); s=0.5*a*b*sinC; printf(s=%.2fn,s); system(pause); #include main() int ds,nl,yf; char c; printf(shu ru ds;n)

3、; scanf(%d,&ds); if (ds1184) printf(input error!press any end.n); scanf(%c,&c); exit(0); /*输入的数字必须是-141184之间*/ nl=(ds+115)%100; yf=(ds+115)/100; printf(nl=%d,yf=%dn,nl,yf); system(pause); #include #include main() char s1100,s2100,s3100,s4100; printf(input a string:n); gets(s1); strcpy(s1,s2); strcat

4、(s1,-); strcpy(s3,strcat(s1,-); strcat(strcpy(s3,strcat(s1,-),s2); strcpy(s4,strcat(strcpy(s3,strcat(s1,-),s2); puts(s4); system(pasue); getch(); #include #include main() float x1,x2,a,b,c; printf(input 3 number(a,b,c):n); scanf(%f%f%f,&a,&b,&c); x1=(-b+sqrt(b*b-4*a*c)/(2*a); x2=(-b-sqrt(b*b-4*a*c)/

5、(2*a); printf(x1=%f,X2=%fn,x1,x2); system(pause); getch(); #include main() int a,b,c,t; printf(input 3 number:n); scanf(%d%d%d,&a,&b,&c); if(ab) t=a;a=b,b=t; if(ac) t=a;a=c;c=t; if(bc) t=b;b=c;c=t; printf(1:%d,2:%d,3:%dn,a,b,c); system(pause); #include #include #include main() float pi=3.14159265,r;

6、 textbackground(YELLOW);/* 设置背景色为黄色,注意颜色应该大写,可更改 */ textcolor(RED); /* 设置文件颜色为红色,可更改 */ clrscr(); /* 清屏,使设置生效 */ printf(enter radius:); scanf(%f,&r); if(r0) printf(Enter Error!n); else printf(r=%.2f,c=%.2f,area=%.2fn,r,2*pi*r,pi*r*r); system(pause);/* 暂停,按任一键继续 */ #include #include #include main() f

7、loat a,b,c,delt,x1,x2,p,q; textcolor(YELLOW); clrscr(); printf(Input a b c:n); scanf(%f%f%f,&a,&b,&c); if(a=0) printf(Its not a quadratic equation!n); system(pause); return; delt=b*b-4*a*c; if(delt=0) x1=(-b+sqrt(delt)/(2*a); x2=(-b-sqrt(delt)/(2*a); printf(x1=%.3f x2=%.4fn,x1,x2); else p=-b/(2*a);q

8、=sqrt(-delt)/(2*a); printf(p=%.4fq=%.4fn,p,q); system(pause); getch(); #include main() float pi=3.14159265,r; int k=0; while(k=3) printf(enter radius:n); scanf(%f,&r); printf(r=%.2f,c=%.2f,area=%.2fn,r,2*pi*r,pi*r*r); printf(press any key to continuenpress esc to exit.); k+; #include #include #inclu

9、de #include main() int a,b,c,oper; long limit,i=0; char char1; textcolor(GREEN);/*设置字体颜色为绿色*/ clrscr(); /*清屏,是设置生效*/ while(i=3) printf(qing xuan ze jia huo jian(1or2,1:+,2:-n); scanf(%d,&oper); printf(Enter max (10000):n); scanf(%ld,&limit); srand(unsigned long)time(0); a=rand()*limit/RAND_MAX; b=ra

10、nd()*limit/RAND_MAX; while(ab)&(oper=2) a=rand()*limit/RAND_MAX; b=rand()*limit/RAND_MAX; char1=(oper=2?-:+); printf(%d%c%dn,a,char1,b); scanf(%d,&c); if(oper=2&a-b=c)|(oper!=2&a+b=c) printf(OK!You are very clever!n); else printf(The result is not correct!n); i+; getch(); #include #include main() in

11、t y,i=0; textcolor(YELLOW); /*天下事无难易之分只有做与不做之别*/ textbackground(GREEN); clrscr();/*清屏,是设置生效*/ while(i=3) printf(Input year:n); scanf(%d,&y); if(y%4=0) if(y%100=0) if(y%400=0) printf(y shi run nian!n); else printf(y bu shi run nian !n); else printf(y shi run nian!n); else printf(y bu shi run nian!);

12、i+; getche(); #include#include#includemain()int xz,wday1,hour1;struct tm *timeptr;time_t secsnow;char s130,s230,s330;printf(input whom do you say to?:n);scanf(%d,&xz);if(xz=1)strcpy(s1,mother);else if(xz=2)strcpy(s1,father);elsestrcpy(s1,);time(&secsnow);timeptr=localtime(&secsnow);wday1=timeptr-tm_

13、wday;if(wday1=6)strcpy(s2,Happy saturday!);else if(wday1=0)strcpy(s2,Happy sunday);elsestrcpy(s2,);hour1=timeptr-tm_hour;if(hour1=4&hour1=17&hour1=22)strcpy(s3,Good afternoon!);elsestrcpy(s3,Good evening!);printf(%s%s%s,s1,s2,s3);getch();#include#includemain()int day,year,month,i=0;textbackground(BR

14、OWN);clrscr();while(i=3)printf(Input 2 number:n);scanf(%d%d,&year,&month);switch(month)case 1:case 3:case 5:case 7:case 8:case 10:case 12: day=31;break;case 4:case 6:case 11:day=30;break;case 2:day=28;if(year%4=0&year%100!=0)|year%400=0)day=29;break;deflault:printf(Invalid month input!n);return;printf(There are%d days in %d.%dn,day,year,month);i+;getch();

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2