#include <iostream>
#include <time.h>
using namespace std;
int main()
{
srand(time(NULL));
bool strzal[100]={false};
int qmin=1,qmax=100;
int strzel;
int pr=1;
string pod;
cout << "Program zgaduje jaka liczbe masz w pamiei,jezeli liczba jest za duza to napisz d a jak za mala m gdy program zgadnie napisz +" << endl;
while(true)
{
again:
strzel = rand()%(qmax-qmin+1)+qmin;
if (strzal[strzel-1]==true) goto again;
cout << strzel << endl;
if (qmin==qmax)
{
cout << "Liczba o ktorej pomyslales to: " << qmin << endl;
cout << "Udalo mi sie za " << pr << endl;
break;
}
podaj:
cout << "-";
cin >> pod;
if (pod=="m")
{
qmin=strzel+1;
}
else if (pod=="d")
{
qmax=strzel-1;
}
else if (pod=="+")
{
cout << "Udalo mi sie za: "<<pr;
break;
}
else goto podaj;
pr++;
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}