1.1:
#include <iostream>
int main()
{
return 0;
}
1.2:
#include <iostream>
int main()
{
return 1;
}
1.3:
避免使用 using namespace std;
参考using namespace std;会将std名字域暴露出来,会污染名字空间,可能造成名字冲突
#include <iostream>
//using namespace std;
int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}
1.4:
#include <iostream>
int main()
{
std::cout << "input two nums v1, v2:" << std::endl;
int v1 = 0, v2 = 0;
std::cin >> v1 >> v2;
std::cout << "The producet of " << v1 << " and " << v2 << " is " << v1 * v2 << std::endl;
return 0;
}
1:5
#include <iostream>
int main()
{
std::cout << "input two nums v1, v2:" << std::endl;
int v1 = 0, v2 = 0;
std::cin >> v1 >> v2;
std::cout << "The producet of ";
std::cout << v1;
std::cout << " and ";
std::cout << v2;
std::cout << " is ";
std::cout << v1 * v2;
std::cout<< std::endl;
return 0