题解列表

筛选

编写题解 3008: 买笔(if语句解法)

摘要:解题思路:若想让笔的数量最大,应优先购买4元的。以4为基准求余:剩1元,则4元钱的笔少买1支,换成1支5元笔;剩2元,则4元钱的笔少买1支,换成1支6元笔;剩3元,则4元钱的笔少买2支,换成1支5元笔……

3008: 买笔 买个鸡脖

摘要:解题思路:注意事项:需要想到多种可能参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int x;    cin>>x; ……

单词统计(小心些数组的空间)

摘要:解题思路:注意题目说单词可重叠,那就以卷子每个元素都为开头一次,往后遍历比较一次注意事项:参考代码:#include<stdio.h> int main() { int n; scanf(……

[C语言]c语言考试练习题_排序

摘要:解题思路:规律:每一行的开头数字 ,相邻相同数为一组,下一次重复为间隔得到规律1 2 3\ 1 2 4\ 1 3 4\ 2 3 4统计每一次不出现的数的下标,得到3 ,2 ,1 ,0是一个递减的过程,……

题解 2777: 计算2的幂

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int n;    cin>>n;    int m……

2544: N以内累加求和(超简单)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){    int n,sum=0;    cin>>n;    ……