C - The C Answer (2nd Edition) - Exercise 1-8
/*
Write a program to count blanks, tabs, and newlines.
*/ #include <stdio.h> /* count blanks, tabs, and newlines */
main()
{
int c, nb, nt, nl; nb = 0; /* number of blanks */
nt = 0; /* number of tabs */
nl = 0; /* number of newlines */
while((c = getchar()) != EOF)
{
if(c == ' ')
{
++nb;
}
if(c == '\t')
{
++nt;
}
if(c == '\n')
{
++nl;
}
}
printf("%d %d %d\n", nb, nt, nl);
}
C - The C Answer (2nd Edition) - Exercise 1-8的更多相关文章
- C - The C Answer (2nd Edition) - Exercise 1-7
/* Write a program to print the value of EOF. */ #include <stdio.h> main() { printf("EOF ...
- C - The C Answer (2nd Edition) - Exercise 1-2
/* Experiment to find out what happens when printf's argument string contains \c, where c is some ch ...
- C - The C Answer (2nd Edition) - Exercise 1-1
/* Run the "hello, world" program on your system. Experiment with leaving out parts of the ...
- C - The C Answer (2nd Edition) - Exercise 1-16
/* Revise the main routine of the longest-line program so it will correctly print the length of arbi ...
- C - The C Answer (2nd Edition) - Exercise 1-5
/* Modify the temperature conversion program to print the table in reverse order, that is, from 300 ...
- C - The C Answer (2nd Edition) - Exercise 1-15
/* Rewrite the temperature conversion program of Section 1.2 to use a function for conversion. */ #i ...
- C - The C Answer (2nd Edition) - Exercise 1-12
/* Write a program that prints its input one word per line. */ #include <stdio.h> #define IN 1 ...
- C - The C Answer (2nd Edition) - Exercise 1-4
/* Write a program to print the corresponding Celsius to Fahrenheit table. */ #include <stdio.h&g ...
- C - The C Answer (2nd Edition) - Exercise 1-6
/* Verify that the expression getchar() != EOF is 0 or 1. */ #include <stdio.h> main() { int c ...
随机推荐
- MyHome3D在线装修设计软件测评
人人都是设计师 ——MyHome3D在线装修设计软件 关键词:云技术,3D呈现效果,自主设计,简单易用,家具装修设计 上海爱福窝云技术有限公司借助于前沿的3D渲染技术,降低了装修设计的门槛,真正实现了 ...
- UI概念体系要素
结构.渲染.交互.数据. 要素.呈现.交互 1)UI(组成)要素:结构 2)布局: 3)渲染: 4)事件处理: 5)数据:
- tf.app.run() got unexpected keyword argument 'argv'
运行的代码是mnist_with_summaries.py.出现的问题是 tf.app.run() got unexpected keyword argument 'argv' 昨天一直以为是我自己不 ...
- cesium primitive方式 ————http://blog.sina.com.cn/s/blog_15e866bbe0102y0ji.html
Cesium学习笔记-工具篇17-PrimitivePoint自定义渲染-点 (2018-08-28 16:12:06) 转载▼ 标签: cesium primitive 自定义渲染 shader c ...
- CAD参数绘制椭圆(com接口)
在CAD设计时,需要绘制椭圆,用户可以设置椭圆的基本属性. 主要用到函数说明: _DMxDrawX::DrawEllipse 绘制椭圆.详细说明如下: 参数 说明 DOUBLE dCenterX 椭圆 ...
- Hadoop推测执行机制问题
问题描述:MultipleOutputs使用时hdfs报错 // :: INFO mapreduce.Job: Task Id : attempt_1525336138932_1106 ...
- 【经验】停止Smart Card服务
Windows+R键调出运行 输入 services.msc 有一项Smart Card的服务找到他->属性->启动类型(设置为禁用 )->确定,然后重新启动服务
- 02Document Type Definition
Document Type Definition 1. Document Type Definition DTD(Document Type Definition)文件格式定义作用是给予文件一种格(T ...
- BZOJ 2055 80人环游世界 有上下界最小费用可行流
题意: 现在有这么一个m人的团伙,也想来一次环游世界. 他们打算兵分多路,游遍每一个国家. 因为他们主要分布在东方,所以他们只朝西方进军.设从东方到西方的每一个国家的编号依次为1...N.假若第 ...
- CSU1008: Horcrux
Description A Horcrux is an object in which a Dark wizard or witch has hidden a fragment of his or h ...