Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n,m,p=0,i,j;
cout<<"n=";
cin>>n;
cout<<"m=";
cin>>m;
int a[n][m],b[p];
for(i=0;i<n;i++)
for(j=0;j<m;j++)
{
cout<<"a["<<i<<"]["<<j<<"]=";
cin>>a[i][j];
if(a[i][j]>0)
{
b[p]=a[i][j];
p++;
}
}
for(i=0;i<p;i++)
{
cout<<"elementul vectorului "<<b[i]<<endl;
for(j=1;j<=b[i];j++)
if(b[i]%j==0)
cout<<j<<", ";
cout<<endl;
}
return 0;
}
Explicație:
Multumesc+5*+cel mai inteligent raspuns?