Advertisement
imedvedev

Untitled

Oct 28th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <windows.h>
  5. #include <time.h>
  6.  
  7. int main(){
  8.     SetConsoleCP(1251);
  9.     SetConsoleOutputCP(1251);
  10.  
  11.     int m;
  12.  
  13.     printf("Мне нужно число, одно число:\n");
  14.     scanf("%d", &m);
  15.  
  16.     Matrix(m);
  17. }
  18.  
  19. int Matrix(int m){
  20.     int o, i, x;
  21.     int M[m][m];
  22.  
  23.     srand(time(NULL));
  24.  
  25.     for(o = 0; o < m; o++){
  26.         for(i = 0; i < m; i++){
  27.             M[o][i] = rand()%10;
  28.         }
  29.     }
  30.  
  31.  
  32.     for(o = 0; o < m; o++){
  33.         printf("\n");
  34.         for(i = 0; i < m; i++){
  35.             printf("%d  ", M[o][i]);
  36.         }
  37.     }
  38.  
  39.     int max, stroka;
  40.     max = 0;
  41.     stroka = 0;
  42.  
  43.     for(o = 0; o < m; o++){
  44.         for(i = 0; i < m; i++){
  45.             //M[o][i]
  46.         if(M[o][i] > max) {
  47.             max = M[o][i];
  48.             stroka = o;
  49.         }
  50.         }
  51.     }
  52.  
  53.     for(o = 0; o < m; o++){
  54.         printf("\n");
  55.         for(i = 0; i < m; i++){
  56.         if(o !== stroka) {
  57.         printf("%d  ", M[o][i]);
  58.         }
  59.         }
  60.     }
  61.  
  62.     return 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement