c++ using namespace::name;

来源:互联网 发布:天猫淘宝内部券优惠群 编辑:程序博客网 时间:2024/03/29 00:08


using namespace::name;


#include <iostream>using std::cin;using std::cout;using std::endl;int main(){cout << "Enter two numbers:"  << endl;        int v1,v2;        cin >> v1 >> v2;        cout << "The sum of " << v1 << " and " << v2 << " is " << v1 + v2 << endl;        return 0;}

输出:

pateo@pateo-B86N53X:~/work/study$ g++ -o main main.ccpateo@pateo-B86N53X:~/work/study$ ./mainEnter two numbers:1 2The sum of 1 and 2 is 3