c语言代码题解 摘要:```c #include int main() { int n; scanf("%d", &n); while (n != 1) {// 当n不等于1时,继续…… 题解列表 2024年08月21日 0 点赞 0 评论 668 浏览 评分:0.0
题解(C语言) 这道题注意一个点即可,就是就算1/i的时候,那个1要写成1.0,因为计算浮点数,如果写成1就是当成整数去计算了```c#includedoublefun(intn){doublesum=0;for(inti=1;i 题解列表 2024年08月21日 0 点赞 0 评论 582 浏览 评分:0.0
题解(C语言) 注意浮点数计算确保分母是浮点数不是整数```c#includedoublefun(intn){doublesum=1;for(inti=2;i 题解列表 2024年08月21日 0 点赞 0 评论 659 浏览 评分:0.0
易懂版(c语言代码) ```c#defineMAX101#includeintmain(){intnum[MAX][MAX];intn,sum1=0;scanf("%d",&n);for(inti=0;i 题解列表 2024年08月21日 0 点赞 0 评论 473 浏览 评分:0.0
2331: 信息学奥赛一本通T1180-分数线划定 摘要:解题思路:注意事项:参考代码:看到还是没有这道题的python代码讲解,就把很久之前写的一个代码放上来,希望可以帮到需要的人。import math a,b=map(int,input().spli…… 题解列表 2024年08月21日 0 点赞 0 评论 613 浏览 评分:0.0
明明的随机数 摘要:解题思路:注意事项:参考代码:int main(){ //输入 int n = 0; scanf("%d", &n); //将每一个数字作为下标,将其对应的数组空间内置成数字的值 int input …… 题解列表 2024年08月22日 1 点赞 0 评论 586 浏览 评分:0.0
使用qsort排序(c语言代码) ```c#include#includeintcmp(constvoid*a,constvoid*b){return*(int*)b-*(int*)a;}intmain(){intn,num[201];scanf("%d",&n);for(inti=0;i 题解列表 2024年08月22日 0 点赞 0 评论 518 浏览 评分:0.0
1282: 公交汽车(动态规划) 摘要:核心:动态规划,dp数组代码:cost = [int(x) for x in input().split()] n = int(input()) dp = [0] * n # dp[i]物品(站…… 题解列表 2024年08月22日 0 点赞 0 评论 549 浏览 评分:0.0
动态规划通用题解,学会了就都懂了 摘要:解题思路:二维数组填表来实现注意事项:vtype代表的是价值和体重的类型如果可以,自己实现一个函数不用max函数是最优解,即可达到动态规划公式参考代码:#include <iostream>using…… 题解列表 2024年08月22日 0 点赞 0 评论 581 浏览 评分:0.0
编写题解 2955: 判决素数个数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int c(int n){ if(n==1) return 0; for(int i…… 题解列表 2024年08月22日 0 点赞 0 评论 781 浏览 评分:0.0