题解 | #小乐乐改数字#
小乐乐改数字
https://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d
#include <stdio.h> #include <string.h> int main() { char num[10] = {}; scanf("%s",num); for (int i=0; i<strlen(num); i++) { int dital = num[i]-'0'; if(dital%2==0) num[i]='0'; else num[i]='1'; } long n = atoi(num); printf("%ld",n); return 0; }