[Luogu] P9686 题解

P9686 题解

2023.10.04 update:

很遗憾,您上传的题解 P9686 题解 未能通过审核。原因是 拒绝: 重复的解法 。

好好好这么玩是吧 这题除了判断是不是AC还有啥解法 我难道还要把一堆算法和数据结构搬出来?

打回来的时候题解数量还不到十篇,这会看都二十几篇了,怎么不把他们的打回去就打我的?


字符串判断。
题意:有 \(n\) 个字符串 \(S_1,S_2,...,S_n\),如果字符串 \(S_i\) 的内容不是 AC,则输出它的序号 \(i\),否则略过。

#include <bits/stdc++.h>

using namespace std;

int n;

string a;

int main() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a;
		if (a != "AC") cout << i << ' ';
	} 
    return 0;
}
posted @ 2023-11-17 20:46  FurippuWRY  阅读(20)  评论(0)    收藏  举报