03 2021 档案

摘要:解析 字符串操作,本题解采取了多关键词排序 Code #include <bits/stdc++.h> using namespace std; int f, n; struct node { int y, r; string s; }a[100005]; int cmp (node x, node 阅读全文
posted @ 2021-03-26 20:25 unknown_future 阅读(138) 评论(0) 推荐(0)
摘要:解析 字符串的操作,可以用函数解决这个问题 s 2. f i n d ( s 1. s u b s t r ( i , j ) ) s2.find~(s1.substr~(i,~j)) s2.find (s1.substr (i, j)) 在s2中查找s1中 i i i到 j j j第一次出现的位置 阅读全文
posted @ 2021-03-26 18:19 unknown_future 阅读(116) 评论(0) 推荐(0)
摘要:C . 【 例 题 3 】 单 词 替 换 解析 可以一个个单词读取,输入完之后, 讲整个句子的每个单词遍历一次, 如果这个单词是与单词 a a a相同的话, 就输出 b b b, 否则输出这个单词 Code #include <bits/stdc++.h> using namespace std; 阅读全文
posted @ 2021-03-24 17:12 unknown_future 阅读(124) 评论(0) 推荐(0)
摘要:解析 判断是否是子串,可以将这个一个环 #include <bits/stdc++.h> using namespace std; int f = 0; string a, b; int main() { cin >> a >> b; for (int i = 0; i < a.size (); + 阅读全文
posted @ 2021-03-20 16:36 unknown_future 阅读(58) 评论(0) 推荐(0)
摘要:题目解析 字符串的基础操作,注意判断零即可 #include <bits/stdc++.h> using namespace std; int i; char c[15]; int main () { scanf ("%s", &c); if (c[0] == '-') { i = 1; print 阅读全文
posted @ 2021-03-19 20:31 unknown_future 阅读(63) 评论(3) 推荐(0)
摘要:A . 【 例 题 1 】 走 迷 宫 解析 简单的BFS模板题 Code #include <bits/stdc++.h> #define N 1005 using namespace std; const int dx[5] = {0, 1, -1, 0, 0}; const int dy[5] 阅读全文
posted @ 2021-03-05 18:43 unknown_future 阅读(100) 评论(0) 推荐(0)