Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<ctime>
- #include<cstdlib>
- #include<windows.h>
- using namespace std;
- int main()
- {
- int x, y, z, sum=0, a;
- srand(time(NULL));
- x= rand()%27+1;
- y= rand()%27+1;
- z= rand()%27+1;
- sum = x+y+z;
- cout << "System wylosowal 3 cyfry z przedzialu 1-28, oto one: " << endl;
- cout << "x wynosi: " << x << endl;
- cout << "y wynosi: " << y << endl;
- cout << "z wynosi: " << z << endl;
- cout << "Ile wynosi ich suma?" << endl;
- while(a!=sum)
- {
- cout << "Suma to: ";
- cin >> a;
- if(a!=sum)
- {
- cout << "Zle! policz dokladnie!" << endl << endl;
- Sleep(1500);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement