ytu 英文字符大小写(文件)
作者:互联网
提交方式:C++,直接提交即可
#include<cstdio> #include<iostream> #include<cstring> using namespace std; int main() { FILE* fp; int i, j, n; if ((fp = fopen("score.dic", "r")) == NULL) { printf("can not open.\n"); exit(0); } char s[100]; while(fgets(s,1000,fp)!=NULL){ int len=strlen(s); for(int i=0;i<len;i++){ if(s[i]>='a'&&s[i]<='z'){ s[i]+='A'-'a'; } } cout<<s; } fclose(fp); return 0; }
标签:fp,字符,NULL,FILE,int,ytu,大小写,提交,include 来源: https://www.cnblogs.com/zbsy-wwx/p/16293508.html