跳转至内容

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;
}
华夏公益教科书