预处理指令using namespace std
来源:互联网 发布:手机屏幕宠物软件 编辑:程序博客网 时间:2024/06/05 09:42
要使用cin和cout,必须使用预处理指令
#include<iostream>
如果没有using namespace std,标识符应为std::cin和std::cout
#include<iostream>#include<stdio.h>using namespace std;int main(){cout << "Enter two numbers:" << endl;int v1, v2;cin >> v1 >> v2;cout << "The sum of" << v1 << "and" << v2<< "is" << v1 + v2 <<endl;system("pause");return 0;}或者
#include<iostream> #include<stdio.h> int main() { std::cout << "Enter two numbers:" << std::endl; int v1, v2; std::cin >> v1 >> v2; std::cout << "The sum of" << v1 << "and" << v2 << "is" << v1 + v2 << std::endl; system("pause"); return 0; }
阅读全文
0 0
- 预处理指令using namespace std
- using namespace std
- using namespace std
- using namespace std
- 缺少using namespace std;
- using namespace std;问题
- using namespace std 是什么意思?
- using namespace std
- using namespace std
- using namespace std
- using namespace std
- using namespace std
- using namespace std 详解
- C++ using namespace std
- using namespace std
- using namespace std 相关
- using namespace std(转)
- using namespace std
- MyBatis和Hibernate相比,优势在哪里?
- java之静态代理
- linux安装jdk1.8
- 会场安排问题
- 【bozj2287】【[POJ Challenge]消失之物】维护多值递推
- 预处理指令using namespace std
- java中static关键字的解析说明
- Hadoop基于Linux-CentOS7安装-安装Hadoop
- java 中成员变量与静态变量的区别
- CF 869 A. The Artful Expedient(异或)
- windows下利用cocos studio打包前准备
- 如何理解java.io.Serializable接口
- 第八章
- H5的动画