2019年12月17日
摘要: #include<stdio.h>void main(){ float sum=0.0,m=1.0; int n=1; //声明一个整数型变量n,代表循环的起点,并为其初始化赋值// while(n<=15) //确定循环执行次数// { m*=n; //求n!// sum+=m; //求累加和// 阅读全文
posted @ 2019-12-17 19:56 张德明 阅读(1606) 评论(0) 推荐(0)
摘要: #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)