3.2.2 ifthen

来源:互联网 发布:终结者2网络连接失败 编辑:程序博客网 时间:2024/06/14 12:16
#include <iostream>using namespace std;int main(){int i;cout<<"type a number and 'Enter'"<<endl;cin>>i;if(i>5)    cout << "It's greater than 5" <<endl;else    if(i<5)    cout << "It's less than 5" <<endl;else    cout << "It's equal to 5 " <<endl;cout <<"type a number and 'Enter'"<<endl;cin>>i;if(i<10)    if(i>5)       cout<<"5<i<10"<<endl;else    cout<<"i<=5"<<endl;else    cout<<"i>=10"<<endl;}