- 分享
C++1班聊天室
- @ 2023-8-18 17:01:15
82 条评论
-
UID 6 @ 2023-9-11 16:52:37已修改
-
@ 2023-9-10 19:07:10
美好的一天卷完咯

-
@ 2023-9-9 21:23:47
-
@ 2023-9-9 20:13:40

-
@ 2023-9-9 14:10:56
-
@ 2023-9-8 8:51:20
建议完成此题

-
@ 2023-9-8 8:36:45
-
@ 2023-9-8 8:31:35
今天要上课了,同学们你们作业做完了吗
-
@ 2023-9-7 22:00:12有问题优先用站内消息提问,如果长时间没回复,去微信群提问。
🤔 1👍 1 -
@ 2023-9-1 21:18:16铺地毯
#include <iostream> using namespace std; const int maxn = 10000000; int n, a[maxn], b[maxn], g[maxn], k[maxn], x, y; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i] >> b[i] >> g[i] >> k[i]; cin >> x >> y; for (int i = n; i >= 1; i--) if (x >= a[i] && x <= a[i] + g[i] && y >= b[i] && y <= b[i] + k[i]) { cout << i << endl; return 0; } cout << -1 << endl; return 0; }👍 1 -
@ 2023-9-1 20:53:21基因相关性
#include <iostream> #include <string> using namespace std; int main() { double yz, p; int cnt = 0; cin >> yz; cin.ignore(); string dna1, dna2; getline(cin, dna1); getline(cin, dna2); for (int i = 0; i < dna1.length(); i++) if (dna1[i] == dna2[i]) cnt++; p = 1.0 * cnt / dna1.length(); if (p >= yz) cout << "yes" << endl; else cout << "no" << endl; return 0; } -
@ 2023-9-1 20:22:14奇偶ASCII判断
#include <iostream> using namespace std; int main() { char c; cin >> c; int a = (int) c; if (a % 2 == 0) cout << "NO" << endl; else cout << "YES" << endl; return 0; } -
@ 2023-8-23 19:22:37
你们这几天是不是都没上硬壳OJ
🤔 1 -
@ 2023-8-22 16:03:11
你干嘛哎咳哟
-
@ 2023-8-22 11:27:49
1+1=?
-
@ 2023-8-21 9:40:02
今天没有课。
-
@ 2023-8-20 15:34:402023.08.20 结课测试 参考答案
一、单选
- D 文件型病毒主要攻击
.exe.com文件 - A
- D
(1111)10 ^ (1010)10 = (1957)10 - B 25是哨兵
- B CCF组织
- C
n0 = n2 + 1, n = n0 + n1 + n2 = 2 * n2 + n1 - 1, n = 1234, n0 = ... - D linux可执行文件无扩展名
- C 先序+中序还原二叉树,然后后序遍历即可
- B 对于平年
365%7=1,闰年366%7=2,推出2049有多少平年闰年即可 - A 先十进制再二进制
- A 代入计算
- C 一定是2倍
- B 代入计算
- A
(12 + 5) * 2 + 3 = 37 - C 看阅读材料
二、阅读程序
第一题
- B 错误 数组大小是
13,所以输入12也不会越界 - A 正确 2000年2月有29天
- B 错误 此行为判断闰年,影响结果
- A 正确 同上
- B 1990年是平年,2月有28天
- A 2000年是闰年,2月有29天
第二题
- B 错误
- A 正确
- A 正确
- B 错误,应为
3 4 5 7 8 9 \n - D 堆排序
- B 三目(?)运算符
第三题
- B 错误
- B 错误,只是因数分解
- B 错误
- A 正确
- A 从1开始找,跳过1
- C 2/3/4/6/8/9/12/18
三、完善程序
第一题
- A
- C
- A
- A
- B
第二题
- D
- B
- B
- C
- C
- D 文件型病毒主要攻击
-
@ 2023-8-19 16:03:19角谷猜想
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { int n, ans = 0; cin >> n; while (n != 1) { if (n % 2 == 0) { n /= 2; ans++; } else { n = n * 3 + 1; ans++; } } cout << ans << endl; return 0; } -
@ 2023-8-19 15:51:49518 画矩形
#include <iostream> using namespace std; int main() { int n, m, k; char ch; cin >> n >> m >> ch >> k; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (k == 1 || j == 1 || j == m || i == 1 || i == n) cout << ch; else cout << " "; } cout << endl; } return 0; } -
@ 2023-8-19 15:31:11
敌我
-
@ 2023-8-19 15:30:17
有人
-
@ 2023-8-19 15:27:58537 求一元二次方程
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { double a, b, c; scanf("%lf %lf %lf", &a, &b, &c); double d = b * b - 4 * a * c; if (d > 0) printf("x1=%.5lf;x2=%.5lf\n", (-b - sqrt(d)) / (2 * a), (-b + sqrt(d)) / (2 * a)); if (d == 0) printf("x1=x2=%.5lf\n", (-b / (2 * a))); if (d < 0) printf("No answer!"); return 0; } -
@ 2023-8-19 15:27:12
-
@ 2023-8-19 10:21:09
有人马
-
@ 2023-8-19 10:09:57
👍
-
@ 2023-8-18 17:08:35
今天就玩到这
👀 4 -
@ 2023-8-18 17:06:50
😕
👀 3 -
@ 2023-8-18 17:06:30👀️
👀️

😄😄😄
快去看看吧☺
🤣🤣🤣