/*****************************************************************************
*   程序名:双数计算器                                                         *
*   功  能:运用输入和输出流运算符,分别对两个数进行加、减、乘、除的运算并输出结果  *
*****************************************************************************/
#include<iostream>
using namespace std;
int main()
{
    float num1, num2;
    cout << "Please input two numbers:";
    cin >> num1 >> num2;
    cout << "Addition result is:" << (num1 + num2) << endl;
    cout << "Subtraction result is:" << (num1 - num2) << endl;
    cout << "Multiplication result is:" << (num1 * num2) << endl;
    cout << "Division result is:" << (num1 / num2) << endl;
    system("pause");
    return 0;
}
Last modification:December 5th, 2018 at 07:05 pm
如果觉得我的文章对您有帮助,请随意赞赏:)