题解列表
[竞赛入门]简单的a+b(C++)
摘要:解题思路:定义a,b,输入各值,输出a+b就可以了注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a,b; ……
[编程入门]第一个HelloWorld程序(c++)
摘要:解题思路:直接输出"**************************\nHello World!\n**************************"就好了注意事项:"\n"是换行符号参考代码……
不使用数组,只用循环
**解题思路**不使用数组,首先使用一个循环遍历1到n的数。然后自定义一个函数来判断每一个数是不是完数,假如是,就返回1.假如不是,就返回0。在主函数的循环里,对函数的返回值进行判定,判定是完数,就再使用一个循环,将其因子输出。具体看代码注释```c#includeintfun(intn){intsu
第一次用pair数对
摘要:#include<bits/stdc++.h>
using namespace std;
pair<int,int>a[10];
int main()
{
int sum1=0,sum2=……
整数序列的元素最大跨度值(max,min)
解题思路:注意事项:参考代码:n=int(input())l=list(input().split())t=[int(i)foriinl]print(max(t)-min(t))