Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- #include <cstdlib>
- using namespace std;
- void wynik(int *aa, string *wwartosc, int *atakw, int *obrw, int *magiaw)
- {
- *aa = 0;
- *aa = (*atakw * 2) + (*obrw*2 )- (*magiaw);
- if(*aa<40)
- *wwartosc = " !!! stanowczo ";
- if(*aa<77)
- *wwartosc= *wwartosc + "!!! ";
- if(*aa<99)
- *wwartosc = *wwartosc + "za malo ";
- if(*aa==99)////////////
- *wwartosc = "wygrales gre xd";///////
- if(*aa>99)
- *wwartosc = *wwartosc + " za duzo ";
- if(*aa>111)
- *wwartosc = *wwartosc + "!!! ";
- if(*aa>122)
- *wwartosc = *wwartosc + " stanowczo !!!";
- }
- void boost(int *atakw, int *obrw, int *magiaw)
- {
- *atakw +=1;
- *obrw+=1;
- *magiaw+=0;
- }
- using namespace std;
- int main()
- {
- int a=0;
- int *aa = &a;
- string wartosc;
- string *wwartosc = &wartosc;
- int atak=2;
- int magia=1;
- int obr=2;
- int *atakw = &atak;
- int *magiaw = &magia;
- int *obrw = &obr;
- int z;
- int q=0;
- cout<<"napewno wiesz ze ponad 40 paczkow nie zjesz"<<endl<<" traf idealna ilosc by byc szczesliwym"<<endl;
- while(q<1)
- {
- wartosc=" ";
- atak=2;
- magia=1;
- obr=2;
- cout<<endl<<"podaj ilosc: ";
- cin>>z;
- for(int i=0; i<z; i++)
- {
- boost(atakw, obrw, magiaw);
- }
- wynik(aa, wwartosc, atakw,obrw,magiaw);
- cout<<"twoj rezultat:"<<*wwartosc<<endl;;
- //cout<<"wynikkk to: "<<*aa; sprawdzanie i dopasowywanie wartosci
- if(*wwartosc == "wygrales gre xd")
- q++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment