- 博客(12)
- 资源 (5)
- 收藏
- 关注
原创 文件操作
#includeint main(){ FILE *fp; char ch; fp=fopen("text.txt","w+"); if(fp==NULL) { printf("Open file fail!/n"); getch(); return 0; } printf("input your char: "); ch=getchar(); while(ch !='/n') { fputc(ch,fp); ch=get
2010-09-06 20:04:00
221
原创 C排序
<br /><br />#include<stdio.h><br />#define N 5<br />int main(int argc,char **argv[])<br />{<br /> int a[N];<br /> int i,j,temp;<br /> <br /> printf("input five number: ");<br /> for(i=0;i<5;i++)<br /> {<br /> scanf("%d",&a[i]);<br />
2010-08-26 22:57:00
229
原创 求最大数
<br /><br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> int num[5];<br /> int max;<br /> int i;<br /> <br /> printf("input five number: ");<br /> for(i=0;i<5;i++)<br /> {<br /> scanf("%d",&num[i]);<br /> }
2010-08-26 22:10:00
288
原创 字符串字母对调
<br /><br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> char name[10];<br /> char temp;<br /> int i,j;<br /> <br /> printf("input your string: ");<br /> scanf("%s",&name);<br /> <br /> printf("you input string: %s
2010-08-26 21:45:00
470
原创 字符串字母对调
<br /><br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> char name[10];<br /> char temp;<br /> int i,j;<br /> <br /> printf("input your string: ");<br /> scanf("%s",&name);<br /> <br /> printf("you input string: %s
2010-08-26 21:44:00
358
原创 字符串字母对调
<br /><br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> char name[10];<br /> char temp;<br /> int i,j;<br /> <br /> printf("input your string: ");<br /> scanf("%s",&name);<br /> <br /> printf("you input string: %s
2010-08-26 21:43:00
460
原创 字符数组
<br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> char name[10];<br /> <br /> printf("input you string:");<br /> scanf("%s",&name);<br /> <br /> printf("your input string: %s",name);<br /> <br /> getch();<br /> re
2010-08-26 21:16:00
207
原创 字符数组
<br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> char name[10];<br /> <br /> printf("input you string:");<br /> scanf("%s",&name);<br /> <br /> printf("your input string: %s",name);<br /> <br /> getch();<br /> re
2010-08-26 21:16:00
235
原创 字符数组
<br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> char name[10];<br /> <br /> printf("input you string:");<br /> scanf("%s",&name);<br /> <br /> printf("your input string: %s",name);<br /> <br /> getch();<br /> re
2010-08-26 21:14:00
282
原创 二维数组
<br /><br />#include<stdio.h><br />int main(int argc,char **argv[])<br />{<br /> int score[4][5];<br /> int i,j;<br /> <br /> for(i=0;i<4;i++)<br /> {<br /> for(j=0;j<5;j++)<br /> {<br /> score[i][j]=5*i+j; <br />
2010-08-26 20:41:00
213
原创 数组
#include<stdio.h>#define number 3int main(int argc ,char **argv[]){ int i,avg; int sum=0; int score[number]; printf("input the score!/n"); for(i=0;i<number;i++) { scanf("%d",&score[i]); sum+=score[i]; printf("score[%d]=%#x/
2010-08-24 22:08:00
236
原创 关于指针问题
<br />最近在看指针操作数组的文章,指针是如何对数组进行访问,*p++代表什么,,下面慢慢看;<br /> <br />1、数组名即代表数组首地址,<br /> <br />如:<br /> <br />int a[5]={1,2,3,4,5};<br />int *p;<br /><br /><br />将指针指向该数组,可以如下书写,<br /><br /><br />方法一: int *p=a; //将数组首地址存到指针变量p中<br /><br /><br />方法二: p=a;
2010-07-23 10:41:00
222
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人