题解列表

筛选

2664: 蓝桥杯2022年第十三届省赛真题-求和

#解题思路拿部分分思维:直接按照规矩,两两相乘再相加:````cpp#includeusingnamespacestd;constintmaxn=200005;intn;intarr[maxn];longlongresult=0;intmain(){//给数据io加速ios::sync_with_st

二级C语言-同因查找

摘要:解题思路:可以分别对2 3 7取余再想与,也可以直接对42取余注意事项:参考代码:#include<stdio.h>#include<stdlib.h>int main(){int i;for(i=1……

自定义函数之字符类型统计

摘要:解题思路:       原题:编写一函数,由实参传来一个字符串,统计此字符串中字母、数字、空格和其它字符的个数,在主函数中输入字符串以及输出上述结果。 只要结果,别输出什么提示信息。       思路……

编写题解 1229: 最小公倍数

摘要:解题思路:递归,求最大公约数(greatest common divisor,gcd),再求最小公倍数(least common multiple,lcm)。注意事项:参考代码:#include<io……

1015——————求和训练

a,b,c=map(int,input().split())s=0foriinrange(1,a+1):s=s+i#s+=iforiinrange(1,b+1):s=s+pow(i,2)#s+=i**2foriinrange(1,c+1):s=s+1/i#s+=1/iprint('%.2f'%s)#p

Java 统计字符

摘要:解题思路:注意事项:参考代码:public static void main(String[] args) {    Scanner sc = new Scanner(System.in);    S……

1016——————水仙花数判断

摘要:充分理解概念:**水仙花数"是指一个三位数 其各位数字立方和等于该本身** for i in range(100,1000): #三位数 if (int(str(i……