1150: C语言训练-计算t=1+1/2+1/3+...+1/n 摘要:解题思路:注意事项:注意输出数的格式,以及变量的定义,变量的类型;参考代码:#include<stdio.h>int n;double t=0,i;void fun1(){ scanf("%d"…… 题解列表 2022年01月27日 0 点赞 0 评论 339 浏览 评分:0.0
1151: C语言训练-计算一个整数N的阶乘 摘要:解题思路:注意事项:0!=1 ;0的阶乘不等于0;切记!参考代码:#include<stdio.h>int N,i,a=1;void fun1(){ scanf("%d",&N); if(…… 题解列表 2022年01月27日 0 点赞 0 评论 477 浏览 评分:0.0
1152: C语言训练-计算:t=1-1/(2*2)-1/(3*3)-...-1/(m*m) 摘要:解题思路:m是大于0的;当m=1时;t=1;当m>1时;t=1-1/(2*2)-1/(3*3)-...-1/(m*m);t赋初值1;定义t和i为double类型,输出结果需要带6位小数;注意事项:定义…… 题解列表 2022年01月27日 0 点赞 0 评论 382 浏览 评分:0.0
1156: C语言训练-阿姆斯特朗数 摘要:解题思路:注意事项:提交答案,显示基本正确,格式错误,没看出格式有什么问题。参考代码:#include<stdio.h>int n,m,a,b,c;void fun1(){ for(n=999;…… 题解列表 2022年01月27日 0 点赞 0 评论 536 浏览 评分:0.0
母牛的故事 (结构体解决) 摘要:解题思路:注意事项:参考代码:#include "stdio.h"typedef struct shape { int sum; int age;} shape;int main() { int i=…… 题解列表 2022年01月27日 0 点赞 0 评论 275 浏览 评分:0.0
python-概率计算 摘要:解题思路:动态规划建立数组dp = [max(n,a,b,x)+1][(n+1)] 注意这里不要直接写成dp = [x+1][n+1],因为在后面的计算中数组可能会越界,没修改前题测为91分其…… 题解列表 2022年01月27日 0 点赞 0 评论 669 浏览 评分:0.0
python 容易理解 摘要:解题思路:注意事项:参考代码:ls =list(map(int,input().split()))while ls[0] != 0: lt = ls[1:] b=[] for i i…… 题解列表 2022年01月27日 0 点赞 0 评论 332 浏览 评分:0.0
reverse()函数逆序 摘要:解题思路:运用<algorithm>里面的头文件reverse来逆序注意:reverse( 首地址,尾地址 + 1 )先举个小例子吧!下面是本题代码!!给个评论吧!…… 题解列表 2022年01月27日 0 点赞 0 评论 593 浏览 评分:0.0
水仙花数判断(c++易懂) 摘要:解题思路:使用for循环遍历所有三位数,再使用if语句找出各位数字立方和等于自己本身的数。注意事项:看注释参考代码:#include <iostream> using namespace std;…… 题解列表 2022年01月28日 0 点赞 0 评论 426 浏览 评分:0.0
1624: 蓝桥杯算法训练VIP-完数 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<math.h> using namespace std; int main() { float n,f…… 题解列表 2022年01月28日 0 点赞 0 评论 332 浏览 评分:0.0