Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a = 0, b = 0, c = 3;
- void p1(int nr)
- {
- if (nr == 0)
- {
- a = 10;
- }
- if (nr == 1)
- {
- a = 10;
- b = b + 5;
- }
- if (nr == 2)
- {
- a = 10;
- b = b + 5;
- c = c + a;
- }
- }
- void p1out(int nr)
- {
- if (nr == 0)
- {
- cout<<"a = 10";
- }
- if (nr == 1)
- {
- cout<<"a = 10 | b = b + 5";
- }
- if (nr == 2)
- {
- cout << "a = 10 | b = b + 5 | c = c + a";
- }
- if(nr==3)
- cout << "------------";
- }
- void p2(int nr)
- {
- if (nr == 0)
- {
- b = b + c;
- }
- if (nr == 1)
- {
- b = b + c;
- a = a + b;
- }
- }
- void p2out(int nr)
- {
- if (nr == 0)
- {
- cout<<"b = b + c";
- }
- if (nr == 1)
- {
- cout<<"b = b + c | a = a + b";
- }
- if(nr==2)
- cout << "------------";
- }
- void p3(int nr)
- {
- if (nr == 0)
- {
- c = b + 10;
- }
- if (nr == 1)
- {
- c = b + 10;
- a = 2 * a;
- }
- if (nr == 2)
- {
- c = b + 10;
- a = 2 * a;
- b = b + a;
- }
- }
- void p3out(int nr)
- {
- if (nr == 0)
- {
- cout<<"c = b + 10";
- }
- if (nr == 1)
- {
- cout<<"c = b + 10 | a = 2 * a";
- }
- if (nr == 2)
- {
- cout<<"c = b + 10 | a = 2 * a | b = b + a";
- }
- if(nr==3)
- cout << "------------";
- }
- int main()
- {
- for (int i = 0;i < 4;i++)
- {
- for (int j = 0; j < 3; j++)
- {
- for (int k = 0; k < 4; k++)
- {
- p1(i);
- p2(j);
- p3(k);
- p1out(i);
- cout << endl;
- p2out(j);
- cout << endl;
- p3out(k);
- cout << endl;
- cout<< (a + b + c) << endl;
- a = 0;
- b = 0;
- c = 3;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement