一.cin 1.cin使用空白(空格.制表符和换行符)来确定字符串结束的位置,并且对于换行符,cin会把换行符留在输入队列.cin读取字符串放到数组中,并自动在结尾添加空字符. 例如: ]; cin>>name; 输入:David Smith cin只会把David放到name数组中并添加空字符'\0' cout << "What year was your house built?\n"; int year; cin >> year; // cin…
#include <iostream> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ using namespace std; int main(int argc, char** argv) { ]; int ch; cout<<"please enter a sentence:"<…