本答案由Visual Studio 2017编写
练习1.3
#include <iostream>
using namespace std;
int main() {
cout << "Hello,World" << endl;
return 0;
}
练习1.4
#include <iostream>
using namespace std;
int main() {
int n1, n2;
cin >> n1 >> n2;
cout <<"The product of "<<n1<<" and "<<n2<<" is "<< n1*n2 << endl;
return 0;
}
练习1.6
不合法。
使用一个cout进行输入时语句中不能使用;来换行。去掉第一句和第二句的分号,改为如下:
std::cout << "The sum of " << v1
<< " and " << v2
<< " is " << v1 + v2 << std::endl;