题解 | 小乐乐改数字
小乐乐改数字
https://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d
#include <iostream>
using namespace std;
#include <string>
int main() {
long long int n;
cin>>n;
string s=to_string(n);
string s_end;
for(char ch:s){
if((int)ch%2==0) s_end.push_back('0');
else s_end.push_back('1');
}
cout<<stol(s_end)<<endl;
}
// 64 位输出请用 printf("%lld")
从简单做起,备战~~~~~
#c++学习#
查看26道真题和解析
