Guest User

Untitled

a guest
Feb 23rd, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. void wynik(int *aa, string *wwartosc, int *atakw, int *obrw, int *magiaw)
  9. {
  10. *aa = 0;
  11. *aa = (*atakw * 2) + (*obrw*2 )- (*magiaw);
  12. if(*aa<40)
  13. *wwartosc = " !!! stanowczo ";
  14. if(*aa<77)
  15. *wwartosc= *wwartosc + "!!! ";
  16. if(*aa<99)
  17. *wwartosc = *wwartosc + "za malo ";
  18. if(*aa==99)////////////
  19. *wwartosc = "wygrales gre xd";///////
  20. if(*aa>99)
  21. *wwartosc = *wwartosc + " za duzo ";
  22. if(*aa>111)
  23. *wwartosc = *wwartosc + "!!! ";
  24. if(*aa>122)
  25. *wwartosc = *wwartosc + " stanowczo !!!";
  26.  
  27. }
  28.  
  29. void boost(int *atakw, int *obrw, int *magiaw)
  30. {
  31.  
  32. *atakw +=1;
  33. *obrw+=1;
  34. *magiaw+=0;
  35. }
  36.  
  37. using namespace std;
  38.  
  39. int main()
  40. {
  41. int a=0;
  42. int *aa = &a;
  43. string wartosc;
  44. string *wwartosc = &wartosc;
  45. int atak=2;
  46. int magia=1;
  47. int obr=2;
  48.  
  49. int *atakw = &atak;
  50. int *magiaw = &magia;
  51. int *obrw = &obr;
  52. int z;
  53.  
  54. int q=0;
  55. cout<<"napewno wiesz ze ponad 40 paczkow nie zjesz"<<endl<<" traf idealna ilosc by byc szczesliwym"<<endl;
  56.  
  57. while(q<1)
  58. {
  59. wartosc=" ";
  60. atak=2;
  61. magia=1;
  62. obr=2;
  63.  
  64.  
  65.  
  66. cout<<endl<<"podaj ilosc: ";
  67. cin>>z;
  68.  
  69.  
  70. for(int i=0; i<z; i++)
  71. {
  72. boost(atakw, obrw, magiaw);
  73. }
  74. wynik(aa, wwartosc, atakw,obrw,magiaw);
  75. cout<<"twoj rezultat:"<<*wwartosc<<endl;;
  76. //cout<<"wynikkk to: "<<*aa; sprawdzanie i dopasowywanie wartosci
  77.  
  78. if(*wwartosc == "wygrales gre xd")
  79. q++;
  80. }
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment