LeeJQ
LeeJQ
全部文章
分类
题解(6)
归档
标签
去牛客网
登录
/
注册
LeeJQ的博客
全部文章
(共6篇)
题解 | #完全数计算#
C++,可读性较高的思路。 #include <bits/stdc++.h> using namespace std; int main() { int n; //待输入的数 while(cin>>n){ int count=0; //...
C++
2021-07-06
17
1624
题解 | #统计每个月兔子的总数#
C++代码,递归方式。 #include <bits/stdc++.h> using namespace std; int get_total_count(int month) //返回值类型整形 { if (month == 1 || month == 2)//边界条件,及其...
C++
2021-07-06
0
455
题解 | #汽水瓶#
C++简洁代码,真! #include<bits/stdc++.h> using namespace std; int main() { int num; while(cin>>num) { if(num==0)break; ...
C++
2021-07-06
4
542
题解 | #最小公倍数#
直接看C++代码吧,有注释。 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(fa...
C++
2021-07-06
1
562
题解 | #句子逆序#
C++,用字符串做容器的解题思路。 #include<bits/stdc++.h> using namespace std; int main() { string str, temp, dst; getline(c...
C++
句子逆序
2021-07-01
0
588
题解 | #质数因子#
C++求质数因子,总算不超时了! 不知道各位的情况如何,我在题解区看到的答案都遭遇了超时的问题。因此本题解采用了引入“根号”来判断质数。代码如下: #include using namespace std; int main() { long n, old_n=0; cin &...
C++
质数因子
质数因子
2021-06-29
41
4742