// Created by on 15/11/9.// Copyright ? 2015年 小白教程. All rights reserved.
//
#include<stdio.h>#include<stdlib.h>#include<string.h>intmain(){FILE*fp=NULL;
charstr[50];
inti,len;
printf("輸入一個(gè)字符串:n");
gets(str);
len=strlen(str);
for(i=0;i<len;i++){if(str[i]<='z'&&str[i]>='a')str[i]-=32;
}if((fp=fopen("test","w"))==NULL){printf("error: cannot open file!n");
exit(0);
}fprintf(fp,"%s",str);
fclose(fp);
system("pause");
return0;
}