摘要: #include<stdio.h>#include<stdlib.h>#include<math.h> struct point{ /*点的结构类型名*/ float x; /*横坐标*/ float y; /*纵坐标*/ }; struct point readPoint(); /*函数原型声明* 阅读全文
posted @ 2017-05-28 22:17 HGR 阅读(262) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#include<math.h>#define N 10/*函数原型*/ float *high(float *a);float *low(float *a);float *mid(float *a);/*主函数*/int mai 阅读全文
posted @ 2017-05-26 16:10 HGR 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#define N 6/*各菜单项的执行函数*/void function1(int a);void function2(int b);void function3(int c); int menu(int max,char*me 阅读全文
posted @ 2017-05-26 16:09 HGR 阅读(416) 评论(0) 推荐(0) 编辑
摘要: /*模拟投掷硬币*/#include<stdio.h>#include<stdlib.h>#include<time.h>int flip();/*声明函数*//*主函数*/int main(void){ int n,i,front,back; front=0; back=0;/*初始化*/ tim 阅读全文
posted @ 2017-04-14 20:52 HGR 阅读(690) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>int main(void){ int number,price,result,m,n;/*定义变量*/ printf("请输入客户购买笔袋的数量:"); scanf("%d",&number);/*输入客户购买数量*/ m=nu 阅读全文
posted @ 2017-04-08 16:56 HGR 阅读(555) 评论(0) 推荐(0) 编辑
摘要: /*百鸡问题*/#include<stdio.h>#include<stdlib.h>int main(void){ int x,y,z; printf("\n"); for(x=1;x<20;++x) { for(y=1;y<33;y++) { z=100-x-y; if((z%3==0)&&(( 阅读全文
posted @ 2017-04-05 23:18 HGR 阅读(205) 评论(0) 推荐(0) 编辑
摘要: /*显示九九乘法表*/#include<stdio.h>#include<stdlib.h>int main(void){ int i,j; printf("\n\t\t\t九九乘法表\n\n"); for(i=1;i<=9;i++) { for(j=1;j<=i;j++) printf("%ld* 阅读全文
posted @ 2017-04-05 23:07 HGR 阅读(186) 评论(0) 推荐(0) 编辑
摘要: /*输入输出练习*/#include<stdio.h>#include<stdlib.h>int main(void){ char c1,c2; int d1,d2; float f1,f2; double x1,x2; long int g1,g2; unsigned int u1,u2;/*给每 阅读全文
posted @ 2017-03-24 15:54 HGR 阅读(184) 评论(0) 推荐(0) 编辑
摘要: /*猜数游戏,magic number#4,版本*/#include<stdio.h>#include<stdlib.h>#include<time.h>int main(void){ int magic;/*magic number*/ int guess;/*user's number*/ in 阅读全文
posted @ 2017-03-22 23:18 HGR 阅读(146) 评论(0) 推荐(0) 编辑
摘要: /*输出一行字符,分类统计字符个数*/ #include<stdio.h>#include<stdlib.h>int main(void){ int letter=0,space=0,digit=0,other=0;/*定义变量并初始化*/ char c;/*定义字符串c*/ printf("请输入 阅读全文
posted @ 2017-03-22 22:38 HGR 阅读(6842) 评论(0) 推荐(0) 编辑