fork download
  1.  
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. void Clr(void) { for(int i = 0; i < 20; ++i) cout << '\n'; }
  7.  
  8. int main()
  9. {
  10. int *aeiou = nullptr;
  11.  
  12. int w = -1;
  13. cin >> w;
  14.  
  15. int h = -1;
  16. cin >> h;
  17.  
  18. if(h < 1 || w < 1) // Von mir aus auch < 0
  19. {
  20. cout << "Nein\n";
  21. return 0;
  22. }
  23.  
  24. aeiou = new int[w * h];
  25. cout << "aeiou:\n";
  26. for(int i = 0; i < w * h; ++i)
  27. {
  28. cin >> aeiou[i];
  29. }
  30.  
  31. Clr();
  32. for(int y = 0; y < h; ++y)
  33. {
  34. for(int x = 0; x < w; ++x)
  35. {
  36. cout << aeiou[w * y + x] << ' ';
  37. }
  38.  
  39. cout << '\n';
  40. }
  41.  
  42. if(aeiou) delete[] aeiou;
  43. return 0;
  44. }
  45.  
  46.  
Success #stdin #stdout 0s 3432KB
stdin
1
1
2
3
stdout
aeiou:




















2