题解 | while

while

https://www.nowcoder.com/practice/173564fc07c146a88c408c92f4182c65

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

int main() {
    string a;
    cin >> a;
    string target = "while";
    size_t count = 0;
    for(int i = 0; i<5; i++){
        if(a[i] != target[i]) count++;
    }
    cout << count << endl;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

点赞 评论 收藏
分享
xtu大迫杰:偶遇校友,祝校友offer打牌
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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