摘要: 点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla 阅读全文
posted @ 2022-04-21 22:38 wKingYu 阅读(35) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; int n, m, ans = 0; void dfs(int x, int y) { if (x == n && y == m) ans ++; else { if (y < m) dfs(x, y + 阅读全文
posted @ 2022-04-15 23:07 wKingYu 阅读(37) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; int n, ans = 0; void f(int k) { if (k == n) ans ++; else if (k < n) { f(k + 1); f(k + 2); } } int main( 阅读全文
posted @ 2022-04-15 13:08 wKingYu 阅读(65) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 200; string str[N]; int n ; int main() { while (cin >> n, n) { int len = 1000; for (int i 阅读全文
posted @ 2022-04-15 10:57 wKingYu 阅读(130) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; string s, s1, s2; int main() { char c; while (cin >> c, c != ',') s += c; while (cin >> c, c != ',') s1 阅读全文
posted @ 2022-04-14 17:49 wKingYu 阅读(87) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> using namespace std; string str; int main() { while (cin >> str, str != ".") { int len = str.size(); for (int n = len; n; n- 阅读全文
posted @ 2022-04-14 16:59 wKingYu 阅读(193) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> #include<algorithm> using namespace std; string a, b; int main() { cin >> a >> b; if (a.size() < b.size()) swap(a, b); for ( 阅读全文
posted @ 2022-04-14 12:47 wKingYu 阅读(58) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> using namespace std; string str, res; int main() { while (cin >> str) { if (str.back() == '.') str.pop_back(); if (str.size( 阅读全文
posted @ 2022-04-14 12:09 wKingYu 阅读(32) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> using namespace std; string str; int n; int main() { cin >> n; while (n --) { cin >> str; int cnt = 0; char c; for (int i = 阅读全文
posted @ 2022-04-14 11:23 wKingYu 阅读(56) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> #include<sstream> using namespace std; string s, a ,b; int main() { getline(cin ,s); cin >> a >> b; stringstream ssin(s); st 阅读全文
posted @ 2022-04-14 10:41 wKingYu 阅读(47) 评论(0) 推荐(1)