求Sn=1!+2!+3!+4!+5!+…+n!之值,其中n是一个数字(n不超过20)。 摘要:#include<stdio.h> int main() { int n, i; long int fact = 1, Sn = 0;//此处用long int或者long l…… 文章列表 2018年03月17日 4 点赞 0 评论 3289 浏览 评分:10.0
精品文章 在VS2019使用scanf()函数报错的解决方法 摘要:在VS2019使用scanf()函数报错的解决方法首先来看一段很简单的C语言代码#include<stdio.h> int main(void) { char s[10]; s…… 文章列表 2021年11月06日 1 点赞 0 评论 796 浏览 评分:10.0
C语言基础语法知识点 摘要:1. scanf()函数在输入变量的时候后面不要带有空格,否则控制台会出现卡住的现象,会影响格式化的输出。例如:scanf("%d ",&a); 不要这样写。2. scanf()函数和gets()函…… 文章列表 2022年04月29日 1 点赞 0 评论 360 浏览 评分:10.0
精品文章 最长不下降子序列 O(nlogn) 摘要:## 最长不下降子序列 NlogN && 输出序列 用n^2来实现很简单 #include using namespace std; int a[1000…… 文章列表 2022年07月22日 1 点赞 0 评论 531 浏览 评分:10.0
给大家上个贪吃蛇游戏1 摘要:#include<iostream>#include<windows.h>#include<conio.h>#include<ctime>using namespace std;const int C…… 文章列表 2023年05月14日 1 点赞 0 评论 209 浏览 评分:10.0
字串简写(用前缀和优化版本) 摘要:分享一下自己的思路,仅供参考,希望可以帮到大家 ### 算法1(24分) ##### (暴力枚举) O(n^2) ####我们首先不考虑优化,怎么找到答案? ``` #include …… 文章列表 2024年03月30日 0 点赞 1 评论 314 浏览 评分:10.0
十四届蓝桥杯C++B组题目资料分享 摘要:** 我们发现考试时候的难度分布,不一定是越后面越难,这场岛屿个数个人认为最难想到正确做法。但位置居中,靠后的字串简写,个人认为反而没有前面的题难 ** ** 所以个人觉得,考试可以先把能打暴…… 文章列表 2024年04月05日 0 点赞 0 评论 378 浏览 评分:10.0
试除法:找约数(acwing) 摘要://试除法找出所有约数 d为最大公约数(配合gcd一起用) for(int i=1;i<d/i;i++) if(d%i==0) { a[res++]=i; if(i!=d/i…… 文章列表 2024年04月06日 0 点赞 0 评论 361 浏览 评分:10.0
spfa:正权负权边通用最短路 摘要:#include<iostream> #include<cstring> #include<algorithm> #include<queue> using namespace std; …… 文章列表 2024年07月10日 1 点赞 0 评论 176 浏览 评分:10.0
Java之完数的判断(包简单易懂) 摘要:import java.util.*; public class Main { public static void main(String[] args) { Sc…… 文章列表 2024年11月15日 0 点赞 0 评论 199 浏览 评分:10.0