fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. const int MAX_LENGTH = 20;
  6.  
  7.  
  8. int main() {
  9. char array[MAX_LENGTH + 1], mt[MAX_LENGTH + 1][MAX_LENGTH + 1], secMt[MAX_LENGTH + 1][MAX_LENGTH + 1];
  10. int counter = 0, lengthFin = 0;
  11. while (cin.getline(array, MAX_LENGTH)) {
  12. int length = strlen(array);
  13. for (int j = 0; j < length; ++j) {
  14. mt[counter][j] = array[j];
  15. }
  16. ++counter;
  17. lengthFin = length;
  18. }
  19. int linie = 0, coloana = 0, coloana2 = 0;
  20. for (int i = counter - 1; i >= 0; --i, ++linie) {
  21. coloana = 0;
  22. for (int j = lengthFin - 1; j >= 0; --j, ++coloana) {
  23. // cout << mt[j][i] <<" ";
  24. if (mt[j][i] >= 'a' && mt[j][i] <= 'z' || mt[j][i] >= 'A' && mt[j][i] <= 'Z') {
  25.  
  26. secMt[linie][coloana] = mt[j][i];
  27. }
  28. }
  29. // cout <<" \n";
  30. }
  31.  
  32. for (int i = 0 ; i < counter; ++i) {
  33. for (int j = lengthFin - 1; j >= 0; --j) {
  34. cout << secMt[i][j];
  35. }
  36. cout <<" \n";
  37. }
  38.  
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0.01s 5312KB
stdin
AmAmAb
Nunera
Ilarel
Mt*t*a
Ae***u
L****r
stdout
balaur 
Are 
mert 
Ana 
multe 
ANIMAL