有规律的数列求和(C语言代码) 摘要:####解题思路: ``` 2/1 + 2/3 + 5/3 + 5/8 + 13/8 + 21/13 + …… Sn = Y1/X1 + Y2/X2 + Y3/X3 + Y4/X4 + …… +…… 题解列表 2022年01月27日 0 点赞 0 评论 538 浏览 评分:9.9
划划水啦~~~ 摘要:解题思路:循环嵌套,规定步长注意事项:sum的归零参考代码:#include<stdio.h> int main() { int n; scanf("%d",&n); …… 题解列表 2022年01月27日 0 点赞 0 评论 1042 浏览 评分:9.9
短小精悍 T^T 摘要:#include<stdio.h> int main() { int n; while (scanf("%d",&n)&&n) { int sum=…… 题解列表 2022年01月27日 0 点赞 0 评论 1592 浏览 评分:9.5
1085: A+B for Input-Output Practice (I) 摘要:解题思路:这题其实谁都会做,主要是要看出题目里的要求:“with one line of output for each line in input”,也就是要用EOF来结束注意事项:输出时别忘记换行…… 题解列表 2022年01月27日 0 点赞 4 评论 1422 浏览 评分:9.9
优质题解 python-01背包 解题思路:①建立一个存放物品的n*2大小的数组commodities[n+1][2],commodities[i][0]表示第i个物品的重量,commodities[i][1]表示第i个物品的价值。②建立一个大小为m+1的数组dp[m+1],dp[i]表示背包剩余容量为m时,所能装载的最大价值。 题解列表 2022年01月27日 0 点赞 0 评论 1148 浏览 评分:9.9
[STL训练]Let the Balloon Rise java语言 解题思路:我的解题思路是:先创建两个数组,一个为字符串型数组,另一个为整型数组。然后进行双重for循环,设置i和j变量(你也可以理解为C语言中的指针),后面的我就用指针来解释啦~(即使java中没有指针),i(指针)先指至字符串首位置,让j(指针)去一个一个的判断是否与i(指针)指向的元素是否相等, 题解列表 2022年01月27日 0 点赞 0 评论 769 浏览 评分:9.9
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 评论 560 浏览 评分:0.0
这题有个小细节--(两种写法) ```cpp//第一种写法,可运行#include#include#include#include#includeusingnamespacestd;intmain(void){stringstr1,str2;getline(cin,str1);getline(cin, 题解列表 2022年01月27日 0 点赞 0 评论 636 浏览 评分:8.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 评论 692 浏览 评分:0.0
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 评论 522 浏览 评分:0.0