Write a C program that asks for your full name (e.g.Oliver Twist),followed by your student ID num

问题描述:

Write a C program that asks for your full name (e.g.Oliver Twist),followed by your student ID num
Write a C program that asks for your full name (e.g.Oliver Twist),followed by your
student ID number (e.g.8888888) and then prints your full name and student ID number
in the following format:
Your name is:Oliver Twist.
Your student ID is:8888888.
以下是我编的程序
void main()
{
char name[40];
number[40];
printf("What is your full name?\n");
scanf("%s",name);
printf("What is your student ID number?\n" );
scanf("%s",number);
printf("Your full name is:%s\n,Your student ID:%s",name,number);
为啥电脑不能运行?

number 输出的是 %d 是数字 而s 代表的字母 还有一点就是scanf函数 输入时必须是这样的scanf("%s",&number);&必不可少!你也是西利的不?你还交作业了?那个 我今天看课件 才发现 其实 name的那个 输入不应该用scanf 应...