fork download
  1. #include<stdio.h>
  2. #include<time.h>
  3.  
  4. int main(void){
  5. int a[5][5];
  6. int num;
  7. int max=99;
  8. int total = 10;
  9. srand((unsigned)time(NULL));
  10.  
  11. for(int b=1;b<=5;b++){
  12. for(int c=1;c<=5;c++){
  13. a[b][c]= (rand()% 99+1);
  14. }
  15. }
  16. for(int k=1;k<total;k++){
  17. num = rand()%max+1;
  18. printf("%2d/%d回目の数:",k+1,total);
  19. printf("%2d\n",num);
  20. for(int b=1;b<=5;b++){
  21. for(int c=1;c<=5;c++){
  22. a[b][c]= (rand()% 99+1);
  23. if(a[b][c]== num){
  24. a[b][c]=0;}
  25. if(a[b][c]==0){
  26. printf("**");}
  27. else;{
  28. a[b][c]=a[b][c];}
  29. }
  30. }
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
 2/10回目の数:83
 3/10回目の数:21
** 4/10回目の数:32
 5/10回目の数: 6
**** 6/10回目の数:65
** 7/10回目の数: 4
 8/10回目の数:67
 9/10回目の数:85
10/10回目の数:93
**