fork download
  1. #include<cstdio>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char s[100][100];
  8. int i = 0, j, k;
  9. int max;
  10. while(gets(s[i]) != NULL)
  11. {
  12. if(i == 0) {max = strlen(s[i]);}
  13. else if(max < strlen(s[i])){max = strlen(s[i]);}
  14. i++;
  15. }
  16. for(j = 0; j < max; j++)
  17. {
  18. for(k = i-1; k>= 0; k--)
  19. {
  20. if(j < strlen(s[k])){printf("%c", s[k][j]);}
  21. else if (k != 0){printf(" ");}
  22. }
  23. printf("\n");
  24. return 0;
  25. }
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:8: error: use of undeclared identifier 'gets'
        while(gets(s[i]) != NULL)
              ^
1 error generated.
stdout
Standard output is empty