我再你的基础上改了
程序代码:
程序代码:#include<stdio.h>
main()
{
FILE *fp;
if((fp=fopen("text.txt","w"))==NULL)
puts("Error on opening output file text");
char ch;
while((ch=getchar())!=EOF&&ch!='!')//输入字符串改成以字符输入
{
if(ch>='a'&&ch<='z')
ch=ch-32;
fputc(ch,fp);
}
return 0;
fclose(fp);
}
下其实就是换了个函数,你看下

kajj->1314 努力每一天。






