C语言中的进制转换

news2024/10/7 4:30:00

基础概念

进制又称数制,是指用一组固定的符号和统一的规则来表示数值的方法,在C语言中,可以使用不同的前缀来表示不同的进制:

  • 二进制:以0b或0B为前缀(部分编译器可能不支持)
  • 八进制:以0为前缀
  • 十进制:无特殊前缀
  • 十六进制:以0x或0X为前缀

进制转换方法大约分为3种:

  • 二进制、八进制、十六进制转十进制:
    按照各进制的权值展开,然后相加即可得到十进制数。
  • 十进制转二进制、八进制、十六进制:
    采用除基取余法,即用十进制数除以目标进制的基数,然后取整数部分继续除,直到商为0为止,最后将所有余数从后往前排列,即可得到转换后的数。
  • 二进制、八进制、十六进制之间的转换:
    可以先转换为十进制,然后再转换为目标进制,也可以利用它们之间的关系直接转换,如二进制与八进制之间可以每三位二进制数对应一位八进制数进行转换。

在C语言代码编写中,可以使用标准库函数如printf和scanf来进行进制的输入和输出,比如使用%d格式符输出十进制数,%x或%X输出十六进制数(小写或大写),%o输出八进制数。对于二进制的输入和输出,C语言标准库并未提供直接的支持,但可以通过位运算等技巧实现。

进制位二进制八进制十进制十六进制
规则逢二进一逢八进一逢十进一逢十六进一
基数r=2r=8r=10r=16
数符0,10,1,2,3,…70,1,2,3,…90,1,2,3,…15
2 i 2^{i} 2i 8 i 8^{i} 8i 1 0 i 10^{i} 10i 1 6 i 16^{i} 16i
形式表示符BODH

常用的进制转换表:

二进制八进制十进制十六进制
0000000x0
0001110x1
0010220x2
0011330x3
0100440x4
0101550x5
0110660x6
0111770x7
10001080x8
10011190x9
101012100xA
101113110xB
110014120xC
110115130xD
111016140xE
111117150xF

二进制转换

二进制转换为八进制
#include <stdio.h>  
#include <string.h>  
#include <math.h>  
  
void binaryToOctal(char *binary) {  
    int len = strlen(binary);  
    int extraZeros = len % 3; // 计算需要补充的0的个数,让他能被3整除  
    char octal[len / 3 + extraZeros + 1]; // 分配足够的空间来存储八进制数  
    int octalIndex = 0;  
    int binaryIndex = 0;  
      
    // 如果二进制数长度不是3的倍数,则前面补0  
    for (int i = 0; i < extraZeros; i++) {  
        printf("0");  
    }  
      
    while (binaryIndex < len) {  
        int value = 0;  
        for (int i = 0; i < 3 && binaryIndex < len; i++, binaryIndex++) {  
            value = value * 2 + (binary[binaryIndex] - '0');  
        }  
        octal[octalIndex++] = (value < 8) ? (value + '0') : '?'; // ?表示转换错误  
    }  
    octal[octalIndex] = '\0'; // 添加字符串结束符  
    printf("%s\n", octal);  
}  
  
int main() {  
    char binary[] = "1101001"; // 示例
    binaryToOctal(binary); // 调用函数进行转换  
    return 0;  
}

在这里插入图片描述

二进制转换为十进制

使用到了pow()函数,需要添加 -lm 选项来链接libm数学库

gcc test.c -o test -lm
./test
// test.c
#include <stdio.h>  
#include <string.h>  
#include <math.h>  
  
void binaryToOctal(char *binary) {  
    int len = strlen(binary);  
    int extraZeros = len % 3; 
    char octal[len / 3 + extraZeros + 1]; 
    int octalIndex = 0;  
    int binaryIndex = 0;  
      
    for (int i = 0; i < extraZeros; i++) {  
        printf("0");  
    }  
    while (binaryIndex < len) {  
        int value = 0;  
        for (int i = 0; i < 3 && binaryIndex < len; i++, binaryIndex++) {  
            value = value * 2 + (binary[binaryIndex] - '0');  
        }  
        octal[octalIndex++] = (value < 8) ? (value + '0') : '?'; 
    }  
    octal[octalIndex] = '\0'; 
    printf("%s\n", octal);  
}  
  
int main() {  
    char binary[] = "1101001"; 
    binaryToOctal(binary); 
    return 0;  
}

在这里插入图片描述

二进制转换为十六进制
#include <stdio.h>  
#include <string.h>  
#include <math.h>  
  
void binaryToHexadecimal(char *binary) {  
    int length = strlen(binary);  
    int decimal = 0;  
    for (int i = length - 1; i >= 0; i--) {  
        if (binary[i] == '1') {  
            decimal += pow(2, length - 1 - i);  
        }  
    }  
    if (decimal < 16) {  
        if (decimal >= 10) {  
            printf("%c", decimal - 10 + 'A');  
        } else {  
            printf("%d", decimal);  
        }  
    } else {  
        binaryToHexadecimal(binary); 
        int remainder = decimal % 16;  
        if (remainder >= 10) {  
            printf("%c", remainder - 10 + 'A');  
        } else {  
            printf("%d", remainder);  
        }  
    }  
}  
  
int main() {  
    char binary[65]; 
    printf("Enter a binary number: ");  
    scanf("%32s", binary);  
    printf("Hexadecimal representation: ");  
    binaryToHexadecimal(binary);  
    printf("\n");  
    return 0;  
}  
  

在这里插入图片描述

十进制转换

十进制转换为二进制
#include <stdio.h>  
  
void decimalToBinary(int n) {  
    if (n == 0) {  
        return;  
    }  
    decimalToBinary(n / 2);  
    printf("%d", n % 2);  
}  
  
int main() {  
    int decimal;  
    printf("Enter a decimal number: ");  
    scanf("%d", &decimal);  
    printf("Binary representation: ");  
    decimalToBinary(decimal);  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

十进制转换为八进制
#include <stdio.h>  
  
void decimalToOctal(int n) {  
    if (n < 8) {  
        printf("%d", n);  
        return;  
    }  
    decimalToOctal(n / 8);  
    printf("%d", n % 8);  
}  
  
int main() {  
    int decimal;  
    printf("Enter a decimal number: ");  
    scanf("%d", &decimal);  
    printf("Octal representation: ");  
    decimalToOctal(decimal);  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

十进制转换为十六进制
#include <stdio.h>  
  
void decimalToHexadecimal(int n) {  
    if (n < 16) {  
        if (n >= 10) {  
            printf("%c", n - 10 + 'A');  
        } else {  
            printf("%d", n);  
        }  
        return;  
    }  
    decimalToHexadecimal(n / 16);  
    decimalToHexadecimal(n % 16);  
}  
  
int main() {  
    int decimal;  
    printf("Enter a decimal number: ");  
    scanf("%d", &decimal);  
    printf("Hexadecimal representation: ");  
    decimalToHexadecimal(decimal);  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

八进制转换

八进制转换为二进制
#include <stdio.h>  
#include <string.h>  
  
void octalToBinary(char *octal) {  
    int length = strlen(octal);  
    for (int i = 0; i < length; i++) {  
        int digit = octal[i] - '0';  
        switch (digit) {  
            case 7: printf("111"); break;  
            case 6: printf("110"); break;  
            case 5: printf("101"); break;  
            case 4: printf("100"); break;  
            case 3: printf("011"); break;  
            case 2: printf("010"); break;  
            case 1: printf("001"); break;  
            case 0: printf("000"); break;  
        }  
    }  
}  
  
int main() {  
    char octal[33];
    printf("Enter an octal number: ");  
    scanf("%32s", octal);  
    printf("Binary representation: ");  
    octalToBinary(octal);  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

八进制转换为十进制
#include <stdio.h>  
#include <string.h>  
#include <math.h>  
  
long long octalToDecimal(char *octal) {  
    int length = strlen(octal);  
    long long decimal = 0;  
    for (int i = 0; i < length; i++) {  
        int digit = octal[i] - '0';  
        decimal += digit * pow(8, length - 1 - i);  
    }  
    return decimal;  
}  
  
int main() {  
    char octal[33]; 
    printf("Enter an octal number: ");  
    scanf("%32s", octal);  
    long long decimal = octalToDecimal(octal);  
    printf("Decimal representation: %lld\n", decimal);  
    return 0;  
}

在这里插入图片描述

八进制转换为十六进制
#include <stdio.h>  
#include <string.h>  
#include <math.h>  
  
long long octalToDecimal(char *octal) {  
    int length = strlen(octal);  
    long long decimal = 0;  
    for (int i = 0; i < length; i++) {  
        int digit = octal[i] - '0';  
        decimal += digit * pow(8, length - 1 - i);  
    }  
    return decimal;    
}  
  
void decimalToHexadecimal(long long decimal) {    
    if (decimal < 16) {    
        if (decimal >= 10) {     
            printf("%c", (int)(decimal - 10 + 'A'));    
        } else {    
            printf("%lld", decimal);    
        }    
    } else {    
        decimalToHexadecimal(decimal / 16);    
        decimalToHexadecimal(decimal % 16);    
    }    
}
int main() {  
    char octal[33]; 
    printf("Enter an octal number: ");  
    scanf("%32s", octal);  
    long long decimal = octalToDecimal(octal);  
    printf("Hexadecimal representation: ");  
    decimalToHexadecimal(decimal);  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

十六进制转换

十六进制转换为二进制
#include <stdio.h>  
#include <string.h>  
#include <ctype.h>  

void hexadecimalToBinary(char hex) {  
    switch (toupper(hex)) {  
        case '0': printf("0000"); break;  
        case '1': printf("0001"); break;  
        case '2': printf("0010"); break;  
        case '3': printf("0011"); break;  
        case '4': printf("0100"); break;  
        case '5': printf("0101"); break;  
        case '6': printf("0110"); break;  
        case '7': printf("0111"); break;  
        case '8': printf("1000"); break;  
        case '9': printf("1001"); break;  
        case 'A': case 'a': printf("1010"); break;  
        case 'B': case 'b': printf("1011"); break;  
        case 'C': case 'c': printf("1100"); break;  
        case 'D': case 'd': printf("1101"); break;  
        case 'E': case 'e': printf("1110"); break;  
        case 'F': case 'f': printf("1111"); break;  
        default: printf("Invalid hexadecimal digit\n"); break;  
    }  
}  
  
int main() {  
    char hexadecimal[100];  
    printf("Enter a hexadecimal number: ");  
    scanf("%s", hexadecimal);  
    printf("Binary representation: ");  
    for (int i = 0; hexadecimal[i] != '\0'; i++) {  
        hexadecimalToBinary(hexadecimal[i]);  
    }  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

十六进制转换为八进制
#include <stdio.h>  
#include <string.h>  
#include <ctype.h>  
  
int hexadecimalToOctalDigit(char hex) {  
    switch (toupper(hex)) {  
        case '0': return 0;  
        case '1': return 1;  
        case '2': return 2;  
        case '3': return 3;  
        case '4': return 4;  
        case '5': return 5;  
        case '6': return 6;  
        case '7': return 7;  
        case '8': return 10; 
        case '9': return 11;
        case 'A': case 'a': return 12;
        case 'B': case 'b': return 13;
        case 'C': case 'c': return 14; 
        case 'D': case 'd': return 15; 
        case 'E': case 'e': return 16; 
        case 'F': case 'f': return 17; 
        default: return -1; 
    }  
}  
  
void hexadecimalToOctal(const char *hexadecimal) {  
    int length = strlen(hexadecimal);  
    int value = 0;  
    int base = 1;  
    for (int i = length - 1; i >= 0; --i) {  
        int digit = hexadecimalToOctalDigit(hexadecimal[i]);  
        if (digit == -1) {  
            printf("Invalid hexadecimal input\n");  
            return;  
        }  
        value += digit * base;  
        base = base == 1 ? 8 : base * 16;  
        if (base == 128) { 
            printf("%o", value); 
            value = 0; 
            base = 1; 
        }  
    }  
    if (value > 0) { 
        printf("%o", value);  
    }  
}  
  
int main() {  
    char hexadecimal[100];  
    printf("Enter a hexadecimal number: ");  
    scanf("%s", hexadecimal);  
    printf("Octal representation: ");  
    hexadecimalToOctal(hexadecimal);  
    printf("\n");  
    return 0;  
}

在这里插入图片描述

十六进制转换为十进制
#include <stdio.h>  
#include <string.h>  
#include <math.h>  
#include <ctype.h>  
  
long long hexadecimalToDecimal(const char *hexadecimal) {  
    long long decimal = 0;  
    int length = strlen(hexadecimal);  
    for (int i = length - 1, power = 0; i >= 0; --i, ++power) {  
        int digit = 0;  
        char c = toupper(hexadecimal[i]);  
        if (c >= '0' && c <= '9') {  
            digit = c - '0';  
        } else if (c >= 'A' && c <= 'F') {  
            digit = 10 + (c - 'A');  
        } else {  
            printf("Invalid hexadecimal input\n");  
            return -1;  
        }  
        decimal += digit * pow(16, power);  
    }  
    return decimal;  
}  
  
int main() {  
    char hexadecimal[100];  
    printf("Enter a hexadecimal number: ");  
    scanf("%s", hexadecimal);  
    long long decimal = hexadecimalToDecimal(hexadecimal);  
    if (decimal != -1) {  
        printf("Decimal representation: %lld\n", decimal);  
    }  
    return 0;  
}

在这里插入图片描述

字符转换

#include <stdio.h>  
#include <string.h>  
#include <math.h>  
#include <ctype.h>  

 // 十进制
int charToDecimal(char c) {  
    return (int)c;  
}
// 二进制
void charToBinary(char c, char *binary) {  
    int decimal = (int)c;  
    int index = 0;  
    while (decimal > 0) {  
        binary[index++] = (decimal % 2) + '0';  
        decimal /= 2;  
    }  
    binary[index] = '\0'; 
    for (int i = 0; i < index / 2; i++) {  
        char temp = binary[i];  
        binary[i] = binary[index - i - 1];  
        binary[index - i - 1] = temp;  
    }  
}
// 八进制
void charToOctal(char c, char *octal) {  
    int decimal = (int)c;  
    int index = 0;  
    while (decimal > 0) {  
        octal[index++] = (decimal % 8) + '0';  
        decimal /= 8;  
    }  
    octal[index] = '\0'; 
    for (int i = 0; i < index / 2; i++) {  
        char temp = octal[i];  
        octal[i] = octal[index - i - 1];  
        octal[index - i - 1] = temp;  
    }  
}
// 十六进制
void charToHexadecimal(char c, char *hexadecimal) {  
    int decimal = (int)c;  
    int index = 0;  
    while (decimal > 0) {  
        int digit = decimal % 16;  
        if (digit < 10) {  
            hexadecimal[index++] = digit + '0';  
        } else {  
            hexadecimal[index++] = (digit - 10) + 'A';  
        }  
        decimal /= 16;  
    }  
    hexadecimal[index] = '\0'; 
  
    for (int i = 0; i < index / 2; i++) {  
        char temp = hexadecimal[i];  
        hexadecimal[i] = hexadecimal[index - i - 1];  
        hexadecimal[index - i - 1] = temp;  
    }  
}

int main() {  
    char inputChar;  
    printf("Enter a character: ");  
    scanf(" %c", &inputChar); // c前有一个空格,可以跳过任何空白字符  
  

    int decimal = charToDecimal(inputChar);  
    printf("Decimal(十进制): %d\n", decimal);  
  
    char binary[33]; // 32位表示一个字符的ASCII码的二进制形式  
    charToBinary(inputChar, binary);  
    printf("Binary(二进制): %s\n", binary);  

    char octal[12]; // 最多需要11位来表示一个字符的ASCII码的八进制形式  
    charToOctal(inputChar, octal);  
    printf("Octal(八进制): %s\n", octal);  
  
    char hexadecimal[9]; // 最多需要8位来表示一个字符的ASCII码的十六进制形式  
    charToHexadecimal(inputChar, hexadecimal);  
    printf("Hexadecimal(十六进制): %s\n", hexadecimal);  
  
    return 0;  
}

在这里插入图片描述

十六进制在内存操作上的应用

这里给分配一段动态内存,并使用十六进制值初始化这块内存区域,然后打印出内存中的内容

#include <stdio.h>  
#include <stdlib.h>  
#include <string.h>  
  
int main() {  
    // 动态分配一个包含16个字节的内存块  
    unsigned char *memoryBlock = (unsigned char *)malloc(16 * sizeof(unsigned char));  
    if (memoryBlock == NULL) {  
        printf("Memory allocation failed.\n");  
        return 1;  
    }  
  
    // 使用十六进制值初始化内存块  
    unsigned char initValues[] = {0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6, 0x07, 0x18,  
                                  0x29, 0x3A, 0x4B, 0x5C, 0x6D, 0x7E, 0x8F, 0x90};  
      
    // 将初始化值复制到分配的内存块中  
    memcpy(memoryBlock, initValues, 16 * sizeof(unsigned char));  
  
    // 打印内存块中的内容,以十六进制形式展示  
    printf("Memory contents (in hexadecimal):\n");  
    for (int i = 0; i < 16; ++i) {  
        printf("%02X ", memoryBlock[i]);  
        if ((i + 1) % 8 == 0) {  
            printf("\n");  
        }  
    }  
    printf("\n");  
  
    free(memoryBlock);  
    return 0;  
}

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1854868.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

使用Inno Setup 5.5制作软件安装包-精品(二)

上一篇 使用Inno Setup 6制作软件安装包&#xff08;一&#xff09;-CSDN博客 文章简单的说了一下使用Inno Setup 6制作软件安装包&#xff0c;具体有很多的细节&#xff0c;都可以参考上篇的案例。本节说一下&#xff0c;Inno Setup 5 增强版制作软件精品安装包&#xff0c;…

在线随机密码生成工具

对于运维工作&#xff0c;经常需要生产随机密码&#xff0c;这里介绍一款在线生成密码工具&#xff0c;支持配置密码组合类型&#xff0c;如数字、字母大小写、特殊字符等&#xff0c;还能排除某些特殊字符。 在线随机密码生成工具 https://tool.hiofd.com/random-string-gen…

STL迭代器的基础应用

STL迭代器的应用 迭代器的定义方法&#xff1a; 类型作用定义方式正向迭代器正序遍历STL容器容器类名::iterator 迭代器名常量正向迭代器以只读方式正序遍历STL容器容器类名::const_iterator 迭代器名反向迭代器逆序遍历STL容器容器类名::reverse_iterator 迭代器名常量反向迭…

Python的pip切换国内源

&#x1f4da;目录 起因&#xff1a;pip切换国内源&#xff1a;操作永久修改pip配置文件测试永久源配置是否成功 pip其他环境的配置永久源配置 起因&#xff1a; pyCharm安装模块的手出现ModuleNotFoundError: No module named distutils 由于使用pip install distutils下载不了…

ViT:4 Pruning

实时了解业内动态&#xff0c;论文是最好的桥梁&#xff0c;专栏精选论文重点解读热点论文&#xff0c;围绕着行业实践和工程量产。若在某个环节出现卡点&#xff0c;可以回到大模型必备腔调或者LLM背后的基础模型重新阅读。而最新科技&#xff08;Mamba,xLSTM,KAN&#xff09;…

力扣SQL50 查询近30天活跃用户数 datediff(日期1,日期2)

Problem: 1141. 查询近30天活跃用户数 &#x1f468;‍&#x1f3eb; 参考题解 -- 选择活动日期作为天数&#xff0c;计算每天的唯一活跃用户数 select activity_date as day, count(distinct user_id) as active_users from activity -- 从2019年7月27日开始的30天内 where …

手撕RPC——实现简单的RPC调用

手撕RPC——实现简单的RPC调用 一、场景设计二、设计思路2.1 客户端的设计2.2 服务端的设计2.3 通信设计 三、代码实现3.1 定义用户信息3.2 用户服务接口3.3 用户服务接口实现3.4 定义消息格式3.5 实现动态代理类3.6 封装信息传输类3.7 定义服务端Server接口3.8 实现RpcServer接…

【ATU Book - i.MX8系列 - OS】NXP i.MX Linux Desktop (Ubuntu) BSP 开发环境架设

一、概述 谈论嵌入式系统的开发环境&#xff0c;不得不提起近年来相当实用的 Yocto 建构工具。此工具拥有极为灵活的平台扩展性&#xff0c;广泛的软体套件与社群支持、多平台支援整合性&#xff0c;能够满足开发者特定需求和多种热门的嵌入式系统架设&#xff0c;已成为当今顶…

css如何动态累计数字?

导读&#xff1a;css如何动态累计数字&#xff1f;用于章节目录的序列数生成&#xff0c;用css的计数器实现起来比 js方式更简单&#xff01; 伪元素 ::after ::before伪元素设置content 可以在元素的首部和尾部添加内容&#xff0c;我们要在元素的首部添加序列号&#xff0c…

Cesium如何高性能的实现上万条道路的流光穿梭效果

大家好&#xff0c;我是日拱一卒的攻城师不浪&#xff0c;专注可视化、数字孪生、前端、nodejs、AI学习、GIS等学习沉淀&#xff0c;这是2024年输出的第20/100篇文章&#xff1b; 前言 在智慧城市的项目中&#xff0c;经常会碰到这样一个需求&#xff1a;领导要求将全市的道路…

支持WebDav的网盘infiniCloud(静读天下,Zotero 等挂载)

前言 WebDav是一种基于HTTP的协议&#xff0c;允许用户在Web上直接编辑和管理文件&#xff0c;如复制、移动、删除等。 尽管有一些网盘支持WebDav&#xff0c;但其中大部分都有较多的使用限制。这些限制可能包括&#xff1a;上传文件的大小限制、存储空间的限制、下载速度的限…

借助AI快速提高英语听力:如何获得适合自己的听力材料?

英语听力是英语学习中的一个重要组成部分&#xff0c;它对于提高语言理解和交流能力至关重要。可理解性学习&#xff08;comprehensible input&#xff09;是语言习得理论中的一个概念&#xff0c;由语言学家Stephen Krashen提出&#xff0c;指的是学习者在理解语言输入的同时&…

残差网络中的基础结构——残差模块

残差网络的思想 随着网络深度的增加&#xff0c;网络能获取的信息量随之增加&#xff0c;而且提取的特征更加丰富。然而在残差结构提出之前&#xff0c;实验证明&#xff0c;随着网络层数的增加&#xff0c;模型的准确率起初会不断提高&#xff0c;直至达到最大饱和值。然后&a…

194.回溯算法:组合总和||(力扣)

代码解决 class Solution { public:vector<int> res; // 当前组合的临时存储vector<vector<int>> result; // 存储所有符合条件的组合// 回溯函数void backtracing(vector<int>& candidates, int target, int flag, int index, vector<bool>…

不需要new关键字创建实例?jQuery是如何做到的

这篇文章是jQuery源码专栏的开篇文章了&#xff0c;有人会问为什么都2024年了&#xff0c; 还要研究一个已经过时的框架呢&#xff0c;其实&#xff0c;jQuery对比vue和react这种响应式框架&#xff0c;其在使用上算是过时的&#xff0c;毕竟直接操作DOM远不如操作虚拟DOM来的方…

力扣SQL50 游戏玩法分析 IV 子查询

Problem: 550. 游戏玩法分析 IV &#x1f468;‍&#x1f3eb; 参考题解 这个SQL查询的目的是计算每个玩家在登录后的第二天参与活动的比例。查询使用了子查询和左连接来实现这一目的。下面是查询的详细解释&#xff0c;包括每个部分的作用和注释&#xff1a; -- 计算每个玩…

LLm与微调入门

前言 两种 Finetune 范式 增量预训练微调 使用场景&#xff1a;让基座模型学习到一些新知识&#xff0c;如某个垂类领域的常识 训练数据&#xff1a;文章、书籍、代码等 指令跟随微调 使用场景&#xff1a;让模型学会对话模板&#xff0c;根据人类指令进行对话 训练数据…

C++第二学期期末考试选择题题库(qlu题库,自用)

又到了期末周&#xff0c;突击一下c吧— 第一次实验 1、已知学生记录的定义为&#xff1a; struct student { int no; char name[20]; char sex; struct 注意年月日都是结构体&#xff0c;不是student里面的 { int year; int month; …

数据分析BI仪表盘搭建

BI仪表盘搭建六个原则&#xff1a; 1.仪表盘搭建符合业务的阅读&#xff0c;思考和操作逻辑。 2.明确仪表盘主题&#xff0c;你的用户对什么感兴趣。 普通业务人员&#xff1a;销售&#xff1a;注册&#xff0c;激活&#xff0c;成交投放&#xff1a;消耗&#xff0c;转化率…

构建下一代数据解决方案:SingleStore、MinIO 和现代 Datalake 堆栈

SingleStore 是专为数据密集型工作负载而设计的云原生数据库。它是一个分布式关系 SQL 数据库管理系统&#xff0c;支持 ANSI SQL&#xff0c;并因其在数据引入、事务处理和查询处理方面的速度而受到认可。SingleStore 可以存储关系、JSON、图形和时间序列数据&#xff0c;以满…