有关一些C++的与或非的基本用法

      计算机与编程 2007-6-13 15:39:00

//2007.06.13.check or || , and && , not ! ,
//goddamn ***... wangs.teams

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

main()

{
 bool user_more;
 char user_sp;

loop : for (int nn=1;nn<400000000;nn++)
    {
     if (nn%10000000==0)
     {
      cout<<"<<";
     }
    };
 cout<<endl;
 cout<<"do you want to check it again? "<<endl;
 cin>>user_sp;
// cout<<endl;

 if (user_sp=='Y'||user_sp=='y') //remember that,if using the equality,you must use "single quote"! 
 {
  user_more=true;
 }
 else
 {
  user_more=false;
 }
//................................................
 if (user_more == true)
 {
  cout<<"user_more is true..."<<endl; 
 }
 else
 {
  cout<<"user_more is false..."<<endl;
 }
 goto loop;
 return 0;
}

标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}