c语言scanf输入字符
We have to read tree values: integer, float and then character using only one scanf() function and then print all values in separate lines.
我们只需要使用一个scanf()函数读取树值:整数,浮点数和字符,然后将所有值打印在单独的行中。
Example:
例:
Input:
Input integer, float and character values: 10 2.34 X
Output:
Integer value: 10
Float value: 2.340000
Character value: X
Before moving to the program, please consider the scanf() statement,
移至该程序之前,请考虑scanf()语句,
scanf ("%d%f%*c%c", &ivalue, &fvalue, &cvalue);
Here, %*c is used to skip the character to store character input to the character variable, almost all t