利 润 计 算 摘要: #include using namespace std; int main() { int x, sum; cin >> x; …… 题解列表 2022年10月10日 0 点赞 0 评论 605 浏览 评分:0.0
数字的处理与判断 #includeusingnamespacestd;intmain(){intn,count=0,i;inta[5];cin>>n;for(i=0;i<5;i++){if(n==0)break;else{a[i]=n%10;n=n/10;count++;}}cout 题解列表 2022年10月10日 0 点赞 0 评论 541 浏览 评分:8.0
1150-计算t=1+1/2+1/3+...+1/n(代码简洁,思路清晰) 摘要:解题思路:注意事项:除法运算结果要是浮点数,那么被除数和除数至少有一个是浮点数 参考代码:#include<iostream>using namespace std;int main(){ …… 题解列表 2022年10月10日 0 点赞 0 评论 585 浏览 评分:0.0
成 绩 评 定 摘要: #include using namespace std; int main() { int n; cin >> n; if …… 题解列表 2022年10月10日 0 点赞 0 评论 521 浏览 评分:0.0
1149-计算1~N之间所有奇数之和(代码简洁,思路清晰) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n,res=0; cin >>n; f…… 题解列表 2022年10月10日 0 点赞 0 评论 584 浏览 评分:0.0
分段函数求值 摘要: #include using namespace std; int main() { int x, y; cin >> x; …… 题解列表 2022年10月10日 0 点赞 0 评论 535 浏览 评分:0.0
温 度 转 换 #include#includeusingnamespacestd;intmain(){floatf,c;cin>>f;c=5*(f-32)/9;cout 题解列表 2022年10月10日 0 点赞 0 评论 708 浏览 评分:0.0
1147-角谷猜想(代码简洁,思路清晰) 摘要:解题思路:注意事项:0是自然数、偶数、整数,不是正整数,所以不考虑0 参考代码:#include<iostream>using namespace std;int main(){ int n,…… 题解列表 2022年10月10日 0 点赞 0 评论 637 浏览 评分:0.0
1146-舍罕王的失算(等比数列的应用) 摘要:解题思路:1,2,4,8...2^63-1为一等比数列等比数列的前n项和公式:Sn=a1(1-q^n)/(1-q),q!=11)q=2,a1=1,n=64=>S=1*(1-2^64)/(1-2)=2^…… 题解列表 2022年10月10日 0 点赞 0 评论 492 浏览 评分:0.0
1146-舍罕王的失算(代码短,思路容易理解) 摘要:解题思路:/*1,2,4,8...2^63-1为一等比数列等比数列的前n项和公式:Sn=a1(1-q^n)/(1-q),q!=11)q=2,a1=1,n=64=>S=1*(1-2^64)/(1-2)=…… 题解列表 2022年10月10日 0 点赞 0 评论 530 浏览 评分:0.0