码迷,mamicode.com
首页 >  
搜索关键字:while read line for ifs    ( 74720个结果
抽象类与抽象方法
抽象类为基类:abstract class Animal { string name; public string Name { get { return name; } set { name = value; } } char gender; public char Gender ...
分类:其他好文   时间:2014-07-19 21:30:18    阅读次数:182
while(scanf("%d",&n)!=EOF)
scanf的返回值由后面的参数决定scanf("%d%d", &a, &b);如果a和b都被成功读入,那么scanf的返回值就是2如果只有a被成功读入,返回值为1如果a和b都未被成功读入,返回值为0如果遇到错误或遇到end of file,返回值为EOF。且返回值为int型.验证:sign=scan...
分类:其他好文   时间:2014-07-19 21:15:44    阅读次数:281
【leetcode】Candy
There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requi...
分类:其他好文   时间:2014-07-19 21:07:18    阅读次数:188
linux_后台启动多个java -jar 程序,及关闭
启动脚本startup.sh#!/bin/bashx=$(($1))while (($x>0))do java -jar /home/chenpenghui/crawler/crawler-hb/StartUpIp.jar & sleep 3 x=$(($x-1))done线程数 ...
分类:编程语言   时间:2014-07-19 21:00:09    阅读次数:273
[leetcode]Count and Say
Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is r...
分类:其他好文   时间:2014-07-19 20:35:34    阅读次数:276
Max Points on a Line
题目:就是求在同一直线上的点最多的个数。分析:斜率相同,那么它们就在一条直线上。unordered_map 简单介绍:boost::unordered_map是计算元素的Hash值,根据Hash值判断元素是否相同。所以,对unordered_map进行遍历,结果是无序的。来自为知笔记(Wiz)
分类:其他好文   时间:2014-07-19 19:37:23    阅读次数:205
3.3 将标准输入复制到标准输出
mycat/mycat.c#include "apue.h"#define BUFFSIZE 4096intmain(void){ int n; char buf[BUFFSIZE]; while ((n = read(STDIN_FILENO, buf, BUFFSIZE)) > 0) if .....
分类:其他好文   时间:2014-07-19 00:00:58    阅读次数:216
3.5 对一个文件描述符打开一个或多个文件状态标志
lib/setfl.c #include "apue.h"#include voidset_fl(int fd, int flags) /* flags are file status flags to turn on */{ int val; if ((val = fcntl(fd, F_GETF...
分类:其他好文   时间:2014-07-18 23:38:21    阅读次数:333
3.2 创建一个具有空洞的文件
file/hole.c #include "apue.h"#include char buf1[] = "abcdefghij";char buf2[] = "ABCDEFGHIJ";intmain(void){ int fd; if ((fd = creat("file.hole", FILE_M...
分类:其他好文   时间:2014-07-18 23:35:26    阅读次数:193
3.1 测试能否对标准输入设置偏移量
file/seek.c#include "apue.h"intmain(void){ if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1) printf("cannot seek\n"); else printf("seek OK\n"); exit(0);}
分类:其他好文   时间:2014-07-18 23:27:20    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!