定义附加项

#include <iostream>
#include <string>

using namespace std;

int main ()
{
  string k1,k2;
  cout << "Enter some words:(Ctrl + I to end)" << endl;
  while(cin >> k1)
  {
#ifndef NDEBUG
	  cout << endl << "调试:" << k1 << endl;  // 这是调试用的,
#endif
	  if( !isapper(k1[0]))
		  continue;
	  if(k1 == k2)
		  break;
	  else
		  k2 = k1;
  }
  if(k1 == k2 && !k1.empty())
	  cout << "The repeated word:" << k1 << endl;
  else
	  cout << "没有重复的!" << endl;

return 0;
}

你可能感兴趣的:(定义附加项)