Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int a=10,b=20,c,d;
- int main()
- {
- srand(time(NULL));
- for(int i=1;i<=100;i++)
- {
- c=a+rand()%(b-a+1);
- d=d+c;
- }
- cout << "Suma 100 losowych liczb z przedzialu <10;20> wynosi: " << d;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment