上一页 1 ··· 3 4 5 6 7 8 9 下一页
  2019年12月17日
摘要: #include<stdio.h>#include<math.h> //程序中调用幂函数pow(),需包含头文件math.h//void main(){ int i,n; printf("Please enter n:"); scanf("%d",&n); for(i=0;i<=n;i++) //循 阅读全文
posted @ 2019-12-17 19:26 张德明 阅读(1906) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ int i,n,sum=0; //声明三个整型变量,并为变量sum初始化赋值为0// printf("Please enter n:"); //输入提示语// scanf("%d",&n); //调用scanf()函数从键盘输入n的值// 阅读全文
posted @ 2019-12-17 19:10 张德明 阅读(2189) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ float a,b,c,max; scanf("%f%f%f",&a,&b,&c); if(a>b) max=(a>c)?a:c; else max=(b>c)?b:c; printf("Max=%f\n",max);} 阅读全文
posted @ 2019-12-17 18:50 张德明 阅读(674) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ float a,b,c,max; scanf("%f%f%f",&a,&b,&c); if(a>b) { if(a>c) max=a; else max=c; } else { if(a>b) max=b; else max=c; } pr 阅读全文
posted @ 2019-12-17 18:42 张德明 阅读(1931) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <math.h>void main(){ int x,y,z; float s,area; scanf("%d%d%d",&x,&y,&z); if (x+y>z&&x+z>y&&y+z>x) { s=0.5*(x+y+z); area=sqrt 阅读全文
posted @ 2019-12-17 15:55 张德明 阅读(1756) 评论(0) 推荐(0)
  2019年12月16日
摘要: 分析: 输入——变量x,y存放输入的两个整数; 输出——变量m存放输入的两个整数的最大值,m为输出; 算法——如果x比y大,x赋给m,否则y赋给m。 #include<stdio.h>void main(){ int x,y,m; scanf("%d%d",&x,&y); if(x>y) m=x; 阅读全文
posted @ 2019-12-16 19:55 张德明 阅读(990) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ float a; printf("Input the value:"); scanf("%f",&a); if(a>0) printf("area=%f\n", a*a);} 阅读全文
posted @ 2019-12-16 19:44 张德明 阅读(418) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ int x,y; scanf("%d", &x); printf("x=%d\n",x); y=x; if(x<0); y=-x; printf("|%d|=%d",x,y);} 阅读全文
posted @ 2019-12-16 19:39 张德明 阅读(2007) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ char ch; ch=getchar(); ch == 'y' || ch == 'Y' ? printf("yes") : printf("no");} 阅读全文
posted @ 2019-12-16 19:30 张德明 阅读(3226) 评论(0) 推荐(0)
摘要: #include<stdio.h>void main(){ char ch; ch=getchar(); printf("%c",ch);} 阅读全文
posted @ 2019-12-16 19:24 张德明 阅读(1068) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 下一页