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. if (asterix < length) {
  22. for (int j = 0; j < length; ++j) {
  23. if ((array[j] >= 'a' && array[j] <= 'z') || (array[j] >= 'A' && array[j] <= 'Z')) {
  24. mt[counter][j] = array[j];
  25. }
  26. //mt[counter][j] = array[j];
  27. }
  28. ++counter;
  29. }
  30. lengthFin = length;
  31. }
  32.  
  33.  
  34. for (int i = 0 ; i < counter; ++i) {
  35. for (int j = 0 ; j < lengthFin; ++j) {
  36. cout << mt[i][j]<< "" << j<<".";
  37. }
  38. cout <<"\n"; //
  39. }
  40.  
  41. // TOTUL BINE
  42. //cout << counter << " " << lengthFin; // 3 4
  43. /////////////////////////////////////////////////////// 4 linii 5 coloane
  44.  
  45. /*
  46.  if ((mt[j][i] >= 'a' && mt[j][i] <= 'z') || (mt[j][i] >= 'A' && mt[j][i] <= 'Z')) {
  47. //cout << col - 1 <<" " << i <<" \n";
  48. secMt[linie][col] = mt[j][i];
  49. }
  50.  
  51.  
  52. //
  53. for () {
  54. for () {
  55.  
  56. }
  57. }
  58. */
  59.  
  60. for (int i = 1 ; i <= counter; ++i) {
  61. for (int j = 0 ; j <= lengthFin + 1; ++j) {
  62. // cout << secMt[i][j] ;
  63. }
  64. // cout <<".\n";
  65. }
  66.  
  67.  
  68. return 0;
  69. }
  70.  
  71.  
  72. /*
  73. a*c*
  74. **sd
  75. v*g*
  76. ****
  77. ==============
  78.  *****
  79. *Ulei
  80. Vi**D
  81. Pahar
  82. CANA*
  83. =======
  84. ****
  85. a*sa
  86. dd*b
  87. ***z
  88. ===========]
  89.  
  90. ****
  91. a*sa
  92. dd*b
  93. ***z
  94. */
Success #stdin #stdout 0.01s 5320KB
stdin
*****
*Ulei
Vi**D
Pahar
CANA*
stdout
0.U1.l2.e3.i4.
V0.i1.2.3.D4.
P0.a1.h2.a3.r4.
C0.A1.N2.A3.4.