Created
July 18, 2016 11:43
-
-
Save TheoKlein/1f95559fda9f334147635e588bcc2585 to your computer and use it in GitHub Desktop.
ZeroJudge c045
This file contains hidden or 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> | |
| using namespace std; | |
| int main() { | |
| int index = 0; | |
| unsigned long int max = 0; | |
| string input; | |
| char array[100][100] = {' ' , ' '}; | |
| while(getline(cin , input)){ | |
| for(int i = 0 ; i < input.length() ; ++i) | |
| array[index][i] = input[i]; | |
| if(input.length() > max) | |
| max = input.length(); | |
| index++; | |
| } | |
| for(int i = 0 ; i < max ; ++i){ | |
| for(int j = index - 1 ; j >= 0 ; --j){ | |
| if(array[j][i] == '\0') | |
| cout << ' '; | |
| else | |
| cout << array[j][i]; | |
| } | |
| cout << endl; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment