Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7. int cos = 1;
  8. while (cos==1) {
  9. srand(time(NULL));
  10. int x, y, z, wynik;
  11. printf("Podaj zakres losowanych liczb: ");
  12. scanf_s("%d %d", &x, &y);
  13. printf("Ile liczb ma wylosowac: ");
  14. scanf_s("%d", &z);
  15. for (int i = 0; i < z; i++) {
  16. wynik = rand() % (y - x) + x;
  17. printf("%d ", wynik);
  18. }
  19. printf("\n");
  20. printf("Chcesz wylosowac jeszcze raz? Podaj 1: ");
  21. scanf_s("%d", &cos);
  22. }
  23. system("pause");
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement