2.1
#include<stdio.h>
int main()
{
int a;
short b;
printf("%d %d",sizeof(a),sizeof(b));
}
2.2
#include<stdio.h>
#include<stdbool.h> //定义bool型变量必须的头文件
int main()
{
float a;
double b;
printf("%d ",sizeof(a));
printf("%d",sizeof(b));
}
1.3
#include<stdio.h>
#include<stdbool.h>
int main()
{
bool a;
char b;
printf("%d ",sizeof(a));
printf("%d",sizeof(b));
}
2.4
#include<stdio.h>
int main()
{
printf("D C");
}
2.5
#include<stdio.h>
int main()
{
printf("F E");
}
2.6
#include<stdio.h>
int main()
{
float x;
scanf("%f",&x);
printf("%d",(int)x);
}
2.7
#include<stdio.h>
int main()
{
char x;
scanf("%c",&x);
printf("%d",x);
}
2.8
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
printf("%c",a);
}
2.9
#include<stdio.h>
#include<stdbool.h>
int main()
{
int get;
bool x;
scanf("%d",&get);
x=get;
printf("%d",x);
}
2.10
#include<stdio.h>
int main()
{
printf("%d\n",sizeof("Hello, World!"));
}