版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、#include main() float pi=3.,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; if(
2、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); scanf(
3、%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(s1,-);
4、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)/(2*a); p
5、rintf(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.,r; textbackground(
6、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() float a,b,c,delt,
7、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=sqrt(-delt)/(2*
8、a); printf(p=%.4fq=%.4fn,p,q); system(pause); getch(); #include main() float pi=3.,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 #include #include main() int a
9、,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=rand()*limit/RAND_MAX; whi
10、le(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() int y,i=0; textcolor(YELLO
11、W); /*天下事无难易之分只有做与不做之别*/ 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!); i+; getche(); #include#i
12、nclude#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_wday;if(wday1=6)strcpy(s
13、2,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(BROWN);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;
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026安徽芜湖市人才发展集团代招聘7人备考题库(三)及完整答案详解
- 2026年4月重庆市万州区双河口街道办事处公益性岗位招聘2人备考题库附答案详解(预热题)
- 2026江苏盐城市大丰区疾病预防控制中心招聘劳务派遣1人备考题库及答案详解1套
- 2026中国疾病预防控制中心(中国预防医学科学院)政策规划研究室招聘备考题库有完整答案详解
- 2026江西南昌大学抚州医学院招聘编外合同制科研助理1人备考题库及答案详解(夺冠)
- 2026年绥化绥棱县事业单位公开招聘工作人员16人备考题库及答案详解(全优)
- 2026浙江温州市苍南县人才发展有限公司招聘市场化工作人员1人备考题库含答案详解(精练)
- 2026江西省江铜铜箔科技股份有限公司第二批次春季校园招聘10人备考题库附答案详解(典型题)
- 2026春季江西省机电设备招标有限公司招聘8人备考题库含答案详解(基础题)
- 2026河北省林业和草原局事业单位公开选聘工作人员2名备考题库及答案详解(易错题)
- 健身房器械安全课件
- 债务外包协议书范本
- 环保应急预案模板范文
- 幼儿园中班数学《图形分类》课件
- IPC7711C7721C-2017(CN)电子组件的返工修改和维修(完整版)
- NB/T 11638-2024穿层钻孔预抽多煤层瓦斯单层抽采量确定方法实测流量法
- 《浸出制油工厂防火安全规范》
- 消防设备备品备件计划
- 重度贫血护理常规
- 第6课华灯梦敦煌(课件)-岭南美版初中美术七年级下册
- 2025年安徽省高考物理试卷真题(含答案解析)
评论
0/150
提交评论