SHARE
TWEET

Lottószámok - péda

a guest Oct 21st, 2016 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. void change(char *a, char *b)
  6. {
  7.     char x;
  8.     x=*a;
  9.     *a=*b;
  10.     *b=x;
  11. }
  12.  
  13. int main()
  14. {
  15.     int i;
  16.     char szamok[90];
  17.     srand(time(NULL));
  18.  
  19.     for(i=0;i<90;i++) szamok[i]=i+1;
  20.  
  21.     for(i=0;i<5;i++)
  22.     {
  23.         change(&szamok[i],&szamok[i+(rand()%90-i)]);
  24.         printf("%d. nyerőszám: %d\n",i+1,szamok[i]);
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top