题解 | #小乐乐改数字#
小乐乐改数字
https://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d
#include<stdio.h> #include<math.h> int main() { long long n; long long x, sum = 0; scanf("%lld", &n); int i = 1; while (n) { x = n % 10; if (x % 2 == 0) { sum = sum + 0 * pow(10, i); } else { sum = sum + 1 * pow(10, i); } n = n / 10; i++; } sum = sum / 10; printf("%lld", sum); return 0; }