#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;
}