Răspuns :
Salut. Ti-am lasat rezolvarea mai jos. Succes in continuare!
1)
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n, i, aux, ci;
cin >> n;
for (i = 1; i <= n; i++)
{
ci = i;
aux = 0;
while (ci != 0)
{
aux = aux * 10 + ci % 10;
ci = ci / 10;
}
if (i == aux)
cout << i << " ";
}
return 0;
}
2)
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n, x, cx, i, p, c;
cin >> n;
for (i = 1; i <= n; i++)
{
cin >> x;
cx = x;
p = 1;
while (cx != 0)
{
c = cx % 10;
if (c % 2 == 0)
p = p * c;
cx = cx / 10;
}
cout << "Nr. " << x << " are prod. cif. pare: " << p << endl;
}
return 0;
}
1)
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n, i, aux, ci;
cin >> n;
for (i = 1; i <= n; i++)
{
ci = i;
aux = 0;
while (ci != 0)
{
aux = aux * 10 + ci % 10;
ci = ci / 10;
}
if (i == aux)
cout << i << " ";
}
return 0;
}
2)
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n, x, cx, i, p, c;
cin >> n;
for (i = 1; i <= n; i++)
{
cin >> x;
cx = x;
p = 1;
while (cx != 0)
{
c = cx % 10;
if (c % 2 == 0)
p = p * c;
cx = cx / 10;
}
cout << "Nr. " << x << " are prod. cif. pare: " << p << endl;
}
return 0;
}