{
len=strlen(chtime)-1; if(j>15)
{ len=len+1; j=11;} strcpy(ch1,\j=j-2;
strncat(ch1,chtime,len); strcpy(chtime,\
strncat(chtime,ch1,len-1); gotoxy(13,7);printf(\
gotoxy(13,7);printf(\if(ch[0]==9) goto mm; if(ch[0]==27) exit(1); }
gotoxy(3,24);printf(\gotoxy(13,10); j=0;
ch[0]=getch(); while(ch[0]!='\\r') { if (j<14)
{ strncat(chshop,ch,1); j++;}
if(ch[0]==8)
{ len=strlen(chshop)-1; strcpy(ch1,\j=j-2;
strncat(ch1,chshop,len); strcpy(chshop,\
strncat(chshop,ch1,len-1); gotoxy(13,10);printf(\
gotoxy(13,10);printf(\gotoxy(13,13); j=0;
ch[0]=getch(); while(ch[0]!='\\r') { if (j<6)
{ strncat(chmoney,ch,1); j++;}
if(ch[0]==8)
{ len=strlen(chmoney)-1; strcpy(ch1,\j=j-2;
strncat(ch1,chmoney,len); strcpy(chmoney,\
strncat(chmoney,ch1,len-1); gotoxy(13,13);printf(\
gotoxy(13,13);printf(\if((strlen(chshop)==0)||(strlen(chmoney)==0)) continue;
if((fp=fopen(\
fprintf(fp,\fputc('\\n',fp); fclose(fp); i++;
gotoxy(41,5+i);
printf(\}}}
============================================================== ¡¾³ÌÐò96¡¿ÌâÄ¿£º¼ÆËã×Ö·û´®ÖÐ×Ó´®³öÏֵĴÎÊý #include \#include \main()
{ char str1[20],str2[20],*p1,*p2; int sum=0;
printf(\
scanf(\p1=str1;p2=str2; while(*p1!='\\0') {
if(*p1==*p2)
{while(*p1==*p2&&*p2!='\\0') {p1++; p2++;} } else p1++;
if(*p2=='\\0') sum++; p2=str2; }
printf(\getch();}
==============================================================
¡¾³ÌÐò97¡¿ÌâÄ¿£º´Ó¼üÅÌÊäÈëһЩ×Ö·û£¬Öð¸ö°ÑËüÃÇË͵½´ÅÅÌÉÏÈ¥£¬Ö±µ½ÊäÈëÒ»¸ö#Ϊֹ¡£ #include \main()
{ FILE *fp;
char ch,filename[10]; scanf(\
if((fp=fopen(filename,\{printf(\exit(0);} ch=getchar(); ch=getchar(); while(ch!='#')
{fputc(ch,fp);putchar(ch); ch=getchar(); }
fclose(fp); }
============================================================== ¡¾³ÌÐò98¡¿ÌâÄ¿£º´Ó¼üÅÌÊäÈëÒ»¸ö×Ö·û´®£¬½«Ð¡Ð´×Öĸȫ²¿×ª»»³É´óд×Öĸ£¬È»ºóÊä³öµ½Ò»¸ö´ÅÅÌÎļþ¡°test¡±Öб£´æ¡£ÊäÈëµÄ×Ö·û´®ÒÔ£¡½áÊø¡£ #include \main() {FILE *fp;
char str[100],filename[10]; int i=0;
if((fp=fopen(\{ printf(\exit(0);}
printf(\gets(str);
while(str[i]!='!')
{ if(str[i]>='a'&&str[i]<='z') str[i]=str[i]-32; fputc(str[i],fp); i++;} fclose(fp);
fp=fopen(\fgets(str,strlen(str)+1,fp); printf(\fclose(fp); }
==============================================================
¡¾³ÌÐò99¡¿ÌâÄ¿£ºÓÐÁ½¸ö´ÅÅÌÎļþAºÍB,¸÷´æ·ÅÒ»ÐÐ×Öĸ£¬ÒªÇó°ÑÕâÁ½¸öÎļþÖеÄÐÅÏ¢ºÏ²¢£¨°´×Öĸ˳ÐòÅÅÁУ©£¬Êä³öµ½Ò»¸öÐÂÎļþCÖС£ #include \main()
{ FILE *fp; int i,j,n,ni;
char c[160],t,ch;
if((fp=fopen(\{printf(\exit(0);}
printf(\for(i=0;(ch=fgetc(fp))!=EOF;i++) {c[i]=ch; putchar(c[i]); }
fclose(fp); ni=i;
if((fp=fopen(\{printf(\exit(0);}
printf(\for(i=0;(ch=fgetc(fp))!=EOF;i++) {c[i]=ch; putchar(c[i]); }
fclose(fp); n=i;
for(i=0;i
{t=c[i];c[i]=c[j];c[j]=t;} printf(\fp=fopen(\for(i=0;i fclose(fp); } ============================================================== ¡¾³ÌÐò100¡¿ÌâÄ¿£ºÓÐÎå¸öѧÉú£¬Ã¿¸öѧÉúÓÐ3Ãſεijɼ¨£¬´Ó¼üÅÌÊäÈëÒÔÉÏÊý¾Ý£¨°üÀ¨Ñ§ÉúºÅ£¬ÐÕÃû£¬ÈýÃſγɼ¨£©£¬¼ÆËã³öƽ¾ù³É¼¨£¬¿öÔÓеÄÊý¾ÝºÍ¼ÆËã³öµÄƽ¾ù·ÖÊý´æ·ÅÔÚ´ÅÅÌÎļþ\ÖС£ #include \struct student { char num[6]; char name[8]; int score[3]; float avr; } stu[5]; main() {int i,j,sum; FILE *fp; /*input*/ for(i=0;i<5;i++) { printf(\printf(\ scanf(\printf(\ scanf(\sum=0; for(j=0;j<3;j++) { printf(\scanf(\sum+=stu[i].score[j]; } stu[i].avr=sum/3.0; } fp=fopen(\for(i=0;i<5;i++) if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1) printf(\fclose(fp); }
Ïà¹ØÍÆ¼ö£º