摘要: #include"stdio.h" main() { FILE *fp; if((fp=fopen("c1.txt","rt"))==NULL) { printf("\nCannot open file!"); getch();exit(1); } ch=fgetc(fp); while(ch!=EOF) { ... 阅读全文
posted @ 2017-05-21 21:54 该☆隐 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-05-21 21:48 该☆隐 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-05-21 21:43 该☆隐 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" main() { enum weekday{ sun,mon,tue,wed,thu,fri,sat } a,b,c; a=sun; b=mon; c=tue; printf("sun=%d,mon=%d,tue=%d\n",a,b,c); } 阅读全文
posted @ 2017-05-21 21:40 该☆隐 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" struct student { int number; char name[8]; char sex[8]; int age; float c_program; }stu[5]={ {35013101,"王 迪",'F',20,90}, {35013105,"... 阅读全文
posted @ 2017-05-21 21:34 该☆隐 阅读(95) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" void exchange(int *p,int *q) { int t; t=*p; *p=*q; *q=t; } main() { int a,b; printf(“请输入两个数:"); scanf("%d%d",&a,&b); if(a>b) exchang... 阅读全文
posted @ 2017-05-21 21:29 该☆隐 阅读(221) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h"main() { char string[20]="I love China!"; printf("%s\n",string); printf("%s\n",string+7); } #include"stdio.h" main() { char *p="I love China!"; printf("%s\... 阅读全文
posted @ 2017-05-21 21:25 该☆隐 阅读(209) 评论(0) 推荐(0) 编辑
摘要: main() { int a[10],*p1,*p2; p1=&a[2]; p2=&a[5]; printf("%p\n",p1); printf("%p\n",p2); printf("%d\n",p2-p1); } 阅读全文
posted @ 2017-05-21 21:21 该☆隐 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" main() { int a=7,b=9,*p; p=&a; *p=*p+b; printf("%d,%d\n",a,*p); } main() { int a,b,*t,*p,*q; p=&a; q=&b; printf(“请输入两个整数:"); sca... 阅读全文
posted @ 2017-05-21 21:17 该☆隐 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" #define PI 3.14 main() { float l,s,r; printf("请输入半径:"); scanf("%f",&r); l=2.0*PI*r; s=PI*r*r; printf("l=%.2f s=%.2f\n",l,s); } #include"stdio.h" #defin... 阅读全文
posted @ 2017-05-21 21:13 该☆隐 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" void f(int a,int b) { int i,j; i=a+2; j=b-1; printf("函数f中:a=%d,b=%d\n",a,b); printf("函数f中:i=%d,j=%d\n",i,j); } main() { int i=4,j=5; f(i,j); print... 阅读全文
posted @ 2017-05-21 21:07 该☆隐 阅读(115) 评论(0) 推荐(0) 编辑