MarcinKrol

Zad 3 - Pseudolosowość

Apr 7th, 2020
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. #include <cstdlib>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. //Zad 3; Pseudolosowość
  9.  
  10.  
  11. int main()
  12. {
  13. int wynik = 0;
  14. srand(time(NULL));
  15.  
  16. for(int i=1; i<=100; i++)
  17. {
  18. wynik = wynik + rand()%11+10;
  19. }
  20. cout << wynik << endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment