今天笔试的时候遇到一个考察C语言scanf函数的题目 int x; float y; scanf("%3d%f",&x,&y); // input 123456 678 enter and then what's the value of x and y printf("%d %f",x,y); 程序的运行结果是: 123 456.0000000 看来还是自己对scanf函数不是非常了解,如今看看scanf函数的描写叙述例如以下: 格式:既字符串序列…
摘自http://www.cplusplus.com 1. scanf 函数 int scanf ( const char * format, ... ); Parameters format C string that contains a sequence of characters that control how characters extracted from the stream are treated: Whitespace character: the function wil…