Giúp em làm bài tập C/C++: Nhập một ma trận kích thước n*m với 2<=n,m<=100

Viết các hàm sau:
- Nhập một ma trận kích thước n*m với 2<=n,m<=100
- Hiện ma trận kích thước n*m ra màn hình
- Tìm ra hàng có tổng giá trị lớn nhất trong ma trận
- Viết chương trình chính gọi các hàm trên
 

VSupport

Ngây thơ trong tối
Tham khảo bài này nè bạn:
Mã:
[COLOR=#FF8000][FONT=monospace]#include<stdio.h> 
#include<conio.h> 
#define MAX 100 

[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]void nhap[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]MAX[/FONT][/COLOR][COLOR=#007700][FONT=monospace]],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) 
{  
     for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
     for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
     { 
                 [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]" nhap a[%d][%d]:"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
                 [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]scanf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"%d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],&[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]]); 
     }  
}       
       
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]void inmatran[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]MAX[/FONT][/COLOR][COLOR=#007700][FONT=monospace]],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int m[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) 
{      
      [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]" ma tran vua nhap la:"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
      for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
      { 
           [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\n"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
           for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
                   [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"%3d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]]); 
      } 
} 

[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]void max_min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]MAX[/FONT][/COLOR][COLOR=#007700][FONT=monospace]],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int n[/FONT][/COLOR][COLOR=#007700][FONT=monospace])[/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]//tim gia tri lon nhat , nho nhat , vi tri lon nhat,nho nhat 
[/FONT][/COLOR][COLOR=#007700][FONT=monospace]{    
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int hmax[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmax[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmin[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmin[/FONT][/COLOR][COLOR=#007700][FONT=monospace];  
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int max[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace];  
     
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmax [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmax [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmin [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmin [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace]]; 
     
    for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
    for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
    { 
            if([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]]>[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max [/FONT][/COLOR][COLOR=#007700][FONT=monospace]) 
            { 
                     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]];  
                     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmax[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
                     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmax[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
            } 
            if([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]] < [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) 
            { 
                     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]];  
                     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmin[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
                     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmin[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
            } 
     } 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\ngia tri lonnhat la :%d" [/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max [/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\tvi tri : hang %d cot %d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmax[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmax[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
      
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\ngia tri nho nhat la :%d" [/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min [/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\tvi tri : hang %d cot %d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hmin[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cmin[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
} 

[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int tonghang[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]MAX[/FONT][/COLOR][COLOR=#007700][FONT=monospace]],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int i[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int m[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]//tinh tong cua hang i 
[/FONT][/COLOR][COLOR=#007700][FONT=monospace]{ 
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int S[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
    for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]S [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]S [/FONT][/COLOR][COLOR=#007700][FONT=monospace]+ [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]j[/FONT][/COLOR][COLOR=#007700][FONT=monospace]]; 
    return [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]S[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
} 

[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int hang_lonnhat[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]MAX[/FONT][/COLOR][COLOR=#007700][FONT=monospace]],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]//tim hang co tong lon nhat 
[/FONT][/COLOR][COLOR=#007700][FONT=monospace]{ 
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int max[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]tonghang[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);[/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]//khoi tao max bang tong cua hang 1 
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int h[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
    for([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace];[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++) 
          if([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max [/FONT][/COLOR][COLOR=#007700][FONT=monospace]< [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]tonghang[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace])) 
           { 
                 [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]tonghang[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
                 [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]h [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]i[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
           } 
    return [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]h[/FONT][/COLOR][COLOR=#007700][FONT=monospace];  
} 

[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int  main[/FONT][/COLOR][COLOR=#007700][FONT=monospace]() 
 { 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]int a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]100[/FONT][/COLOR][COLOR=#007700][FONT=monospace]][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]100[/FONT][/COLOR][COLOR=#007700][FONT=monospace]]; 
      
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"nhap so hang  m :"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]scanf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"%d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],&[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"nhap so cot:"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]scanf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"%d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],&[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
      
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]nhap[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]inmatran[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]max_min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printf[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\n\nhang co tong lon nhat la hang thu : %d"[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hang_lonnhat[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]a[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]m[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]n[/FONT][/COLOR][COLOR=#007700][FONT=monospace])); 
     [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]getch[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); 
     return [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
}  [/FONT][/COLOR]
 
Bạn ơi, bây giờ đề bài bắt tính thêm trung bình cộng đường chéo chính thì phải làm tiếp như thế nào vậy bạn
 

taplamhacker

♥ Thanh Trâm ♥
:oh: bạn đã học dc những gì về lập trình rồi
bạn có thể tự code 1 đoạn nhập và xuất ma trận 2 chiều k
 

Thống kê

Chủ đề
100,746
Bài viết
467,568
Thành viên
339,849
Thành viên mới nhất
chicstore.accessories
Top