Created
May 19, 2016 09:45
-
-
Save danhuynhdev/9ab6437e2cde69320c71af868cb6d6df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <ctype.h> | |
using namespace std; | |
int main() { | |
ifstream in_file("mauthu1.txt"); | |
vector<string> chus; | |
if (in_file.is_open()) { | |
string temp; | |
while (!in_file.eof()) { | |
in_file >> temp; | |
chus.push_back(temp); | |
} | |
in_file.close(); | |
} | |
ofstream out_file("mauthu2.txt"); | |
if (out_file.is_open()) { | |
for (vector<string>::size_type i = 0; i < chus.size(); i++) { | |
chus[i][0] = toupper(chus[i][0]); | |
out_file << chus[i] << " "; | |
} | |
out_file << endl; | |
out_file.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment