Advertisement
NuquernaNarsil

Kwadrat_*_?_iteracja

Sep 17th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5. main()
  6. {
  7. const int a=5, b=5;
  8.  
  9. for (int i=0;i<a;i++)
  10.     {
  11.         if (i%2==0)
  12.         {
  13.        
  14.             for (int i=0;i<b;i++)
  15.             {
  16.                 if (i%2==0)
  17.                     cout << "* ";
  18.                 else
  19.                     cout <<"? ";
  20.             }
  21.         }
  22.         else
  23.         {
  24.        
  25.             for (int i=0;i<b;i++)
  26.             {
  27.                 if (i%2==1)
  28.                     cout << "* ";
  29.                 else
  30.                     cout <<"? ";
  31.             }
  32.         }
  33.        
  34.         cout << endl << endl;
  35.     }  
  36. getch();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement