Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i, a, x, suma;
- i = 0;
- a = 2;
- x = 4;
- suma = 0;
- // Wypisuje startowe wartości
- cout << "i = " << i << endl;
- cout << "a = " << a << endl;
- cout << "x = " << x << endl;
- cout << "suma = " << suma << endl;
- cout << endl;
- for(;i < 4;)
- {
- cout << i << " < 4: ";
- //Wyświetla boolowską reprezentację i < 4
- if(i < 4)
- {
- cout << "TAK" << endl;
- }
- else
- {
- cout << "NIE" << endl;
- }
- //i:=i+1
- cout << i << " + 1 =";
- i++;
- cout << i <<endl;
- //suma:=suma+a
- cout << suma << " + " << a;
- suma = suma + a;
- cout << " = " << suma <<endl;
- //a:=a+x
- cout << a << " + " << x;
- a = a + x;
- cout << " = " << a << endl << endl;
- }
- //Wyświetla boolowską reprezentację i < 4
- cout << i << " < 4: ";
- if(i < 4)
- {
- cout << "TAK";
- }
- else
- {
- cout << "NIE";
- }
- cout << endl << suma;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement