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 asterix = 0;
  15. int length = strlen(array);
  16. for (int j = 0; j < length; ++j) {
  17. if (array[j] == '*') {
  18. ++asterix;
  19. }
  20. }
  21. //cout << asterix << " " << length<< "<-\n";
  22. if (asterix < length) {
  23. for (int j = 0; j < length; ++j) {
  24. mt[counter][j] = array[j];
  25. //cout << mt[counter][j] << "<->" << array[j]<< "\n";
  26. }
  27. ++counter;
  28. }
  29. lengthFin = length;
  30. }
  31.  
  32.  
  33. for (int i = 0 ; i < counter; ++i) {
  34. for (int j = 0 ; j < lengthFin; ++j) {
  35. // cout << mt[i][j];
  36. }
  37. // cout << counter<<".\n"; //counter = 3
  38. }
  39.  
  40.  
  41.  
  42. int linie = counter ;
  43. for (int i = 0; i <= counter; ++i, --linie) {
  44.  
  45. for (int j = 0; j < lengthFin; ++j) {
  46. // cout << mt[j][i] <<",";
  47. if ((mt[j][i] >= 'a' && mt[j][i] <= 'z') || (mt[j][i] >= 'A' && mt[j][i] <= 'Z')) {
  48. secMt[linie][j] = mt[j][i];
  49. }
  50. }
  51. // cout <<" \n";
  52. }
  53.  
  54. for (int i = 1 ; i <= counter; ++i) {
  55. for (int j = 0 ; j < lengthFin; ++j) {
  56. cout << secMt[i][j];
  57. }
  58. cout <<".\n";
  59. }
  60.  
  61.  
  62. return 0;
  63. }
  64.  
  65.  
  66. /*
  67. a*c*
  68. **sd
  69. v*g*
  70. ****
  71. */
Success #stdin #stdout 0.01s 5316KB
stdin
AmAmAb
Nunera
Ilarel
Mt*t*a
Ae***u
L****r
stdout
balaur.
Are.
mert.
Ana.
multe.
ANIMAL.