abc 346 B
#include <iostream>
using namespace std;
int a, b;
char str[15] = "wbwbwwbwbwbw";
const int len = 12;
int main()
{
cin >> a >> b;
for (int i = 0; i < len; i ++)
{
int l = 0, r = 0;
int k = i;
while (l < a && r < b)
{
if (str[k] == 'w') l ++ ;
else r ++ ;
k = (k + 1) % len;
}
// 这里注意可能有多个缺少的琴键,用循环
while (l < a)
{
if (str[k] == 'w') l ++ ;
else break;
k = (k + 1) % len;
}
while (r < b)
{
if (str[k] == 'b') r ++ ;
else break;
k = (k + 1) % len;
}
if (l == a && r == b)
{
printf("Yes\n");
return 0;
}
}
printf("No\n");
return 0;
}
abc 345A
// if else 比较琐碎
#include <iostream>
using namespace std;
char c;
bool st;
int main()
{
cin >> c;
if (c != '<')
{
cout << "No" << endl;
return 0;
}
st = true;
while (cin >> c)
{
if (!st)
{
cout << "No" << endl;
return 0;
}
if (c != '=')
{
if (c == '>') st = false;
else
{
cout << "No" << endl;
return 0;
}
}
}
if (!st) cout << "Yes" << endl;
else cout << "No" << endl;
return 0 ;
}
abc 345B
// 知识点:有符号数默认向 0 取整
long long n;
int main()
{
cin >> n;
if (n > 0) cout << (n + 9) / 10 << endl;
else cout << n / 10 << endl;
return 0;
}