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