c++买笔c++买笔c++买笔c++买笔c++买笔 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){ int x; cin>>x; if(x%4==0)…… 题解列表 2024年01月07日 0 点赞 1 评论 523 浏览 评分:6.0
2790: 分段函数 摘要:解题思路:注意事项:要使用浮点数定义参考代码:#include <bits/stdc++.h>using namespace std;int main(){ double x; cin >…… 题解列表 2024年01月07日 0 点赞 0 评论 412 浏览 评分:9.9
编写题解 3008: 买笔(if语句解法) 解题思路:若想让笔的数量最大,应优先购买4元的。以4为基准求余:剩1元,则4元钱的笔少买1支,换成1支5元笔;剩2元,则4元钱的笔少买1支,换成1支6元笔;剩3元,则4元钱的笔少买2支,换成1支5元笔和1支6元笔;注意事项:参考代码:#includeusingnamespacest 题解列表 2024年01月07日 0 点赞 0 评论 410 浏览 评分:0.0
1764: 循环入门练习1 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int a; for(int i=1;i<=10…… 题解列表 2024年01月07日 0 点赞 0 评论 410 浏览 评分:9.9
自定义函数处理素数 摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; main() { void f(int n); int n; cin>>…… 题解列表 2024年01月07日 0 点赞 0 评论 404 浏览 评分:0.0
3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008: 买笔3008 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(int argc, char** argv){int x,y,a,b,c;…… 题解列表 2024年01月07日 0 点赞 1 评论 711 浏览 评分:9.9
1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1480: 模拟计算器1 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a,b; char c; c …… 题解列表 2024年01月07日 0 点赞 0 评论 582 浏览 评分:6.0
题解 3008: 买笔 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int x; cin>>x; if(x%…… 题解列表 2024年01月07日 0 点赞 0 评论 405 浏览 评分:0.0
题解 3008: 买笔 解题思路:注意事项:若想让笔的数量最大,应优先购买4元的。以4为基准求余:剩1元,则4元钱的笔少买1支,换成1支5元笔;剩2元,则4元钱的笔少买1支,换成1支6元笔;剩3元,则4元钱的笔少买2支,换成1支5元笔和1支6元笔;本题的主要思想是贪心算法(循环中的三块代码操作类似, 题解列表 2024年01月07日 0 点赞 0 评论 492 浏览 评分:9.9
题解 1764: 循环入门练习1(c++) 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a,sum=0; for(a=1;a<…… 题解列表 2024年01月07日 0 点赞 0 评论 459 浏览 评分:9.9