You are on page 1of 4

11 B --------------------------------------------------------------------------------------------------

12 B -------------------------------------------------------------------------------------------------#include <fstream>
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
int main()
{
int a[10][10], i, j, n,m,aux,p=1,k,x;
f>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
f>>a[i][j];
f.close();
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
k=0;
aux=a[i][j];
while(aux!=0){
p=aux%10;
k=k*10+p;
aux=aux/10;
}
if(a[i][j]==k){
g<<a[i][j]<<" ";
x++;
}
}
}
if(x==0)
g<<"nu exista numere palindrom";
return 0;
}

13 B ------------------------------------------------------------------------------------------

#include <iostream>
#include <fstream>

using namespace std;


ifstream f("date.in");
ofstream g("date.out");
int main()
{
int a[10][10], i, j, n,m,s=0,k,x;
f>>n>>m;
cout<<"k=";cin>>k;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
f>>a[i][j];
f.close();
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
s=s+a[i][k];
if(s%2==1)
g<<"da";
else
g<<"nu";
return 0;
}

14 B ----------------------------------------------------------------------------------------------------#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
int main()
{
int a[10][10], i, j, n,m,s=0,x;
f>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
f>>a[i][j];
f.close();
for(i=1;i<=n;i++){
for(j=1;j<=m;j++)
s=s+abs(a[i][j]%10);
}
g<<s;
return 0;
}

15 B ------------------------------------------------------------------------------------------------------

16 B -----------------------------------------------------------------------------------------------------

#include <fstream>
#include <stdlib.h>
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
int main()
{
int a[10][10], i, j, n,m,s,x,k;
f>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
f>>a[i][j];
f.close();
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
for(k=1;k<=a[i][j];k++)
if(k*k==a[i][j])
g<<a[i][j]<<" ";
return 0;
}

17 B ----------------------------------------------------------------------------------------------------#include <fstream>
#include <stdlib.h>
using namespace std;
ifstream f("date.in");

ofstream g("date.out");
int main()
{
int a[10][10], i, j, n,m,s,x,k;
f>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
f>>a[i][j];
f.close();
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
for(k=1;k<=a[i][j];k++)
if(k*k*k==a[i][j])
g<<a[i][j]<<" ";
return 0;
}

You might also like