摘要:
include using namespace std; int main() { char s1[100]; // 目标数组,要足够大才能装得下 char s2[100]; // 源数组,存放我们要复制的内容 int i = 0; // 用来当计数器 cout << "请输入要复制的字符串 (s2 阅读全文
posted @ 2026-06-21 12:36
iougl
阅读(3)
评论(0)
推荐(0)
摘要:
include include using namespace std; int main() { int temp; char type; double result; cout << "请输入温度值和单位:"; cin >> temp >> type; if (type == 'C' || ty 阅读全文
posted @ 2026-06-21 12:35
iougl
阅读(2)
评论(0)
推荐(0)
摘要:
include using namespace std; int main() { char str[100]; // 定义一个能装100个字符的数组 int j = 0; // j 用来记录“留下来”的字符应该放的位置 cout << "请输入字符串: "; cin >> str; // 输入字符 阅读全文
posted @ 2026-06-20 23:43
iougl
阅读(2)
评论(0)
推荐(0)
摘要:
百钱百鸡问题: include using namespace std; int main() { // 鸡翁最多14只(100÷7),鸡婆最多11只(100÷9) const int MAX_COCK = 14; const int MAX_HEN = 11; cout << "百钱百鸡问题的解: 阅读全文
posted @ 2026-06-19 16:18
iougl
阅读(2)
评论(0)
推荐(0)
摘要:
生成杨辉三角的代码: include include using namespace std; int main() { int n = 6; // 定义要输出的行数 int a[10][10]; // 1. 计算杨辉三角的值 for (int i = 0; i < n; i++) { // 遍历每 阅读全文
posted @ 2026-06-18 21:38
iougl
阅读(2)
评论(0)
推荐(0)
浙公网安备 33010602011771号