摘要:
模拟题,题目不难,但是在字符串处理上比较麻烦View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxn 101struct Term{ int s[maxn]; char ch[maxn];}term[maxn];string word[maxn];string st;int n, m, termnum[maxn];bool i 阅读全文
摘要:
简单的模拟View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;#define maxn 100string st;int n;bool left(int a){ for (int i = a - 1; i >= 0; i--) { if (st[i] == '|' || st[i] == '\\' || st[i] 阅读全文
摘要:
简单的模拟,字符串题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;#define maxn 100string st;char pairs[maxn][2];bool ok(char a, char b, int x){ for (int i = 0; i < x; i++) if (pairs[i][0] == a && p 阅读全文
摘要:
简单题,View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int main(){ //freopen("D:\\t.txt", "r", stdin); int t, n; scanf("%d", &t); for (int i = 0; i < t; i++) { scanf("%d", &n 阅读全文
摘要:
简单的字符串题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int main(){ //freopen("D:\\t.txt", "r", stdin); string st; while (getline(cin, st) && st != "#") { int sum = 0; for (int i = 0; i 阅读全文