1.D %3d是三位的以十进制输出的,而空格后面的数据不输入,
并且以浮点数的形式输出,为45.000000
2.c1通过getchar先输入1,然后a1输入2a,但a1是整数型,a无法输入,
a进入到缓冲区,然后c2通过getchar从缓冲区中输入a,最后a2输入345.
3.17 21 11
4. *3.140000 3.142*
#include<stdio.h>
int main()
{
char ch;
printf("输入大写字母:");
ch=getchar();
ch=ch+32;
printf("%c",ch);
return 0;
}
#include<stdio.h>
main()
{
int a;
char b;
float c;
printf("please input an integer:");
scanf("%d",&a);
printf("integer:%d\n",a);
printf("please intput a character:");
scanf("%c",&b);
printf("please input a float number:");
scanf("%f",&c);
printf("float:%f\n",c);
}
#include<stdio.h>
main()
{
int a;
char b;
float c;
printf("please input an integer:");
scanf("%d",&a);
printf("integer:%d\n",a);
getchar();
printf("please intput a character:");
scanf("%c",&b);
printf("character:%c\n",b);
printf("please input a float number:");
scanf("%f",&c);
printf("float:%f\n",c);
}