i have written the code and i cant figure out why all the test cases are not working
please check my coding part
#include
using namespace std;
int main() {
int x,n;
cin>>x;
n=x;
int even=0;
int odd=0;
int count=0;
while(x!=0){
count++;
x=x/10;
}
if(count %2 ==0){
while(n!=0){
even = even + n%10;
n= n/10;
odd = odd + n%10;
n= n/10;
}
}
else{
while(n!=0){
odd = odd +n%10;
n= n/10;
even = even + n%10;
n=n/10;
}
}
cout<<odd<<endl;
cout<<even;
return 0;
}