题解列表

筛选

二级C语言-进制转换(数组)

摘要:解题思路:不断%8将值放到数组中,最后逆序输出注意事项:if的取值范围,应该是小于8而不是小于等于8参考代码:#include<stdio.h>int main(){    int a[100],n,……

1098: 陶陶摘苹果

摘要:解题思路:估计原题是中等题,这个是阉割版,完全没有算法可言。注意事项:找找原题吧。参考代码:#include <iostream> using namespace std; const i……

输入输出--第二个数字

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[3]; for (int i = 0; i < 3; i+……

简单易懂--格式控制

摘要:解题思路:setiosflags 是包含在命名空间iomanip 中的C++ 操作符,该操作符的作用是执行由有参数指定区域内的动作;cout.setf跟setiosflags一样的,cout.prec……

输入输出--精度控制c++

摘要:解题思路:和上一篇差不多注意事项:数据类型不要搞错,空格,参考代码:#include<iostream>#include<iomanip>using namespace std;int main(){……

1017: [编程入门]完数的判断

摘要:解题思路:解题思维难度不大,关键在于提高效率。注意事项:参考代码:正确版本n = eval(input()) for i in range(2, n+1):     l = [1]     a ……

输入输出格式练习

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int i, n; while (cin >> n && n != 0……

输入输出--A+B

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

输入输出--A+B

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