Last active
May 18, 2017 18:50
-
-
Save Technici4n/c3e029c5ff49632fbf554dd6fd9f5a71 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
int n; | |
string buff; | |
int main() | |
{ | |
int cases; | |
// Read cases | |
cin >> cases; | |
while(cases--) | |
{ | |
// Read n | |
cin >> n; | |
// Empty this line | |
getline(cin, buff); | |
// While there is a next line and the next line is not empty | |
while(getline(cin, buff) && buff != "") | |
{ | |
char c; | |
int i1, i2; | |
stringstream ss(buff); | |
// Put 'buff' in a stream that can be used like cin | |
// Extract from the stream the char and the 2 numbers | |
ss >> c >> i1 >> i2; | |
/** | |
* Do something | |
*/ | |
} | |
/** | |
* Do something | |
*/ | |
if(cases > 0) | |
cout << "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment