c point ccccc
代码来自《K&R》
范例输入(控制台):
-32 23 11 18
33987 23
^Z
范例输出:
-32
23
11
18
33987
23
#include<stdio.h>
#define SIZE 100 int main()
{
int n, array[SIZE], getint(int *); for(n = ; n < SIZE && getint(&array[n]) != EOF; n ++)
;
for(int i = ; i < n; i ++)
printf("%d\n", *(array+i));
return ;
} #include<ctype.h> int getch(void);
void ungetch(int); int getint(int *pn)
{
int c, sign; while(isspace(c = getch()))
;
if(!isdigit(c) && c != EOF && c != '-' && c != '+'){
ungetch(c);
return ;
}
sign = (c == '-')? - : ;
if(c == '+' || c == '-')
c = getch();
for(*pn = ; isdigit(c); c = getch())
*pn = * *pn + (c - '');
*pn *= sign;
if(c != EOF)
ungetch(c);
return c;
} #define BUFSIZE 100 char buf[BUFSIZE];
int bufp = ; int getch(void)
{
return (bufp > )? buf[--bufp] : getchar();
} void ungetch(int c)
{
if(bufp >= BUFSIZE)
printf("ungetch: too many characters\n");
else
buf[bufp++] = c;
}
c point ccccc的更多相关文章
- 刘子健的第二次博客——有关CCCCC语言(・᷄ᵌ・᷅)
刘子健的第二次博客--有关CCCCC语言(・᷄ᵌ・᷅) 下面又到了回答老师问题的时候啦-(・᷄ᵌ・᷅) 有些问题正在深思熟虑中!敬请期待近期的不间断更新! 你有什么技能比大多人(超过90%以上)更好? ...
- 预备作业二——有关CCCCC语言(・᷄ᵌ・᷅)
有关CCCCC语言(・᷄ᵌ・᷅) 下面又到了回答老师问题的时候啦-(・᷄ᵌ・᷅) 有些问题正在深思熟虑中!敬请期待近期的不间断更新! 你有什么技能比大多人(超过90%以上)更好? 针对这个技能的获取你 ...
- ES6之变量常量字符串数值
ECMAScript 6 是 JavaScript 语言的最新一代标准,当前标准已于 2015 年 6 月正式发布,故又称 ECMAScript 2015. ES6对数据类型进行了一些扩展 在js中使 ...
- 《MSSQL2008技术内幕:T-SQL语言基础》读书笔记(下)
索引: 一.SQL Server的体系结构 二.查询 三.表表达式 四.集合运算 五.透视.逆透视及分组 六.数据修改 七.事务和并发 八.可编程对象 五.透视.逆透视及分组 5.1 透视 所谓透视( ...
- Python(五)模块
本章内容: 模块介绍 time & datetime random os sys json & picle hashlib XML requests ConfigParser logg ...
- 生成Tab键或逗号分隔的CSV
<?php header("Content-type:text/csv;charset=utf-8"); header("Content-Disposition:a ...
- Bootstrap之选项卡
<div class="container"> <!-- nav-tabs作为选项卡头部样式 --> <ul class="nav nav- ...
- Javascript-DOM总结
DOM总结 1.DOM的含义 DOM是Document Object Model文档对象模型的缩写.根据W3C DOM规范,DOM是一种与浏览器,平台,语言无关的接口,使得你可以访问页面其他的 ...
- Map排序
HashMap: 最常用的Map,它根据键的HashCode 值存储数据,根据键可以直接获取它的值,具有很快的访问速度.HashMap最多只允许一条记录的键为Null(多条会覆盖);允许多条记录的值为 ...
随机推荐
- Linux系统中为php添加pcntl扩展的方法
1.首先看下 phpize命令 所在的目录 (ps:我的目录/usr/bin/phpize)如果没有找到的话 执行安装yum install php53_devel (ps:请注意自己的版本) 安装 ...
- JavaEE基础(三)
1.Java语言基础(逻辑运算符的基本用法) A:逻辑运算符有哪些 &,|,^,! &&,|| B:案例演示 逻辑运算符的基本用法 注意事项: a:逻辑运算符一般用于连接boo ...
- Windows下打包Python的exe可执行文件
参考:http://www.cnblogs.com/Lands-ljk/p/5447723.html
- Unix/Linux编程实践教程(一:进程、管道)
execvp在程序中启动新程序: 用fork创建新进程: forkdemo2代码: 测试fork的时候参考<Linux权威指南>阅读笔记(3) 使用了patch: [root@local ...
- php时间函数整理
PHP中的时间函数有这么些:(1)date用法: date(格式,[时间]);如果没有时间参数,则使用当前时间. 格式是一个字符串,其中以下字符有特殊意义:U 替换成从一个起始时间(好象是1970年1 ...
- 20150625_Andriod_01_ListView1_条目选中
android listview 参考地址: http://www.cnblogs.com/zhengbeibei/archive/2013/05/14/3078805.html http://xy ...
- drawer principle in Combinatorics
Problem 1: Given an array of real number with length (n2 + 1) A: a1, a2, ... , an2+1. Prove that th ...
- HDU(1175),连连看,BFS
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1175 越学越不会,BFS还是很高级的. 连连看 Time Limit: 20000/100 ...
- 加载页面(Loading)
/* 文件说明:页面加载时Loading JS 文件描述:解决IE或FF下,初始化加载时,页面布局乱掉的问题,参考:*/var width = $(window).width();var height ...
- 2016年11月10日 星期四 --出埃及记 Exodus 20:1
2016年11月10日 星期四 --出埃及记 Exodus 20:1 And God spoke all these words: 神吩咐这一切的话说,