01: 整型数据类型存储空间大小
#include<cstdio>
int main(){
int a; short b;
printf("%d %d",sizeof(a),sizeof(b));
return 0;
}
02: 浮点型数据类型存储空间大小
#include<cstdio>
int main(){
float a; double b;
printf("%d %d",sizeof(a),sizeof(b));
return 0;
}
03:其他基本数据类型存储空间大小
#include<cstdio>
int main(){
bool a; char b;
printf("%d %d",sizeof(a),sizeof(b));
return 0;
}
04:填空:类型转换1
#include<cstdio>
int main(){
printf("D C");
return 0;
}
05:填空:类型转换2
#include<cstdio>
int main(){
printf("F E");
return 0;
}
06:浮点数向零舍入
#include<cstdio>
int main(){
float a;
scanf("%f",&a);
printf("%d",(int)a);
return 0;
}
07: 打印ASCII码
#include<cstdio>
int main(){
char c;
scanf("%c",&c);
printf("%d",(int)c);
return 0;
}
08:打印字符
#include<cstdio>
int main(){
int a;
scanf("%d",&a);
printf("%c",a);
return 0;
}
09:整型与布尔型的转换
#include<cstdio>
int main(){
int a;
scanf("%d",&a);
bool b = a;
printf("%d",b);
return 0;
}
10:Hello, World!的大小
#include<cstdio>
int main(){
char s[] = "Hello, World!";
printf("%d",sizeof(s));
return 0;
}