#include"stdio.h"#include"math.h"
int main()
{
long int n,b=0;
scanf("%ld",&n);
long int m=n;
while(n!=0)
{
n/=10;
b++;
}
long int a[b];

b=0;
while(m!=0)
{
a[b]=m%10;
m/=10;
b++;
}
int p=0;
int c[b];
for(int g=0;g<b;g++)
{
if(a[g]%2==(g+1)%2) c[p]=1;
else if(a[g]%2!=(g+1)%2) c[p]=0;
p++;
}
int k;
for(int z=0;z<b;z++) k+=pow(2,z)*c[z];
printf("%d",k);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/195516.html
標籤:非技術區
上一篇:楊輝三角問題代碼,求助!
