find the first unique character in a string and you can just traverse this string only one time. if there is no such character, just return '#' and '#' will not appear in the string, else return the ...
分类:
其他好文 时间:
2015-04-21 22:53:16
阅读次数:
167
public ArrayList jixuanqiu(ArrayList red) //定义一个集合类型的函数 { Random r = new Random(); //机选6个红球的过程并排序 while (true) { if (red.Count == 6) { break; } else {...
分类:
其他好文 时间:
2015-04-21 22:23:35
阅读次数:
132
一道BST的练习题。Treap版:#include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i pr[v]) Right(v); } else { Insert(x, r[v]).....
分类:
其他好文 时间:
2015-04-21 22:15:51
阅读次数:
142
Treap+启发式合并。依旧没什么需要用到脑子的。#include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i pr[u]) Right(u); } else { if (!r[.....
分类:
其他好文 时间:
2015-04-21 22:11:08
阅读次数:
127
分析:互相抵消,最后不能被抵消的就是最多的。
#include
using namespace std;
int main()
{
int n,a,i;
int ans,sum;
while(cin>>n)
{
for(i=0;i>a;
if(i==0)
{
sum=1;
ans=n;
}
else i...
分类:
其他好文 时间:
2015-04-21 20:45:12
阅读次数:
104
----判断结构if1.if(条件表达式){执行语句;}2.if(条件表达式){执行语句;}else{执行语句;}3.if(条件表达式){执行语句;}elseif(条件表达式){执行语句;}……else{执行语句;}----选择结构switchswitch(表达式){case取值1:执行语句;break;case取值2:执行语句;break;…...d..
分类:
编程语言 时间:
2015-04-21 18:30:39
阅读次数:
122
#include
main()
{
int a=0,b,n,i,j,s[100],max,min,w;
scanf("%d",&n);
w=0;
for(i=0;i
scanf("%d",&s[i]);
max=s[0];
for(i=1;i
if(max
max=s[i];
//else {max=s[i+1];min=s[i];}}
min=s[0];
for(i=...
分类:
编程语言 时间:
2015-04-21 18:10:58
阅读次数:
128
@echooffrem-------------------------------------------------------------------------remAction:UserneedtocopySourcefiletoC:\temp\DTSrem-------------------------------------------------------------------------ifexist"C:\temp\DTS\*.htm"(goto0)else(goto1):0rem-..
分类:
其他好文 时间:
2015-04-21 14:48:44
阅读次数:
157
一. linux下C语言可以用fork()建立子进程。fork函数返回两个值,对于子进程,返回0; 父进程,返回子进程ID. 所以用if(fork()==0) {子进程执行的代码段;}else {父进程执行的代码段;}二. fork()函数的作用:新建一个子进程。可以这么看,fork的意思就是分支,...
分类:
系统相关 时间:
2015-04-21 13:01:58
阅读次数:
157
#includeint main(){int t; while(scanf("%d",&t)!=EOF) {while(1) { if(t>100 || t=90) {printf("A\n"); break; } else if(t>=80) {printf("B\n"); br...
分类:
其他好文 时间:
2015-04-20 22:20:36
阅读次数:
135