摘要: 1.通讯录排序 #include"stdio.h"struct birthday{ int year,month,day;};struct people{ char name[20]; struct birthday b; int phonenumber;}a[10],x;int main(){ i 阅读全文
posted @ 2019-06-23 17:21 黄科迪 阅读(185) 评论(1) 推荐(0) 编辑
摘要: 1.拆分实数 #include"stdio.h"void splidfloat(float x,int*intpart,float*fracpart);int main(){ float x,f=0; int i=0; float*pf=&f; int*pi=&i; printf("Enter x: 阅读全文
posted @ 2019-06-15 17:39 黄科迪 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 杨辉三角形 #include"stdio.h"int main(){ int a[100][100],i,j,x,n; printf("输出n组:n="); scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<=i/2;j++){ if(j==0) a[i][j]= 阅读全文
posted @ 2019-06-09 16:32 黄科迪 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1、输入正整数n,在输入n个整数,冲大到小输出 #include<stdio.h>int main(){ int a[10],i,j,x,n,t; printf("Enter n:\n"); scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); fo 阅读全文
posted @ 2019-06-05 17:27 黄科迪 阅读(325) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h>#include<math.h>int factorsum(int m);int main(){ int m,n; printf("Enter m n:"); scanf("%d%d",&m,&n); for(m;m<=n;m++) if(m==factorsum( 阅读全文
posted @ 2019-05-25 16:24 黄科迪 阅读(179) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h>#include<math.h>int prime(int m);int main(){ int m,n,sum,count; printf("Enter m n:"); scanf("%d%d",&m,&n); if(m>=1&&n<=500&&m<n){ sum 阅读全文
posted @ 2019-05-06 21:20 黄科迪 阅读(109) 评论(2) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int m,n,x,y; printf("Enter m n:\n"); scanf("%d%d",&m,&n); if(m>0&&n>0&&m<=1000&&n<=1000){ if(m>=n){ x=n;y=m; while(m%x!=0 阅读全文
posted @ 2019-04-16 20:36 黄科迪 阅读(134) 评论(2) 推荐(0) 编辑
摘要: 1.出租车计价 #include<stdio.h>#include<math.h>int main(){ double d,t,m; int a; printf("Enter distance and time:\n"); scanf("%lf%lf",&d,&t); if(t>=5){ if(d< 阅读全文
posted @ 2019-04-09 19:49 黄科迪 阅读(208) 评论(1) 推荐(0) 编辑
摘要: 求一元二次方程的根;输入参数a、b、c,求一元二次方程ax2+bx+c=0的根。写出 1.当a=0时,无意义 2.当a!=0,b2-4ac<0时,无解 3.当a!=0,b2-4ac=0时,有一个解 4.当a!=0,b2-4ac>0时,有两个解 阅读全文
posted @ 2019-03-30 19:05 黄科迪 阅读(508) 评论(2) 推荐(0) 编辑
摘要: 1、计算f(x)的值:输入x,计算并输出下列分段函数f(x)的值(保留1位小数)。试编写相应程序。 Y=f(x)=1/x (当x!=0) Y=f(x)=0 (当x=0) #include<stdio.h> int main(void){ float x,y; printf("Enter x:\n") 阅读全文
posted @ 2019-03-19 19:35 黄科迪 阅读(2401) 评论(0) 推荐(0) 编辑