Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void trojki(int w)
- {
- int x = 2;
- int y = 1;
- for (int i = 0; i < w; i++)
- {
- int tmp = x;
- for (int j = 0; j < y; j++)
- {
- cout << tmp << " ";
- tmp = tmp ^ 2;
- }
- cout << "\n";
- y = y + 1;
- x = x +2;
- }
- }
- int main()
- {
- int w;
- cout << "Podaj wielkosc =";
- cin >> w;
- trojki(w);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement