#include
using namespace std;
int main()
{
FILE *fp1,*fp2;
char ch;
if ((fp1=fopen('s1.txt','r'))==NULL)
{
cout<<'can not open s1.txt\n';
return 0;
}
if ((fp2=fopen('d1.txt','w'))==NULL)
{
cout<<'can not open d1.txt\n';
return 0;
}
ch=fgetc(fp1);
while(ch!=EOF) // 判断文件结束标志
{
if((ch>='a')&&(ch<='z'))
{
ch=ch-32;
}
fputc(ch, fp2); // 写入输出文件
ch=fgetc(fp1); // 继续读取输入文件
}
fclose(fp1);
fclose(fp2);
return 0;
}