C++PRIMER上的一个问题

imbigsnake1 2009-03-22 12:39:11
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{string str;
string str1;
int flag=0;
while(cin>>str)
{
#ifndef NDEBUG
cout<<str<<" ";
#endif
if(!isupper(str[0]))
continue;
if(str1==str)
{ flag=1;
break;
}
str1=str;
}
if(flag==1)
cout<<str<<endl;
else
cout<<" !!!!!!!!!!!!!"<<endl;

return 0;
}

它说在关闭调试器的情况下将只输出第一个字母为大写的连续出现2次的单词,,请问要如何关闭调试器
...全文
160 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
hmzgz81 2009-03-23
  • 打赏
  • 举报
回复
eee...
downmooner 2009-03-22
  • 打赏
  • 举报
回复
前面 加一个#define NDEBUG
ysysbaobei 2009-03-22
  • 打赏
  • 举报
回复
wxgiter 2009-03-22
  • 打赏
  • 举报
回复
就是说生成的exe文件中不含调试信息,加上#define NODEBUG后
#ifndef NDEBUG
cout < <str < <" ";
#endif
语句不编译。。。
jakqigle 2009-03-22
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 hairetz 的回复:]
#ifndef NDEBUG
cout < <str < <" ";
#define NDEBUG
#endif
[/Quote]
up
danxuezx 2009-03-22
  • 打赏
  • 举报
回复
就是取消调试信息,你看如何才能把调试信息去掉呢?
icerhack 2009-03-22
  • 打赏
  • 举报
回复
学习了,#define NODEBUG
小猴饲养员 2009-03-22
  • 打赏
  • 举报
回复
mark
fairchild811 2009-03-22
  • 打赏
  • 举报
回复
#ifndef NDEBUG
cout < <str < <" ";
#define NDEBUG
#endif

xuruichen 2009-03-22
  • 打赏
  • 举报
回复
#define NEDBUG
基本常识啊,楼主需要看的仔细点
na2650945 2009-03-22
  • 打赏
  • 举报
回复
学习啦。
  • 打赏
  • 举报
回复
#ifndef NDEBUG
cout < <str < <" ";
#define NDEBUG
#endif

65,211

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧