131. Matritsa2
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB
Matritsani ustun elеmеntlari yigindisidan vеktоr хоsil qilinsin, eng katta va eng kichik elеmеnti aniqlansin.
|
Kiruvchi ma’lumotlar: Birinchi satrda n va m(1<=n,m <=80). Keyingi satrda matritsa elementlari n ta satrda m ta butun son (-100<=a[i,j]<=100).
Chiquvchi ma’lumotlar: Birinchi satrda xosil bo’lgan vektor elementlari ikkinchi satrda matritsani eng katta va eng kichik elementi
|
Kiruvchi ma’lumotlar
|
Chiquvchi ma’lumotlar
|
4 7
-84 38 30 78 59 49 -58
64 -76 65 -17 24 -89 59
-36 55 33 61 74 87 -93
72 -51 28 -73 93 -8 41
|
16 -34 156 49 250 39 -51
93 -93
|
6 5
-54 36 51 1 -46 s
12 -85 72 -66 78
-71 70 60 99 -99
95 -56 98 -46 17
-83 21 21 90 -53
89 -54 53 -21 49
|
-12 -68 355 57 -54
99 -99
|
|
#include
using namespace std;
int main()
{
int n,m,i,j;
cin>>n>>m;
double w[n+1][m+1];
for(i=1; i<=n; i++){
for(j=1; j<=m; j++){
cin>>w[i][j];
}
}
cout<for(j=1; j<=m; j++){
int s=0; for(i=1; i<=n; i++){ s+=w[i][j];}
cout<cout<int max=w[i][1];
for(i=1; i<=n;i++){
for(j=1; j<=m; j++){
if(max}
}
int min=w[1][1];
for(i=1; i<=n; i++){
for(j=1; j<=m; j++){
if(min>w[i][j]) min=w[i][j];
}
}
cout<
}
Do'stlaringiz bilan baham: |