跳轉至內容

C++ 程式設計/程式碼/變數/示例/兩數相加並列印其和

來自維客教科,面向開放世界的開放書籍
// This program adds two numbers and prints their sum.
#include <iostream>
 
int main()
{
  int a;
  int b;
  int sum;

  sum = a + b;
 
  std::cout << "The sum of " << a << " and " << b << " is " << sum << "\n";
 
  return 0;
}
華夏公益教科書