io20_2_1.03.c

来自「C++Primer中文版 第三版 深入系列 Primer 第三版 著 中」· C语言 代码 · 共 31 行

C
31
字号
// #include <iostream>
// #include <iomanip>

#include <iostream.h>
#include <iomanip.h>

/*
 *  $ a.out
 *  The winter of our discontent
 *
 *  The
 *  winter
 *  of
 *  our
 *  discontent
 *  
 */

int main()
{
	const int bufSize = 24;
	char buf[ bufSize ];
	char *pbuf = buf;

	// each string greater than sizeof(bufsize)
	// is broken into two or more strings
 	while ( cin >> setw( bufSize ) >> pbuf )
 		cout << pbuf << endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?