Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <windows.h>
- #include <time.h>
- int main(){
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- int m;
- printf("Мне нужно число, одно число:\n");
- scanf("%d", &m);
- Matrix(m);
- }
- int Matrix(int m){
- int o, i, x;
- int M[m][m];
- srand(time(NULL));
- for(o = 0; o < m; o++){
- for(i = 0; i < m; i++){
- M[o][i] = rand()%10;
- }
- }
- for(o = 0; o < m; o++){
- printf("\n");
- for(i = 0; i < m; i++){
- printf("%d ", M[o][i]);
- }
- }
- int max, stroka;
- max = 0;
- stroka = 0;
- for(o = 0; o < m; o++){
- for(i = 0; i < m; i++){
- //M[o][i]
- if(M[o][i] > max) {
- max = M[o][i];
- stroka = o;
- }
- }
- }
- for(o = 0; o < m; o++){
- printf("\n");
- for(i = 0; i < m; i++){
- if(o !== stroka) {
- printf("%d ", M[o][i]);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement