#include
#include
int main()
{
int num,nod,i,evensum=0,oddsum=0;
std::cin>>num;
nod = (int)log10(num);
for(i=0;i<=nod;i++)
{
if(i%2==0)
{
evensum = evensum + num/pow(10,nod-i);
}
else
{
oddsum = oddsum + num/pow(10,nod-i);
}
num = num % (int)pow(10,nod-i);
}
std::cout<<oddsum<<std::endl;
std::cout<<evensum;
return 0;
}
what is wrong in this code?? It does not clear two test cases