Advertisement
zicaentu

dice1

Mar 3rd, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. /*
  2. Написать программу бросающую две игральные кости.
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <time.h>
  8.  
  9.  
  10. int main(int argc, char const *argv[])
  11. {
  12.     srand(time(NULL));
  13.  
  14.     printf("Первый кубик: %d\n", rand() % 6 + 1);
  15.     printf("Второй кубик: %d\n", rand() % 6 + 1);
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement