题解:洛谷P13006 在现实和志向中选择现实,否则会一个都得不到的。


此篇题解为非字符串解法,如需查看字符串解法请移步其它题解
一道简单的模拟题,直接输入就好,不想用字符串就用其它变量储存标点符号,判断时不判断标点即可。
下面上代码:

#include<bits/stdc++.h> using namespace std; int main() { string a,d,b,e,c; cin>>a>>d>>b>>e>>c; bool flag=false; if(a==b and c=="weak.") { flag=true; } if(flag==true) { cout<<"Plang."; } else { cout<<"Not plang."; } return 0; }

洛谷发布日期为2025-06-29 17:06

原文链接 返回主页