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