Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include<time.h>
- int main(void) {
- int a;
- time_t czas;
- scanf("%d", &a);
- int sum = 0;
- for (int i = 0; i < a; i++) {
- int randomNumber = rand() % 1001;
- printf("%d %10ld\n", i, rand() % 1001);
- sum += randomNumber;
- }
- printf("Suma liczb losowych: %d", sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement