Nu o sa scriu decat int main-ul....declaratiile variabilelor le faci tu(int-ul)
1.
int main()
{cin>>n;
sw=0;
for(i=2;i<=n;i++)
if(v[1]==v[i]) sw=0;
else sw=1;
if(sw==0) cout<<"sunt egale"; else cout<<"nu sunt egale";
return 0;
}
2.
int main()
{cin>>n;
for(i=1;i<=n;i++)
for(j=1;<=n;j++)
cin>>a[i][j];
for(i=1;i<=n;i++)
cout<<a[i][1]<<" ";
cout<<endl;
for(j=1;j<=n;j++)
cout<<a[n][j]<<" ";
cout<<endl;
for(i=1;i<=n;i++)
cout<<a[i][n]<<" ";
cout<<endl;
for(j=1;j<=n;j++)
cout<<a[1][j]<<" ";
cout<<endl;
return 0;
}
3 se face cu vector de frecventa