第十五章 输入输出函数
这一章读完的第一感觉就是“呵呵”。
如果说上过C语言课,基本上scanf()/printf()算是用的比较熟练了。尤其是那些抽象的格式说明。还有scanf()为什么要加括号。
读过本书前面的内容的话,getchar(),putchar(),gets(),puts()这些应该也问题不大。
再如果的话,你学过计算机图形学,你玩过OpenGL,听说过双缓存机制,那...
分类:
其他好文 时间:
2014-07-26 17:19:02
阅读次数:
285
强烈推荐在线学习网站:http://tryruby.org/笔记:Ruby会默认返回方法中的最后一个值。 如果需要返回多个值,可以用数组来实现。 可以通过强制声明return来返回值。 基础的输出方法是用puts(输出一行),print(直接打印)。 基础的输入方法是gets(读入一行,包含行尾的'...
分类:
其他好文 时间:
2014-07-21 11:06:41
阅读次数:
238
dict={'cat'=>'abc','dog'=>'def'}puts dict.sizedict.keys返回所有的key,values返回所有的value。删除:dict.delete('cat')有条件地删除x={'a'=>100,'b'=>20}x.delete_if{|key,value...
分类:
其他好文 时间:
2014-07-19 20:30:46
阅读次数:
238
题解:简单博弈论#include int main(){ int n; while(scanf("%d",&n),n!=0) if (n&1) puts("Bob"); else puts("Alice"); return 0;}
分类:
其他好文 时间:
2014-07-17 10:01:29
阅读次数:
259
最近在练机试题,常用的C和C++输入输出如下:1 scanf 和printfint a; scanf("%d",&a) ; printf("%d",a); printf("\n");double b;scanf("%");char c; scanf("%c",&c);printf("%c",c);l...
分类:
其他好文 时间:
2014-07-08 22:53:52
阅读次数:
257
expect自动远程拷贝脚本,利用rsync命令,脚本内容如下:#!/usr/bin/expect --proc Usage_Exit {self} { puts "" puts "Usage: $self ip user passwd port sourcefile d...
分类:
其他好文 时间:
2014-07-06 16:24:17
阅读次数:
333
2014年第一个脚本,哈哈!!! expect实现远程主机自动执行命令脚本:#!/usr/bin/expect --if { [llength $argv] < 4 } { puts "Usage: $argv0 ip user passwd port commands timeout" exit ...
分类:
其他好文 时间:
2014-07-06 16:23:01
阅读次数:
341
选择排序
定义:依次选择最小的元素放在相应的位置上
特点:比较次数是 N(N-1)/2 交换次数是 N (each exchange puts an item into its ?nal position, so the number of exchanges is N. Thus, the running time is dominated by the number of
com...
分类:
其他好文 时间:
2014-07-03 15:44:01
阅读次数:
259
#include
int fputc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
int putc(int c, FILE *stream);
int putchar(int c);
int puts(const char *s);
fputc()写一个字符c,强制转换成一个unsigned ch...
分类:
编程语言 时间:
2014-06-27 23:46:49
阅读次数:
422
ruby -v #查看ruby 版本ruby -e ''require"watir"; puts Watir::IE::VERSION'' #查看watir版本rvm list known #列出已知的ruby版本rvm install 1.9.3rvm use 1.9.3 | rvm use sy...
分类:
其他好文 时间:
2014-06-27 22:29:45
阅读次数:
285