题解 | 好数

好数

https://www.nowcoder.com/practice/01333f3ba6484d1db875ba14a41a8277?tpId=391&channelPut=tracker1

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    string s;//字符串输入
    cin>>s;
    reverse(s.begin(),s.end());//利用反转函数翻一下,直接判断第一位就好了
    if(s[0]=='0'){
        cout<<"NO";
    }
    else cout<<"YES";
    return 0;//可能有点麻烦,但可以学习思想,
}

全部评论

相关推荐

2025-12-15 14:25
云南大学 Java
lei22:入职可能会看学信网,最好别伪装,这个简历找实习肯定是够的,肯定会有收 28 届实习生的公司的,多投就行
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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