码迷,mamicode.com
首页 >  
搜索关键字:argv    ( 3650个结果
好东西, 一看就懂.
#!/usr/bin/expect set timeout 30 spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2] expect { "(yes/no)?" {send "yes\n";exp_continue} "password:" ...
分类:其他好文   时间:2015-01-06 12:16:12    阅读次数:167
华为机试—相同子串
输入一个字符串,判断是否含有相同的子串(字串长度大于1),是输出1,否,输出0。 例如12312含有两个12,所以输出1;23456则没有相同子序列,输出0. 输入:12312 输出:1 #include #include using namespace std; int main(int argc, char *argv[]) { string s; cin>...
分类:其他好文   时间:2015-01-06 00:51:48    阅读次数:198
华为机试—字符串去重排序
输入一个字符串,去掉重复出现的字符,并把剩余的字符串排序输出。 #include #include using namespace std; int main(int argc, char *argv[]) { string s; while(cin>>s) { for(int i=0;i<s.size();++i) for(i...
分类:编程语言   时间:2015-01-06 00:51:40    阅读次数:232
基于boost实现的共享内存版HashMap
#include #include #include #include #include int main (int argc, char *argv[]) { typedef int KeyType; typedef float MappedType; typedef std::pair ValueType; typedef boost::interp...
分类:其他好文   时间:2015-01-05 20:32:30    阅读次数:511
华为机试—提取数字排序
输入多个字符串,分别提取出里面的数字,排序输出所有的数字。 #include #include #include #include #include using namespace std; vectorvec; int main(int argc, char *argv[]) { int n; string s; while(cin>>n) {...
分类:编程语言   时间:2015-01-05 00:36:07    阅读次数:206
华为机试—频率最小的字符
输入一个字符串,输出出现次数最少,或者说出现频率最小的字符。 #include #include #include #include #include using namespace std; int main(int argc, char *argv[]) { string s; cin>>s; mapm; for(string::size_type i=0...
分类:其他好文   时间:2015-01-05 00:34:23    阅读次数:174
Linux shell脚本编程入门 (一)
环境变量 一些命令 shell脚本中经常出现各种环境变量,因此要写脚本,必须先来了解环境变量.常见的处理环境变量的命令,列举在下面 set 用来显示本地变量env 用来显示环境变量export 用来显示和设置环境变量source 后面跟一个文件,可以直接执行文件里的脚本命令并更新 常见的环境变量 位置参数 相当于C语言中, main函数的argv数组, 这里用 $num 表...
分类:系统相关   时间:2015-01-04 23:09:24    阅读次数:363
二分查找算法
1 #include 2 3 int binarySearch(int *array, int length, int num); 4 int main(int argc, const char * argv[]) { 5 6 int array[] = {1, 2, 3, ...
分类:编程语言   时间:2015-01-04 21:15:04    阅读次数:163
python之获取命令行参数
1. getopt模块:getopt模块用于抽出命令行选项和参数,也就是sys.argv。命令行选项使得程序的参数更加灵活。支持短选项模式和长选项模式。1) 主要函数:getopt(args, shortopts, longopts = [])参数:=====- args 通常是: sys.argv...
分类:编程语言   时间:2015-01-04 18:49:00    阅读次数:168
递归求阶乘
#include int fatorialWithNum(int num);int main(int argc, const char * argv[]) { @autoreleasepool { int result = fatorialWithNum(6); ...
分类:其他好文   时间:2015-01-04 17:03:11    阅读次数:135
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!