改正程序中的错误,使其得出正确结果

由用户输入三个数据,算法如下,请改正程序中的错误,使它能得出正确的结果。
用户输入:12a4.2,程序输出:
The input integer is : 12
The input character is : a
The input float is : 4.200000

#include <stdio.h>

main()
{
int i;
char ch;
float f;
printf("Please input:\n");
scanf("%d %c%f", &i, ch, &f);
printf("The input integer is : %d \nThe input character is : %c\n", i, ch);
printf("The input float is : %f", f);
}


#include <stdio.h>

main()
{
    int i;
    char ch;
    float f;
    printf("Please input:\n");
    scanf("%d%c%f", &i, &ch, &f);
    printf("The input integer is : %d \nThe input character is : %c\n", i, ch);
    printf("The input float is : %f", f);
}