fork(1) download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. const int MAX_LENGTH = 100;
  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. //cin.getline(array, MAX_LENGTH);
  12.  
  13. while (cin.getline(array, MAX_LENGTH)) {
  14. int length = strlen(array);
  15. //cout << array << " " << length<< "<-\n";
  16. for (int j = 0; j < length; ++j) {
  17. mt[counter][j] = array[j];
  18. }
  19. ++counter;
  20. lengthFin = length;
  21. }
  22. int linie = 0, coloana = 0;
  23.  
  24. for (int i = counter - 2; i >= 0; --i, ++linie) {
  25. coloana = 0;
  26. for (int j = lengthFin - 1; j >= 0; --j, ++coloana) {
  27. // cout << mt[j][i] <<",";
  28. if (mt[j][i] >= 'a' && mt[j][i] <= 'z' || mt[j][i] >= 'A' && mt[j][i] <= 'Z') {
  29.  
  30. secMt[linie][coloana] = mt[j][i];
  31. }
  32. }
  33. // cout <<" \n";
  34. }
  35.  
  36. for (int i = 1 ; i < counter; ++i) {
  37. for (int j = lengthFin ; j >= 0; --j) {
  38. cout << secMt[i][j];
  39. }
  40. cout <<" \n";
  41. }
  42.  
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 5316KB
stdin
LAPTOP
CARTOF
E*M*IL
C*AIET
PLASMA
T****V
P**I*X
stdout
OOIEM 
TTIS 
PRMAA 
AAL 
LCECPT