Pagini recente » Monitorul de evaluare | Statistici Ioana Agheorghiesei (ioana_agheorghiesei) | Istoria paginii utilizator/dianahusanu925 | Rating Sandu Andrei (anderut22) | Cod sursa (job #1928864)
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
bool isdigit(char c){
if (c-48>9 || c-48<0)
return 0;
return 1;
}
int nrcif (int n){
int z=0;
while (n){
z++;
n=n/10;
}
return z;
}
int main()
{
freopen ("adunare.in", "r", stdin);
freopen ("adunare.out", "w", stdout);
char c;
int x,r,r2=0;
scanf ("%c", &c);
r = 0;
while (isdigit(c))
{
r=r*10+c-'0';
scanf ("%c", &c);
}
scanf ("%c", &c);
while (isdigit(c))
{
r2=r2*10+c-'0';
scanf ("%c", &c);
}
int n=r+r2;
int i, z, cif;
z=nrcif(n);
char kk;
for (i=1;i<=z;i++){
cif=(n/(int)pow(10,z-i))%10;
kk=cif+'0';
cout<<kk;
}
return 0;
}