LinuxBash/Shell:[root@memshell]#catprime.sh
#!/bin/sh
#Printprimefrom1to100
for((i=1;i<=100;i++))
do
if[$i-eq1];then
continue
fi
flag=0
for((j=2;j<i;j++))
do
a=$[$i%$j]
if[$a-eq0];then
flag=1
fi
done
if[$flag-eq0];then
echo$iispri..
分类:
其他好文 时间:
2014-08-04 14:42:08
阅读次数:
257
方法一:使用文件标签EOF重定向的方法的:#!/bin/bash
user=root
pass=123456
db=mysql
tablename=user
mysql-s--line-numbers-f-u$user-p$pass-D$db--delimiter=";"-E<
--SELECThost,userfrom$tablenameorderby1;
SELECThost,userfrom$tablenameorderby1;
quit
EOF优点:sql..
分类:
数据库 时间:
2014-08-04 14:41:58
阅读次数:
234
定时器
ACE_Reactor::instance()->handle_events() #include "ace/Reactor.h"
ACE_Event_Handler #include "ace/Event_Handler.h"
int ACE_Event_Handler::handle_timeout(const ACE_Time_Value &curre...
分类:
其他好文 时间:
2014-08-04 14:34:47
阅读次数:
239
学习shell小练习
判断/tmp/lzz 这个目录是否有读写权限,如果没有则添加权限...
分类:
其他好文 时间:
2014-08-04 14:27:37
阅读次数:
236
Watchcow
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 5964
Accepted: 2561
Special Judge
Description
Bessie's been appointed the new watch-cow for ...
分类:
其他好文 时间:
2014-08-04 14:22:57
阅读次数:
197
Problem DescriptionTIANKENG managers a pan fried rice shop. There are n kinds of fried rice numbered 1-n. TIANKENG will spend t time for once frying. ...
分类:
其他好文 时间:
2014-08-04 14:13:37
阅读次数:
259
简介:友元可以访问与其有好友关系的类中的私有成员。 友元包括友元函数和友元类。【1】将普通函数声明为友元函数#includeusing namespace std;class Time{ public: Time(int,int,int); ...
分类:
其他好文 时间:
2014-08-04 14:07:47
阅读次数:
204
//php获取今日开始时间戳和结束时间戳$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));$endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;//php获取昨日起始时间戳和结...
分类:
Web程序 时间:
2014-08-04 13:58:17
阅读次数:
223
题目链接:UVa12726是个PDF,不好复制进来。大意:有个人要追个妹子,想加妹子QQ,但是不知道谁规定的,玩QQ的人要加好友必须先要有至少k个共同好友。共有N个人玩QQ,编号为1到N,1是男主,N是妹子。有M个初始好友关系,求男主最少要加多少个人才能有资格加妹子,或者永远加不到妹子。题解:最少加...
分类:
其他好文 时间:
2014-08-04 13:27:27
阅读次数:
338
一、基本变量linux脚本中的变量不需要事先声明,而是直接定义使用(这点不同于其他高级编程语言中变量的使用)bash变量类型分为本地变量和环境变量。本地变量:只对当前的shell有效,对其他shell及其子shell没效环境变量:对当前shell进程及其子shell有效,对其它的shell进程无..
分类:
其他好文 时间:
2014-08-04 11:16:08
阅读次数:
246