Код
#include <iostream>
#include <windows.h>
#include <cstdlib>
using namespace std;
int main()
{
cout << "Author: McLuhan." << endl << endl << endl;
#define minN 1
#define maxN 50
int randNumber = 0, ans = 0, proba = 0;
srand((unsigned)time(NULL));
randNumber = minN+(rand() % (maxN-minN+1));
cout << "Chislo zagadano, otgadai ego!" << endl;
for(; <img src="http://s59.ucoz.net/sm/7/wink.gif" border="0" align="absmiddle" alt="wink" />
{
if(proba == 1) cout << "Probui eshe.." << endl;//
cin >> ans;
if(!cin) return 0;
else if(ans > maxN || ans < minN) cout << "Limit (numbers: 1-50)." << endl, proba = 1;
else if(ans == randNumber) { cout << "YOU WINNER! Number: " << randNumber << "." << endl; Sleep(1000); exit(0); }
else if(ans > randNumber) cout << "Vashe chislo bolshe zagadanogo." << endl, proba = 1;
else if(ans < randNumber) cout << "Vashe chislo menshe zagadanogo." << endl, proba = 1;
}
char response;
std::cin >> response;
return 0;
}
Скачать .exe: http://rghost.ru/44283661