我想在c中编写一个程序,它取一个学生的年龄和一些成绩并将它们放在一个二维数组中,我输入第一个名字为BigFirstName,最后一个名字为BigLastName,年龄为18岁,数学等级为100,物理等级为100,两者的平均值为100,但它不会像那样打印出来,而是打印出来:
BigFirstBigLastN18
BigLastN18
18
100
100
100
这是我的代码:
#include <stdio.h>
char *Grades[1][6];
int line=0;
int column=0;
int main(void) {
printf("Input Firstname \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Lastname \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input age ");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Math Grade \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Physics Grade \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Average Bettween the two \n");
scanf(" %s",&Grades[line][column]);
column+=1;
int p;
for (p=0;p<7;p++){
printf ("%s\n",&Grades[0][p]);
}
return 0;
}