酷代码 AI
菜单
服务商

攻击字符串检测与字符提取C++实现

```cpp #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; string s; for (int i = 0; i < n; i++) { cin >> s; if (s == "ATTACK") { cout << "出现攻击" << endl; } else { cout << "不是攻击" << endl; } } return 0; } ``` ```cpp #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; string s; for (int i = 0; i < n; i++) { cin >> s; cout << s[1] << endl; } return 0; } ``` ######[AI问答 | 185点数解答 | 2026-04-10 22:20:39]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]