Matritsani manfiy elеmеnti jоylashgan qatоr va ustun elеmеntlari оlib tashlansin


Download 28.04 Kb.
Sana19.06.2023
Hajmi28.04 Kb.
#1606090
Bog'liq
3-amaliyot hayitboyev jaloladdin


Matritsani manfiy elеmеnti jоylashgan qatоr va ustun elеmеntlari оlib tashlansin.(manfiy element bitta bo’lishi kafolatlanadi)


Kiruvchi ma’lumotlar: Birinchi satrda N va M (1<=N,M <=50). Keyingi N satrda M ta butun son matritsa elementlari (-100<=a[i,j]<=100).

#include


#include
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int num[n][m];
int fine_n[n];
int fine_m[m];
int c_n=0;
int c_m=0;
for(int i=0; i{
for(int j=0; j{
cin>>num[i][j];
if(num[i][j]<0)
{
fine_n[c_n] = i;
fine_m[c_m] = j;
c_m++;
c_n++;
}
}
}
#include
#include
using namespace std;

int main()


{
int n,m;
cin>>n>>m;
int num[n][m];
int fine_n[n];
int fine_m[m];
int c_n=0;
int c_m=0;
for(int i=0; i{
for(int j=0; j{
cin>>num[i][j];
if(num[i][j]<0)
{
fine_n[c_n] = i;
fine_m[c_m] = j;
c_m++;
c_n++;
}
}
}
cout<for(int i=0; i{
bool finest_n = find(fine_n, fine_n+c_n, i) !=fine_n+c_n;
if(finest_n)
{
continue;
}
else
{
for(int j=0; j{
bool finest_m = find(fine_m, fine_m+c_m, j) !=fine_m+c_m;
if(finest_m)
{
cout<<" ";
}
else
{
cout<}
}
cout<}
}

return 0;


}
for(int i=0; i{
bool finest_n = find(fine_n, fine_n+n, i) !=fine_n+n;
if(finest_n)
{
continue;
}
else
{
for(int j=0; j{
bool finest_m = find(fine_m, fine_m+m, j) !=fine_m+m;
if(finest_m)
{
cout<<" ";
}
else
{
cout<}
}
cout<}
} return 0;
}

Download 28.04 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling