#include?<iostream>
#include?<list>
#include?<algorithm>
using?std::list;
using?std::cout;
using?std::endl;
template?<typename?T>
class?print{
public:
????void
????operator()(co...
分类:
编程语言 时间:
2015-05-27 16:12:01
阅读次数:
299
while 1: temp=input('请输入一个正整数:') c=int(temp) a=1 b=1 while a<=c-1: b=b*(a+1) a=a+1 print(b)上述代码可以计算各种数据的阶乘。相比C语言不会存在长度...
分类:
编程语言 时间:
2015-05-27 13:47:35
阅读次数:
437
1.定义子程序 使用sub关键字定义 ; 子程序名和标识符同要求, 但是有的特殊的可以用 &符号; 子程序是全局的, 不需要再使用前声明; 重名函数后者覆盖前者.sub roger{ $n += 1; #全局变量$n print "Hello , sailor number $n!...
分类:
其他好文 时间:
2015-05-27 11:34:47
阅读次数:
111
1、阅读下面的程序,并写出运行结果
(1)虚函数
#include
using namespace std;
class A {
int a;
public:
A():a(5){}
virtual void print()const { cout<<a;}
};
class B: public A {
char b;
public:
B() ...
分类:
编程语言 时间:
2015-05-27 10:07:09
阅读次数:
160
自动化dhcp服务shell脚本如下:#vimauto_dhcp.sh#!/bin/bash
read-p"pleaseinputyourip:"IP#设置dhcp服务器ip
read-p"pleaseinputyourgw:"GW#设置dhcp服务器网关
IPNET=$(echo$IP|awk-F.‘{print$1"."$2"."$3}‘)#取网段号
IP_CONF="/etc/sysconfig/network-scripts/ifcfg-eth0"#..
分类:
系统相关 时间:
2015-05-27 01:06:51
阅读次数:
605
1最小化安装(自定义选包:最基本为:Bash;Compatibilltylibrarles;DebuggingTools;Developmenttools)最小化启动:foroldboyin`chkconfig--list|grep"3:on"|awk‘{print$1}‘|grep-vE"crond|network|sshd|rsyslog|xinetd"`;dochkconfig$oldboyoff;done2ulimit:ulimit-n如果系统进..
分类:
系统相关 时间:
2015-05-27 01:05:47
阅读次数:
323
int?layer?=?5;
????for?(int?k?=?layer?;?k?>0?;k--)
????{
???????
????????
????????for?(?int?i?=?0?;?i?<k?;i++)
????????{
?????????...
分类:
其他好文 时间:
2015-05-26 19:17:42
阅读次数:
104
如题,分析首先最简单的取出ipcd/usr/local/nginx/logs
awk‘{print$1}‘access.log|sort|uniq-c|sort-rn|head-n50|awk‘{print$2}‘>/root/list
#在nginx/apache下执行上述代码。把ip写到list列表然后思路就是把每个ip的来源地分析出来,我用的淘宝的ip数据库,还是不错的#!/bi..
分类:
数据库 时间:
2015-05-26 19:05:22
阅读次数:
334
array_unique() :去除数组中的重复项,只适用于一维数组它不像 sort()方法,eg: $arraytest = array('tommy','tommy','abcd'); sort($arraytest); print_r($arraytest); 运行结果是: ar...
分类:
编程语言 时间:
2015-05-26 18:40:59
阅读次数:
284
2015526Python在结构上和传统C语言有一定区别:Python采用缩进对语句进行分组。一个简单的if-elif-els例子A=-6if(A>0):print(A,">0")elif(A==0):print(A,"==0")else:print(A,"<0")
分类:
编程语言 时间:
2015-05-26 16:21:52
阅读次数:
137