Advertisement
Guest User

Untitled

a guest
Mar 4th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void Clr(void) { for(int i = 0; i < 20; ++i) cout << '\n'; }
  5.  
  6. int main()
  7. {
  8.   int *aeiou = nullptr;
  9.  
  10.   int w = -1;
  11.   cin >> w;
  12.  
  13.   int h = -1;
  14.   cin >> h;
  15.  
  16.   if(h < 1 || w < 1) // Von mir aus auch < 0
  17.   {
  18.     cout << "Nein\n";
  19.     return 0;
  20.   }
  21.  
  22.   aeiou = new int[w * h];
  23.   cout << "aeiou:\n";
  24.   for(int i = 0; i < w * h; ++i)
  25.   {
  26.     cin >> aeiou[i];
  27.   }
  28.  
  29.   Clr();
  30.   for(int y = 0; y < h; ++y)
  31.   {
  32.     for(int x = 0; x < w; ++x)
  33.     {
  34.       cout << aeiou[w * y + x] << ' ';
  35.     }
  36.    
  37.     cout << '\n';
  38.   }
  39.  
  40.   if(aeiou) delete[] aeiou;
  41.   return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement