c++ primer plus 习题5.8(5.9)(while(cin>>word),strcmp())
来源:互联网 发布:淘宝复制天猫宝贝违规 编辑:程序博客网 时间:2024/05/29 17:10
#include <iostream>#include <cstring> // prototype for strcmp()const int STR_LIM = 50;int main(){ using namespace std; 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<iostream>using namespace std;int main(){string word;int count = 0; cout << "Enter words (to stop, type the word done):\n"; while (cin >> word &&! (word=="done")) ++count; cout << "You entered a total of " << count << " words.\n"; return 0; }
0 0
- c++ primer plus 习题5.8(5.9)(while(cin>>word),strcmp())
- c++ primer plus 习题6.1 (cctype,cin.get)
- c primer Plus第一章习题
- C Primer plus 习题5.3
- C++ Primer 关于while(cin>>word) 退出循环问题
- C primer plus第1章(概览)习题
- C primer plus第9章(函数)习题
- C primer plus第10章(指针)习题
- C++primer plus(第四版)第五章习题参考
- C primer plus课后习题答案(部分)
- C Primer Plus学习 七 while语句
- c primer plus第14章习题
- c primer plus 第二章习题摘录
- 《C Primer Plus》第一章 概览 课后习题
- C Primer Plus 第五章习题
- C primer plus第七章习题
- c primer plus 11章习题答案
- c primer plus第十一章课后习题
- void及void指针含义的深刻解析
- 搭建opencv的android编译平台出现的问题
- 61469
- 使用ZooKeeper实现配置同步
- ceph存储 SAN,NAS,DAS及iSCSI其架构之间区别
- c++ primer plus 习题5.8(5.9)(while(cin>>word),strcmp())
- Jenkins控制管理MAVEN工程
- java的两种for循环
- 集训小记 4
- Kafka#3:分布式设计
- LeetCode--Min Stack
- ceph存储 iSCSI完全指南
- SDUTOJ3108-赏赏赏
- 7.映射组成关系