#include <stdio.h>int main(void){ char name[20]; int age; printf("请输入你的姓名:"); scanf("%s",name); printf("请输入你的年龄:"); scanf("%d",&age); printf("你的姓名是:%s\n",name); printf("你的年龄是:%d\n",age); return 0;}
#include<stdio.h>#include<string.h>int main(){ int age; char name[20]; scanf("%s%d",&name,&age); printf("%s:%d",name,age); return 0;}/*输出:wang 20wang:20*/