C++ Primer 6.25,该如何解决

C++ Primer 6.25
例如,可以输出每一个读入的单词,用来判断循环是否正确地找到第一个连续出现的以大写字母开头的单词。分别在打开和关闭调试器的情况下编译和运行这个程序。
答案是:
C/C++ code

#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main()
{
    string currWord,preWord;
    cout<<"Enter some words:(Ctrl+Z to end)"<<endl;
    while (cin>>currWord)
    {
        #ifndef NDEBUG
//        #define NDEBUG
        cout<<currWord<<" ";
        #endif
        if (!isupper(currWord[0]))  continue;
        if(currWord==preWord) break;
        else preWord=currWord;
    }
    if(currWord==preWord&&!currWord.empty())
        cout<<"The repeated word:"<<currWord<<endl;
    else
        cout<<"There is no repeated word that has initial capital."<<endl;
    return 0;
}

在打开调试器的情况下编译和运行该程序,会输出所读入的每个单词;如果在关闭调试器的情况下编译和运行该程序,则不会输出所读入的每个单词。
最后一句是什么意思?Ctrl+Z又有什么用?还有我添加了注释的那行后,运行还是会输出每个单词。
谢谢。

------解决方案--------------------
c++是提前编译好的静态语义,这样写的话
#ifndef NDEBUG 
#define NDEBUG 
cout<<currWord<<" "; 
#endif 
不编译