Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using std::cout;
- using std::cin;
- int main()
- {
- srand(time(0));
- int a = rand()%10+1;
- cout<<"\t\t\tPogoduvanje random broj"<<"\n";
- for (int i=0; i < 3; i++)
- {
- int broj;
- cout<<"Vnesi broj:\t";
- cin>>broj;
- if (a > broj)
- {
- if ( i==2)
- {
- cout<<"Ne go pogodivte brojot";
- }
- else
- {
- cout<<"Baraniot broj e pogolem:\t";
- }
- }
- else if(a < broj)
- {
- if ( i ==2)
- {
- cout<<"Ne go pogodivte brojot";
- }
- else
- {
- cout<<"Baraniot broj e pomal";
- }
- }
- else
- {
- cout<<"Go pogodivte brojot";
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement