题解列表

筛选

C语言填鸭型

摘要:解题思路:检查左括号右括号是否配对注意事项:参考代码:#include"stdio.h"int main(){ char p[500]; memset(p,0,500); int i,j = 0; i……

题解 2544: N以内累加求和

摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){    int a;    cin>>a;    cout<<(a-1……

题解 3008: 买笔

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

自定义函数处理素数

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; main() { void f(int n); int n; cin>>……

编写题解 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是一个递减的过程,……