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. for (int j = 0; j < length; ++j) {
  16. mt[counter][j] = array[j];
  17. }
  18. lengthFin = length;
  19. ++counter;
  20. }
  21.  
  22. /*
  23.   if ((array[j] >= 'a' && array[j] <= 'z') || (array[j] >= 'A' && array[j] <= 'Z')) {
  24. mt[counter][j] = array[j];
  25. }
  26. */
  27.  
  28.  
  29.  
  30.  
  31.  
  32. for (int i = lengthFin - 1; i >= 0; --i) {
  33. int asterix = 0;
  34. for (int j = 0 ; j < lengthFin; ++j) {
  35. if (mt[j][i] == '*') {
  36. ++asterix;
  37. }
  38.  
  39. if ((mt[j][i] >= 'a' && mt[j][i] <= 'z') || (mt[j][i] >= 'A' && mt[j][i] <= 'Z')) {
  40. cout << mt[j][i]<< ".";
  41.  
  42. //mt[counter][j] = array[j];
  43. }
  44. //cout << mt[j][i]<< " ";
  45. }
  46. if ( asterix < lengthFin) {
  47. cout <<"\n"; //
  48. }
  49.  
  50.  
  51. }
  52. return 0;
  53. }
  54.  
  55.  
  56. /*
  57. a*c*
  58. **sd
  59. v*g*
  60. ****
  61. ==============
  62.  *****
  63. *Ulei
  64. Vi**D
  65. Pahar
  66. CANA*
  67. =======
  68. ****
  69. a*sa
  70. dd*b
  71. ***z
  72. ===========]
  73.  
  74. ****
  75. a*sa
  76. dd*b
  77. ***z
  78. */
Success #stdin #stdout 0.01s 5320KB
stdin
 *****
*Ulei
Vi**D
Pahar
CANA*
stdout
i.D.r.
e.a.A.
l.h.N.
U.i.a.A.
V.P.C.