addsub.cpp

来自「C++ sample code, for the book: C++ blac」· C++ 代码 · 共 14 行

CPP
14
字号
#include <iostream>
using namespace std;
int main()
{
    int operand1 = 5, operand2 = 4, sum, diff;

    sum = operand1 + operand2;
    diff = operand1 - operand2;

    cout << operand1 << " + " << operand2 << " = " << sum << endl;
    cout << operand1 << " - " << operand2 << " = " << diff << endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?