📄 #10.cpp
字号:
// STR_CNT.CXX : a word count program that uses stream i/o
#include <stream.hxx>
#include <ctype.h>
main()
{
int word_cnt = -1;
void found_next_word (void);
while ( cin.good() ) { // ^Z ends input
word_cnt++; // increment counts
found_next_word ();
}
cout << "word count is " << word_cnt << "\n";
}
void found_next_word (void)
{
char c;
cin >> c;
while (!isspace (c))
cin.get (c);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -