Răspunsuri

Cel mai inteligent răspuns!
2014-06-02T21:32:11+03:00
#include<iostream>
using namespace std;
int f(int a){
int S=0,i;
for(i=2;i<a;i++){
if(a%i==0)S++;
}
return S;
}
int main(){
int i,j,m[20][20],v[20],n;
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++){
cout<<"m["<<i<<"]["<<j<<"]=";
cin>>m[i][j];
}
for(i=1;i<=n;i++){
v[i]=0;
for(j=1;j<=n;j++)
{
if(f(m[i][j])==0&&m[i][j]!=1)v[i]=v[i]+m[i][j];
}}
for(i=1;i<=n;i++)cout<<v[i]<<" ";
return 0;
}
aa...am inteles acum.. Multumesc mult !!
Ma bucur!
Inainte nu rula
Acum da bine!
ok..