zoukankan      html  css  js  c++  java
  • c++程序—if语句实践

    三只小

    #include<iostream>
    using namespace std;
    #include<string>
    
    int main()
    {
        //which pig is the biggest
        int num1 = 0;
        int num2 = 0;
        int num3 = 0;
    
        cout << "input pigA' weight" << endl;
        cin >> num1;
    
        cout << "input pigB' weight" << endl;
        cin >> num2;
    
        cout << "input pigC' weight" << endl;
        cin >> num3;
    
        if (num1 >= num2)
        {
            if (num1 >= num3)
                cout << "pigA is the biggest,it's weight is " <<num1<< endl;
            else
                cout << "pigC is the biggest,it's weight is " << num3<<endl;
        }
        else
        {
            if (num2 >= num3)
                cout << "pigB is the biggest,it's weight is " << num2 << endl;
            else
                cout << "pigC is the biggest,it's weight is " << num3 << endl;
        }
    
    
        
        system("pause");
        return 0;
    
    }

    猪谁最重

  • 相关阅读:
    1、如何使用Azure Rest API创建虚拟机
    Ansible---2的Roles使用
    linux下的shell脚本
    生成器 yield和协程
    xshell
    markdown的使用
    加密
    Hbuilder打包app
    尾递归
    jupyter
  • 原文地址:https://www.cnblogs.com/hackerteen/p/12375232.html
Copyright © 2011-2022 走看看