算法笔记 3.2 codeup1935 查找学生信息

#include <stdio.h>
#include <string.h>
const int maxn = 1e3;
struct student{
char id[];
char name[]; //!!!!!!!
char gender[];
int age;
} stu[maxn]; int main(void){
int n;
while(scanf("%d", &n)!=EOF){
for(int i=; i<n; i++){
scanf("%s %s %s %d", &stu[i].id, \
&stu[i].name, &stu[i].gender, &stu[i].age);
}
int m;
scanf("%d", &m);
while(m--){
char test_id[];
scanf("%s", test_id);
int i;
for( i=; i<n; i++){
if(strcmp(stu[i].id, test_id)==){
printf("%s %s %s %d\n", stu[i].id, \
stu[i].name, stu[i].gender, stu[i].age);
break;
}
}
if (i==n) printf("No Answer!\n"); } }
}
上一篇:IntelliJ IDEA—IDEA2018.1激活方式


下一篇:C#使用AutoMapper6.2.2.0进行对象映射