标签:blog http os io ar 2014 log size
1.不可读入空格
#include<iostream> #include<stdio.h> using namespace std; int main() { char c[50]; scanf("%s",c); printf("%s",c); return 0; }
2.可以读入空格
用字符 ^ 可以说明补集。把 ^ 字符放为扫描集的第一字符时,构成其它字符组成的命令的补集合,指示 scanf() 只接受未说明的其它字符。
#include<iostream> #include<stdio.h> using namespace std; int main() { char c[50]; scanf("%[^\n]",c);// printf("%s",c); return 0; }
scanf ---------未完待续,布布扣,bubuko.com
标签:blog http os io ar 2014 log size
原文地址:http://www.cnblogs.com/bofengyu/p/3910184.html