阶乘求和的“骗术” 注意事项:当int使用之后,根据测试用例,算出结果正确时,而提交未通过时,要多看看题目对于数的限制,n不超过20,而20的阶乘是一个很大的数,可能已经超过int的范围,这个时候我们考虑用longlong定义变量,同时输出格式改为%lld即可参考代码:#define_CRT_SECURE_NO_WARN 题解列表 2024年03月03日 0 点赞 0 评论 493 浏览 评分:0.0
绝对值排序 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool cmp(int a,int b){ return abs(a)>ab…… 题解列表 2024年03月03日 0 点赞 0 评论 479 浏览 评分:0.0
1036: [编程入门]带参数宏定义练习 摘要:解题思路:定义一个带参的宏,使两个参数的值互换,并写出程序,输入两个数作为使用宏时的实参。参考代码:#include <stdlib.h> #include <stdio.h> #define…… 题解列表 2024年03月03日 0 点赞 0 评论 558 浏览 评分:0.0
链表之报数问题(C语言代码) 摘要:#include<stdio.h>#include<malloc.h>typedef struct people{ int number; struct people *next;}ST;…… 题解列表 2024年03月03日 1 点赞 0 评论 537 浏览 评分:0.0
1068: 二级C语言-温度转换 摘要:解题思路:注意事项:参考代码:def ctof(i): print('c=%d->f=%d'%(i,32 + i* 9/5))for i in range(-100,151,5)…… 题解列表 2024年03月03日 0 点赞 0 评论 1007 浏览 评分:0.0
【C语言题解】蓝桥杯2023年第十四届省赛真题-更小的数 ```#include//定义数组来存放数的每一位intnumber[50050]={0};intcompare(int*a,int*b);intmain(){inta,i=0,j,k,cnt=0;//将数存放进数组while(scanf("%1d", 题解列表 2024年03月03日 0 点赞 0 评论 641 浏览 评分:0.0
编写题解 1861: 程序员爬楼梯 解题思路:类似于斐波那契数列不过递推公式为:F(n)=F(n-1)+F(n-3)注意事项:参考代码:n=int(input())dp=[1,1,2,3]#dp[i]中i阶i中方法ifn<5:print(dp[n-1])else:whileTrue:num=dp[-1]+dp[-3]dp.append( 题解列表 2024年03月03日 0 点赞 0 评论 569 浏览 评分:0.0
信息学奥赛一本通T1260-拦截导弹-动态规划 ```cpp#include#includeusingnamespacestd;inta[1005],b[1005],dp1[1005],dp2[1005],n;voidLIS(){intans1=0,ans2=0;for(inti=0;i 题解列表 2024年03月03日 0 点赞 0 评论 465 浏览 评分:0.0
编写题解 1141: C语言训练-百钱百鸡问题 摘要:解题思路:注意事项:参考代码:for i in range(20): for j in range (33): for k in range (100): i…… 题解列表 2024年03月03日 0 点赞 0 评论 606 浏览 评分:0.0
注意有个空格 摘要:注意事项:注意有个空格!!!!!!!!!!!!!最后一个数字后边有个空格!!!!!!!printf("%d ",stu[i].score[2]);参考代码:#include<stdio.h>#defi…… 题解列表 2024年03月03日 0 点赞 0 评论 453 浏览 评分:0.0