Advertisement
DawidKubiak

Zadanie 3

Apr 19th, 2020
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int a=10;
  9.     int b=20;
  10.     int c=0;
  11.     srand(time(NULL));
  12.     for(int i=1;i<101;i++)
  13.     {
  14.        c=c+(a+rand()%(b-a+1));
  15.     }
  16. cout << c;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement