题解列表

筛选

简洁版代码

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; string s; struct BiTreeNode{ char val; ……

The 3n + 1 problem

摘要:解题思路:利用for循环逐个遍历输入数之间的数,计算每一个数的周期,找到最大周期即可注意事项:本题有一个坑,输入的第一个数不一定是大于第二个数的,所以需要找到输入两数中的较大值与较小值参考代码:#in……

字符串的输入输出处理

摘要:解题思路:前面需要整体输出,则用for循环和string逐次输出,后面需要换行输出则用cin即可注意事项:使用getline时需要调用头文件string参考代码:#include<iostream>u……

A+B for Input-Output Practice (VI)

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a, b,c,sum=0; while (cin >> a) ……

A+B for Input-Output Practice

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a, b,c,sum=0; cin >> c; while (……

A+B for Input-Output Practice (V)

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a, b,c,sum=0; cin >> c; while (……