上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 56 下一页
摘要: 主要还是等差公式: 等差数列前n项和: (1) Sn = n*(a1 + an) / 2 (2) 最开始尝试用递归求解, 但是递归爆栈了, 又改用循环. 阅读全文
posted @ 2019-07-31 18:21 青衫客36 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 注意: 每次都要清空集合!!! 阅读全文
posted @ 2019-07-31 12:25 青衫客36 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { int n, ah, am, as, bh, bm, bs; int result_s, result_m, result_h; while(cin >> n) { while(n --) { cin >> ah >> am >> as >> bh >> bm >... 阅读全文
posted @ 2019-07-31 12:01 青衫客36 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main() { int n; int a[33][33]; while(scanf("%d", &n) != EOF) { for(int i = 1; i <= n; ++ i) { a[i][1] = 1; } for(int i = 1; i... 阅读全文
posted @ 2019-07-31 11:49 青衫客36 阅读(68) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main() { stack s; int n, m, r; while(cin >> n >> r) { if(n 10) { if(s.top() == 10) cout << 'A'; else if(s.top() == 11) cout ... 阅读全文
posted @ 2019-07-31 11:24 青衫客36 阅读(67) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { int n, len; char s[1010]; cin >> n; getchar(); while(n --) { gets(s); len = strlen(s); ... 阅读全文
posted @ 2019-07-31 11:03 青衫客36 阅读(101) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main() { string s; int n, i, j, len; cin >> n; while(n --) { cin >> s; len = s.length(); bool flag = true; for(i = 0, j = le... 阅读全文
posted @ 2019-07-31 10:46 青衫客36 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 最小公倍数的求解在最大公约数的基础上运行. 当得到a和b的最大公约数d之后, 可以马上得到a和b最小公倍数是ab / d. 由于ab在实际运算中可能会溢出,因此更恰当的写法是a / d * b.由于d是a的约数,所以a/d一定可以整除.(d是最大公因数) 阅读全文
posted @ 2019-07-30 17:31 青衫客36 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include #include int main() { int n, len; char s[110]; scanf("%d", &n); getchar(); while(n --) { gets(s); len = strlen(s); int a = 0, e = 0, i_ = 0, o = 0, u = 0; for(int i = 0; i ... 阅读全文
posted @ 2019-07-30 17:05 青衫客36 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include #include int main() { char a[110]; int len; while(gets(a)) { len = strlen(a); for(int i = 0; i < len-1; ++ i) { if(i == 0) /... 阅读全文
posted @ 2019-07-30 16:45 青衫客36 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 56 下一页