Created
July 29, 2016 11:54
-
-
Save otaks/1a6c519f693f3fe2884e318e8fe1bfae to your computer and use it in GitHub Desktop.
random
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
int main() { | |
int v[ 100 ] = { 0 }; | |
srand( time( NULL ) ); | |
for( int j = 0; j<20000; j++){ | |
v[ rand() % 50 + rand() % 51 ]++; | |
} | |
for( int i = 0; i<100; i++ ) { | |
printf("%d\n", v[i]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment