- #include<bits/stdc++.h>
- using namespace std;
- ifstream ifs;
- int n;
- ofstream ofs;
- string str;
- int main()
- {
- cin>>n;
- ifs.open("read.txt");
- ofs.open("write.txt");
- for(int i=0;i<n;i++){
- getline(ifs,str);
- for(int j=0;j<str.length();j++){
- char c=str[j];
- if(j==0 and str[j-1]==' '){
- c-=32;
- }
- cout<<c;
- ofs<<c;
- }
- cout<<endl;
- ofs<<endl;
- }
- return 0;
- }
複製代碼 |