Advertisement
isendrak

test.cpp

Feb 21st, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <time.h>
  4. #include <math.h>
  5.  
  6. int main(){
  7.     srand(time(0));
  8.     const int NRESULTS=10;
  9.     int results[NRESULTS];
  10.     for(int i=0;i<NRESULTS;i++) results[i]=0;
  11.     for(int i=0;i<pow(NRESULTS,3);i++) results[rand()%NRESULTS]++;
  12.     for(int i=0;i<NRESULTS;i++) printf("Die %d gibt es %d mal\n",i,results[i]);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement