根据提示,在右侧编辑器中的 Begin-End 之间补充代码。获取标准头文件<limits.h>、<float.h>中涉及到第一关11种数据类型的最大值和最小值并按格式输出,其中浮点型变量用指数形式输出(不保留小数)。格式要求详见测试说明。
时间: 2023-05-12 10:05:30 浏览: 227
#include <stdio.h>
#include <limits.h>
#include <float.h>
int main() {
printf("The maximum and minimum values of the 11 data types:\n");
printf("char: %d to %d\n", CHAR_MIN, CHAR_MAX);
printf("short: %d to %d\n", SHRT_MIN, SHRT_MAX);
printf("int: %d to %d\n", INT_MIN, INT_MAX);
printf("long: %ld to %ld\n", LONG_MIN, LONG_MAX);
printf("long long: %lld to %lld\n", LLONG_MIN, LLONG_MAX);
printf("unsigned char: 0 to %u\n", UCHAR_MAX);
printf("unsigned short: 0 to %u\n", USHRT_MAX);
printf("unsigned int: 0 to %u\n", UINT_MAX);
printf("unsigned long: 0 to %lu\n", ULONG_MAX);
printf("unsigned long long: 0 to %llu\n", ULLONG_MAX);
printf("float: %e to %e\n", FLT_MIN, FLT_MAX);
printf("double: %e to %e\n", DBL_MIN, DBL_MAX);
return 0;
}
阅读全文