// 2022.3.22
// 隐式类型转换
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// int a = 321;
//
// char ch = a;
//
// printf("ch = %d\n", ch);
//
// system("pause");
// return EXIT_SUCCESS;
//}
//
// 强制类型转换
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// float price = 3.6;
// int weight = 4;
//
// double sum = price * weight;
// printf("价格:%lf\n", sum);
//
// system("panse");
// return EXIT_SUCCESS;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// float price = 3.6;
// int weight = 4;
//
// double sum = (int) price * weight;
// printf("价格:%lf\n", sum);
//
// system("panse");
// return EXIT_SUCCESS;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// int *p = (int *)malloc(100);
// float price = 3.6;
// int weight = 4;
//
// double sum = (int) (price * weight);
// printf("价格:%lf\n", sum);
//
// system("panse");
// return EXIT_SUCCESS;
//}
//
// 类型转换:
// 隐式类型转换:
// 由编译器自动完成。
// 由赋值产生的类型转换
// int r = 3;
// float s = 3.14 * r * r;
// 321 : 256 128 64 32 16 8 4 2 1
// 1 0 1 0 0 0 0 0 1
// char ch = 0 1 0 0 0 0 0 1
//
//
//
// 强制类型转换
// 语法: (目标类型)带转换变量
// (目标类型)带转换表达式
// 大多数用于函数调用期间,实参给形参传值
//
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// int a;
//
// scanf("%d", &a);
//
// if (a > 0)
// {
// printf("a > 0\n");
// }
// else
// {
// printf("a <= 0\n");
// }
// system("panse");
// return EXIT_SUCCESS;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// int score; // 100-90 优 90-70 良好 70-60 及格 <60 差劲
// printf("请输入学生成绩:");
// scanf("%d", &score);
//
// if (score >= 90 && score <= 100)
// {
// printf("优秀\n");
// }
// else if (score < 90 && score >= 70)
// {
// printf("良好\n");
// }
// else if (score < 70 && score >= 60)
// {
// printf("及格\n");
// }
// else if (score < 60)
// {
// printf("差劲");
// }
// system("panse");
// return EXIT_SUCCESS;
//}
//#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//#include <math.h>
//#include <time.h>
//
//int main(void)
//{
// int score; // 100-90 优 90-70 良好 70-60 及格 <60 差劲
// printf("请输入学生成绩:");
// scanf("%d", &score);
//
// if (score >= 90 && score <= 100)
// {
// printf("优秀\n");
// }
// else if (score < 90 && score >= 70)
// {
// printf("良好\n");
// }
// else if (score < 70 && score >= 60)
// {
// printf("及格\n");
// }
// else
// {
// printf("差劲");
// }
// system("panse");
// return EXIT_SUCCESS;
//}
// 2022.3.23