题解 | 年轻人不讲5的

年轻人不讲5的

https://www.nowcoder.com/practice/504e04804610463facbedaad9a8c742e

#include <iostream>
#include <string>
using namespace std;


int main() 
{
    string rb;
    cin >> rb;
    for(char &c : rb) {  // 使用引用直接修改
        if(c == '5') {
            c = '*';
        }
    }
    
    cout << rb;
    return 0;
}

// 64 位输出请用 printf("%lld")

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务