ex2_01.cpp

来自「Visual C++ 2005的源代码」· C++ 代码 · 共 23 行

CPP
23
字号
// Ex2_01.cpp
// A Simple Example of a Program
#include <iostream>

using std::cout;
using std::endl;

int main()
{
   int apples, oranges;                     // Declare two integer variables
   int fruit;                               // ...then another one

   apples = 5; oranges = 6;                 // Set initial values
   fruit = apples + oranges;                // Get the total fruit

   cout << endl;                            // Start output on a new line
   cout << "Oranges are not the only fruit... " << endl
        << "- and we have " << fruit << " fruits in all.";
   cout << endl;                            // Output a new line character

   return 0;                                // Exit the program
}

⌨️ 快捷键说明

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