摘要:
Cinput functiongets /printf;; char a[23]; gets(a); // 不能写成a =gets();getchar /printf;; char a; a = getchar(); //不能写成 getchar(a); -------------------------------------C++ input functioncin; //cout endl ... 阅读全文
摘要:
1、cin>> 用法1:最基本,也是最常用的用法,输入一个数字:#include <iostream>using namespace std;main (){int a,b;cin>>a>>b;cout<<a+b<<endl;}输入:2[回车]3[回车]输出:5用法2:接受一个字符串,遇“空格”、&ld... 阅读全文
摘要:
getline() // 接受一个字符串,可以接收空格并输出,需包含“#include<string>”#include<iostream>#include<string>using namespace std;main (){string str;getline(cin,str);cout<<str<<endl;... 阅读全文
摘要:
-----------------------------getch(), getche() 不包含在标准C中getch() 与 getche()要引用 conin.h头文件getch()无返回显示,getche()有返回显示------------------------------getchar()包含在标准C中// getchar()函数等待输入直到按回车才结束,回车前的所有输入字符都会... 阅读全文