C语言:请问我的程序有什么问题?

来源:百度知道 编辑:UC知道 时间:2024/06/23 06:29:31
#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<stdlib.h>
#define N 10
main()
{ int i=0,n=0; char c='\0';
char num=[N][10]={"000555101","000553115","000555109","010551232","010554118"};
char name[N][10]={"赵甲","钱乙","孙丙","李丁","张戊"};
char tel[N][10]={"1111111","2222222","3333333","4444444","5555555"};
char tempnum[10]="",tempname[10]="",temptel[10]="";
system("cls");
printf("添加前记录:\n");
printf(" 学号 姓名 电话号码\n");
while(strcmp(num[i],"")!=0)
{ printf("%23s%15s%15s\n",num[i],name[i],tel[i]);
i++;
}
n=i;
do
{ printf("请输入新记录的学号:");
do
{ gets(tempnum);
}while(

其它的没试,第8行char num=[N][10]多了一个"="

就第八行所了个等于号,其他都对
能运行

去掉第8行多余的=
char num[N][10]={"000555101","000553115","000555109","010551232","010554118"};

这个时候应该和书上一样了

#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<stdlib.h>
#define N 10
void main()
{ int i=0,n=0; char c='\0';
char num[N][10]={"000555101","000553115","000555109","010551232","010554118"}; //多了一个=号
char name[N][10]={"赵甲","钱乙","孙丙","李丁","张戊"};
char tel[N][10]={"1111111","2222222","3333333","4444444","5555555"};
char tempnum[10]="",tempname[10]="",temptel[10]="";
system("cls");
printf("添加前记录:\n");
printf(&qu