函数体内含有yield关键字,那该函数的执行结果是生成器对象 生成器对象的本质就是迭代器,所以yield的功能是 1.把函数的执行结果做成迭代器 2.可以返回多次值,而return只能返回一次值 3.可以挂起函数的执行 yield语句形式 yield 1 yield的表达式形式 x=yield ne ...
分类:
编程语言 时间:
2017-06-02 01:18:07
阅读次数:
265
switch选择结构的语法 switch(表达式){ case 常量1: 代码块1 break; case 常量2: 代码块2 break; default: 代码块3 break; } switch选择结构4个关键字的解释 switch:表示"开关",这个开关就是switch关键字后面小括号里的值 ...
分类:
其他好文 时间:
2017-06-02 01:01:53
阅读次数:
229
1. 应该n是偶数,就行吧。应该判断1个人,只能出现一次吧。 1 #include<bits/stdc++.h> 2 #define pb push_back 3 typedef long long ll; 4 using namespace std; 5 typedef pair<int, int ...
分类:
其他好文 时间:
2017-06-01 23:46:15
阅读次数:
458
好久没做题了,然后就想着随便做一个。无奈cf都是晚上,然后就看见这个,随便做做。 资格赛,只要做出来1题就行了,4天的时间。 1. 水题 1 #include <iostream> 2 #include <stdio.h> 3 4 using namespace std; 5 6 int n; 7 ...
分类:
其他好文 时间:
2017-06-01 22:43:01
阅读次数:
153
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn=300010; char s[maxn]; int l,len,sz; long long ans; struct t ...
分类:
其他好文 时间:
2017-06-01 22:42:27
阅读次数:
180
中间那几场 不太会 B HDU 2873 n *m矩阵 #表示有炸弹 选这个炸弹后可以在 他上面 左边 任意位子 产生一一个炸弹 丢到1,1的自动爆炸 最后没的弄就输掉 sg函数 第一行第一列处理下 #include<stdio.h> #include<string.h> #include<algo ...
分类:
其他好文 时间:
2017-06-01 13:14:46
阅读次数:
134
1.Toast信息提示框 Button bt1=(Button)findViewById(R.id.Tbt01); Button bt2=(Button)findViewById(R.id.Tbt02); bt1.setOnClickListener(new OnClickListener() { ...
分类:
移动开发 时间:
2017-06-01 10:38:53
阅读次数:
255
A Walk Through the Forest Problem Description Jimmy experiences a lot of stress at work these days, especially since his accident made working difficu ...
分类:
其他好文 时间:
2017-06-01 10:33:26
阅读次数:
241
if选择结构的语法 if(条件){ 代码块} if选择结构的运用 public class a{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("输 ...
分类:
其他好文 时间:
2017-06-01 00:35:40
阅读次数:
247
最近项目上要用到跑马灯的效果,和网上不太相同的是,网上大部分都是连续的,而我们要求的是不连续的。 也就是是,界面上就展示4项(展示项数可变),如果有7项要展示的话,则不断的在4个空格里左跳,当然,衔接上效果不是很好看。 然后,需要支持点击以后进行移除掉不再显示的内容。 效果如下: 思路大致如下: 1 ...