#include <iostream>
using namespace std;
int main() {
cout<<"Hello, World";
return 0;
}
#include <iostream>
using namespace std;
int main() {
cout << "Enter two numbers:" << endl;
int v1 = 0, v2 = 0;
cin >> v1 >> v2;
std::cout << "The product of" << v1 << "and" << v2
<< " is " << v1 * v2 << endl;
return 0;
}
#include <iostream>
using namespace std;
int main() {
cout << "Enter two numbers:" << endl;
int v1 = 0, v2 = 0;
cin >> v1 >> v2;
cout << "The product of" ;
cout << v1 ;
cout << "and" ;
cout << v2;
cout << " is ";
cout << v1 * v2 ;
cout << endl;
return 0;
}
程序是不合法的,<<的左边对象应该是ostream类,而第二、三行皆为空,因此要在前面加一个std::cout