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.  
  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. // cout << mt[counter][j] << "<->" << array[j]<< "\n";
  19. }
  20. ++counter;
  21. lengthFin = length;
  22. }
  23.  
  24.  
  25. /*for(int i = 0; i < lengthFin; ++i) {
  26. for (int j = 0; j < lengthFin; ++j) {
  27. cout << mt[i][j] <<" ";
  28. }
  29. cout <<"\n";
  30. }
  31. */
  32.  
  33.  
  34. int linie = lengthFin - 1, coloana = 0;
  35. for (int i = 0; i < lengthFin; ++i, --linie) {
  36.  
  37. for (int j = 0; j < lengthFin; ++j) {
  38.  
  39. // cout << mt[j][i] <<",";
  40. if ((mt[j][i] >= 'a' && mt[j][i] <= 'z') || (mt[j][i] >= 'A' && mt[j][i] <= 'Z')) {
  41.  
  42. secMt[linie][j] = mt[j][i];
  43. }
  44. }
  45. // cout <<" \n";
  46. }
  47.  
  48. for (int i = 0 ; i < lengthFin; ++i) {
  49. for (int j = 0 ; j < lengthFin; ++j) {
  50. cout << secMt[i][j];
  51. }
  52. cout <<".\n";
  53. }
  54.  
  55.  
  56. return 0;
  57. }
Success #stdin #stdout 0s 5324KB
stdin
a*c*
**sd
v*g*
****
stdout
d.
csg.
.
av.