Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdlib.h>
- #include <time.h>
- int main()
- {
- int cos = 1;
- while (cos==1) {
- srand(time(NULL));
- int x, y, z, wynik;
- printf("Podaj zakres losowanych liczb: ");
- scanf_s("%d %d", &x, &y);
- printf("Ile liczb ma wylosowac: ");
- scanf_s("%d", &z);
- for (int i = 0; i < z; i++) {
- wynik = rand() % (y - x) + x;
- printf("%d ", wynik);
- }
- printf("\n");
- printf("Chcesz wylosowac jeszcze raz? Podaj 1: ");
- scanf_s("%d", &cos);
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement