首页 > 其他 > 详细

6.2逻辑表达式

时间:2021-04-18 11:29:13      阅读:18      评论:0      收藏:0      [点我收藏+]

or.cpp

#include<iostream>
using namespace std;
int main()
{
cout<<"This program may reformat your hard disk\n"
           "and destroy all your data.\n"
           "Do you wish to continue?<y/n> ";
char ch;
cin>>ch;
if (ch==‘y‘||ch==‘Y‘)
cout<<"You were warned!\a\a\n";
else if (ch==‘n‘||ch==‘N‘)
cout<<"A wise choice ... bye\n";
else
cout<<"That wasn‘t a y or n! Apparently you "
           "can‘t follow\ninstructions,so"
   "I‘ll trash your disk anyway.\a\a\a\n";

system("pause");
return 0;
}

6.2逻辑表达式

原文:https://www.cnblogs.com/cnxm/p/14672339.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!