fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdlib.h>
  4. #include <time.h>
  5. #define N 6
  6. #define M 18
  7. void init(int[N][M]);
  8. void prnt(int[N][M]);
  9. void prnt2(int[N][M]);
  10. int main(void) {
  11. int mass[N][M]={{0}};
  12. srand(time(0));
  13. init(mass);
  14. prnt(mass);
  15. prnt2(mass);
  16. return EXIT_SUCCESS;
  17. }
  18. void init(int mass[N][M]){
  19. int i=0,j=0;
  20. for(i=0;i<N;i++){
  21. for(j=0;j<M;j++){
  22. mass[i][j]=-90+rand()%57;
  23. }
  24. }
  25. }
  26. void prnt(int mass[N][M]){
  27. int i=0,j=0;
  28. for(i=0;i<N;i++){
  29. for(j=0;j<M;j++){
  30. printf("%4d",mass[i][j]);
  31. }
  32. printf("\n");
  33. }
  34. }
  35. void prnt2(int mass[N][M]){
  36. int i=0,j=0;
  37. for(i=0;i<N;i++){
  38. for(j=0;j<M;j++){
  39. if((mass[i][j]%6==0)&&(mass[i][j]%9==0)){
  40. printf(" ! ");
  41. }
  42. else{
  43. if(mass[i][j]%6==0)
  44. printf(" - ");
  45. if(mass[i][j]%9==0)
  46. printf(" + ");
  47. if((mass[i][j]%6!=0)&&(mass[i][j]%9!=0)){
  48. printf(" ");
  49. }
  50. }
  51. }
  52. printf("\n");
  53. }
  54. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
 -63 -41 -67 -60 -49 -67 -78 -61 -41 -75 -35 -86 -45 -49 -73 -57 -80 -44
 -79 -62 -58 -61 -49 -39 -81 -49 -52 -73 -66 -82 -73 -80 -89 -50 -50 -89
 -68 -38 -60 -60 -79 -46 -56 -75 -61 -79 -42 -35 -90 -72 -48 -42 -83 -64
 -48 -74 -64 -67 -57 -80 -58 -40 -70 -57 -41 -70 -40 -60 -75 -67 -86 -48
 -79 -36 -74 -34 -82 -67 -77 -82 -89 -35 -75 -82 -49 -90 -66 -64 -66 -89
 -54 -75 -80 -74 -42 -87 -54 -90 -41 -80 -67 -37 -37 -40 -39 -62 -82 -88
  +           -           -                       +                     
                          +               -                             
          -   -                           -       !   !   -   -         
  -                                                   -               - 
      !                                               !   -       -     
  !               -       !   !