题解 | #小乐乐改数字#
小乐乐改数字
http://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d
#include<stdio.h> int main() { int n,m=1,q,sum=0; scanf("%d",&n); while(n>m) {q=n/m; if(q%2==1) sum+=m; m*=10; } printf("%d",sum); }
小乐乐改数字
http://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d
#include<stdio.h> int main() { int n,m=1,q,sum=0; scanf("%d",&n); while(n>m) {q=n/m; if(q%2==1) sum+=m; m*=10; } printf("%d",sum); }
相关推荐