Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Wklejka 5gt9ijdszjwg dodana przez Droso, 04.01.2013 22:23
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68.
#include <iostream>
#include <cstdlib>
#include <ctime>
int main()
{
srand( time( NULL ) );
int liczba =( rand() % 999 ) + 1;
int ile_razy = 0;
int twoja;
std::cin.clear();
std::cin.sync();
std::cout << "Zgadnij liczbe!" << std::endl << std::endl;
std::cin >> twoja;
if(twoja < 1 || twoja > 1000){
do{
std::cin.clear();
std::cin.sync();
std::cout << "Jeszcze raz!" << std::endl << std::endl;
std::cin >> twoja;
}while(twoja < 1);
do{
std::cin.clear();
std::cin.sync();
std::cout << "Jeszcze raz!" << std::endl << std::endl;
std::cin >> twoja;
}while(twoja > 1000);
}
if(std::cin.good()){
do{
if(twoja > liczba){
ile_razy++;
std::cin.clear();
std::cin.sync();
std::cout << "Za duzo!" << std::endl << std::endl;
std::cin >> twoja;
}
else
{
ile_razy++;
std::cin.clear();
std::cin.sync();
std::cout << "Za malo!" << std::endl << std::endl;
std::cin >> twoja;
}
}while(liczba != twoja);
}
else
{
std::cin.clear();
std::cin.sync();
std::cout << "Jeszcze raz!" << std::endl << std::endl;
std::cin >> twoja;
}
if(liczba == twoja){
std::cout << "Zgadles!!! Zgadywales: " << ile_razy << std::endl;
std::cin >> twoja; //zeby program sie nie zamknal :D
}
return 0;
}
Dodanych wklejek: 12861
Powered By (Pav32) Pastebin © 2011


Dodatki SourceMod


