题解列表
优质题解
[编程入门]报数问题
摘要:解题思路:首先定义一个数组arr用来保存每个人的编号,然后再定义指针p指向数组arr,变量n保存的是人的个数,将n的值赋值给m。所有变量定义好之后使用for循环给每个人编号,代码如下:for(i=0;……
优质题解
1033: [编程入门]自定义函数之字符提取(string)
摘要:解题思路:stl里面的string类提供了查找函数find 我们只需要建立一个元音字母表,然后在表内查询就可以了。参考代码:#include <bits/stdc++.h>
#define ll……
1859——————与2无关的数
摘要: n = int(input())
sum = 0
for i in range(n+1): #迭代遍历n
if i % 2 != 0 and '2' n……
1864——————数日子
摘要: n = [31,28,31,30,31,30,19] #已知2018年1月至7月每月的天数
sum = 0 #初始化为0
for i in n:
su……
1001: [编程入门]第一个HelloWorld程序
摘要: #include
int main()
{
printf("**************************\n");
printf("Hello World!\n");
……
1000: [竞赛入门]简单的a+b
摘要: #include
int main()
{
int a,b;
//定义两个变量a,b
while(~scanf("%d%d",&a,&b))
//非零则继续循环~……
1915——————三个整数的排序
摘要:两行代码
n = list(map(int,input().split()))
for i in sorted(n)[::-1]:print(i,end=' ')
三行代码
……
公约公倍题解——C++, 函数
摘要:参考代码:#include <iostream>using namespace std;// 定义函数int gcf(int a, int b);int lcm(int a, int b);int m……