混合有间隔输入输出字符

img

同学你好,这个问题涉及到变量的类型,还有scanf,printf这两个格式化输入输出函数,建议多看看基础知识。

#include<stdio.h>
int main(void)
{
    int a;
    char b;
    float c;
    double d;
    scanf("%d %c %f:%lf", &a, &b,&c,&d);
    printf("%d,%c,%f,%lf", a, b,c,d);
    return 0;
}