# 一、函数## 6.函数的返回值- 返回值概念 - 函数自身的处理数据或执行结果,需要被二次使用或其他程序调用时,需要将数据返回出来- 如何拿到返回值 - 关键字:`return 要返回的数据`- return的功能 - 可以让函数返回指定的**值** - 可以立即结束当前函数 - 一个函数中可以 ...
分类:
其他好文 时间:
2020-04-28 00:33:02
阅读次数:
38
还是很菜,只能做绿题。 而且 whk 异常颓废,明天要给自己定任务了。。。 ~~没带学读了~~ 题目链接: "P2401 不等数列" 考虑 $dp$ 。 如何继承呢? 我们来手玩一下吧,看 $n=3$ 是的一种种 $k=1$ 的情况: $$3 1$ 处就会成:$$ 显然产生一个贡献,然后看插到 $$ ...
分类:
其他好文 时间:
2020-04-28 00:27:20
阅读次数:
47
``` #include #include #include #include using namespace std; #define int long long const int N=4e6+10; int e[N],ne[N],h[N],idx; int depth[N]; int ans[... ...
分类:
其他好文 时间:
2020-04-27 21:00:16
阅读次数:
52
OK,对于箭头函数的this 用一句话概括:箭头函数中的this指向的是定义时的this,而不是执行时的this。 如果上面这句话听的是懂非懂或者完全不懂的,没关系,下面会有案例讲解。 举个栗子 来看看this的一个使用案例: //定义一个对象 var obj = { x:100, //属性x sh ...
分类:
其他好文 时间:
2020-04-27 17:01:08
阅读次数:
44
请编写函数fun,函数的功能是统计一行字符串中单词的个数,字符串在主函数中输入,规定所有单词由小写字母组成,单词之间有若干个空格隔开,一行的开始没有空格。 #include <stdio.h> #include <string.h> #define N 80 int fun( char *s) { ...
分类:
其他好文 时间:
2020-04-27 15:32:08
阅读次数:
151
http://codeforces.com/contest/1340/problem/C 我完了,连普及的题都不会做。 设$f[i][j]$表示在$j$时刻到$i$,最少多少个红绿灯回合。 发现i只用往i 1和i+1走,设$t=|x1 x2|$,则$j+t define fo(i, x, y) fo ...
分类:
其他好文 时间:
2020-04-25 17:37:26
阅读次数:
96
:dragon_face: 工厂模式 产品注册模板类+单例工厂模板类 ...
分类:
其他好文 时间:
2020-04-25 17:30:05
阅读次数:
120
链接 排序 + 01背包 为什么要排序??01背包的价值是固定的,本题还与时间有关,所以应该找一个价值最大的方案 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 1e5 + 10 ...
分类:
其他好文 时间:
2020-04-25 17:28:15
阅读次数:
57
1 #include"reg52.h"//单片机头文件 2 #define uchar unsigned char//宏定义,用uchar表示unsigned char,叫无符号字符型数据类型,取值范围为:0到255。 3 #define uint unsigned int//宏定义,用uint表示 ...
分类:
其他好文 时间:
2020-04-25 17:11:52
阅读次数:
105
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 5 #define MAXLINE 1000 //允许输入行的最大长度 6 7 int get_Line(char line[], int maxline); 8 9 ...
分类:
其他好文 时间:
2020-04-25 16:57:10
阅读次数:
117