该楼层疑似违规已被系统折叠隐藏此楼查看此楼
我的程序:
#include"stdio.h"
main()
{
longintQQ_num;
charpet_name[20];
chartrue_name[20];
charsex;
intage;
chartelephone_num[20];
charcity[10];
charE_mail[50];
clrscr();
printf("pleaseinputQQnumber:\n");
scanf("%ld",&QQ_num);
printf("pleaseinputpet_name:\n");
scanf("%s",pet_name);
printf("pleaseinputtrue_name:\n");
scanf("%s",true_name);
printf("pleaseinputsex:\n");
scanf("%c",&sex);
printf("pleaseinputage:\n");
scanf("%d",&age);
printf("pleaseinputtelephone_num:\n");
scanf("%s",telephone_num);
printf("pleaseinputcity:\n");
scanf("%s",city);
printf("pleaseinputE_mail:\n");
scanf("%s",E_mail);
printf("*******************************************\n");
printf("Mybestfriend--%s\n",pet_name);
printf("*******************************************\n");
printf("Truename:\t%s\n",true_name);
printf("QQnumber:\t%ld\n",QQ_num);
printf("Sex:\t\t%c\n",sex);
printf("Age:\t\t%d\n",age);
printf("Tel_number:\t%s\n",telephone_num);
printf("City:\t\t%s\n",city);
printf("E_mail:\t\t%s\n",E_mail);
printf("*******************************************\n");
}
如果觉得《c语言 字符型数据如何输入 scanf()函数如何输入字符型数据?》对你有帮助,请点赞、收藏,并留下你的观点哦!