标签:mes 题解 bit math space return include out ring
AT5228 [ABC162A] Lucky 7
题面中已经保证 \(s\) 的长度为 \(3\),也就是说,我们只需要把 \(s_0\),\(s_1\),\(s_2\) 全部判断一遍,只要有一个是 \(7\),则输出 Yes
,否则输出 No
。
代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
if(s[0] == ‘7‘ || s[1] == ‘7‘ || s[2] == ‘7‘)
cout << "Yes";
else
cout << "No";
return 0;
}
标签:mes 题解 bit math space return include out ring
原文地址:https://www.cnblogs.com/tearing/p/12817985.html