12345678910111213141516#include<stdio.h>#include<stdlib.h>int main(void){ int i,n; int count[6]={0}; srand(time(0))
; for(i=0;i<100;i++) { n=rand()%6; count[n]++; } for(i=0;i<6;i++) printf("掷出[%d]次数:%d ",i+1,count[i]); return 0;}
12345678910111213141516#include<stdio.h>#include<stdlib.h>int main(void){ int i,n; int count[6]={0}; srand(time(0))
; for(i=0;i<100;i++) { n=rand()%6; count[n]++; } for(i=0;i<6;i++) printf("掷出[%d]次数:%d ",i+1,count[i]); return 0;}