SHARE
TWEET

Untitled

a guest Jan 29th, 2020 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. void trojki(int w)
  4. {
  5.     int x = 2;
  6.     int y = 1;
  7.     for (int i = 0; i < w; i++)
  8.     {
  9.         int tmp = x;
  10.         for (int j = 0; j < y; j++)
  11.         {
  12.             cout << tmp << " ";
  13.             tmp = tmp ^ 2;
  14.         }
  15.         cout << "\n";
  16.         y = y + 1;
  17.         x = x   +2;
  18.     }
  19. }
  20.  
  21. int main()
  22. {
  23.     int w;
  24.     cout << "Podaj wielkosc =";
  25.     cin >> w;
  26.     trojki(w);
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top