c++ primer学习指导(3)--1.2初识输入输出

源码在add.cpp,内容如下

 1 int main()
 2 {
 3     // prompt user to enter two numbers
 4     std::cout << "Enter two numbers:" << std::endl; 
 5     int v1 = 0, v2 = 0;
 6     std::cin >> v1 >> v2;   
 7     std::cout << "The sum of " << v1 << " and " << v2
 8               << " is " << v1 + v2 << std::endl;
 9     return 0;
10 }

编译运行:

原文地址:https://www.cnblogs.com/niao-ge/p/12145676.html