请教问题
来源:互联网 发布:矩阵测光特点 编辑:程序博客网 时间:2024/04/30 23:44
对于这个程序的while循环我有点不明白,它是对单词的统计,请指教
#include <iostream.h>
#include <string.h> // prototype for strcmp()
const int STR_LIM = 50;
int main()
{
char word[STR_LIM];
int count = 0;
cout << "Enter words (to stop, type the word done):/n";
while (cin >> word && strcmp("done", word))
++count;
cout << "You entered a total of " << count << " words./n";
return 0;
}
#include <string.h> // prototype for strcmp()
const int STR_LIM = 50;
int main()
{
char word[STR_LIM];
int count = 0;
cout << "Enter words (to stop, type the word done):/n";
while (cin >> word && strcmp("done", word))
++count;
cout << "You entered a total of " << count << " words./n";
return 0;
}
- 请教!~请教一个问题!~~~~~~~
- 请教问题
- 请教问题
- 请教问题
- 请教问题
- 问题请教
- 请教问题
- 请教问题
- 请教问题
- 问题请教
- 请教一个问题
- 先请教一个问题:
- 请教老大问题
- 请教,java反编译问题
- java基础问题请教!
- 请教一个VC问题
- 请教一个问题.
- 请教一个问题
- 实习中遇到的第一个问题! finally version
- 中国原创网游四大天王各领风骚 期待华山论剑
- 圆明园灰烬,比石头更沉重
- 不匹配一个字符串的正则
- 千万日元年薪:中国大规模引进日本退休专家
- 请教问题
- 一个牛X北大学生答日本记者问,超级经典
- JAVA和JAVAC 命令行
- 简单的Asp.net计数器控件
- xml 读取 dom4j
- 将文件拷贝n份的bash脚本
- 1952年埃塞俄比亚曾与中国交战
- freebsd ssh 服务器登录失败问题的解决
- 98大水灾,各国各地区对我国的捐助一览表