-
Notifications
You must be signed in to change notification settings - Fork 1
/
w10_출석부.cpp
74 lines (63 loc) · 835 Bytes
/
w10_출석부.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
#include <cstdio>
#include <string>
#include <utility>
using namespace std;
struct Student{
int id;
string name;
int c;
int a;
};
int main() {
int i,c,a;
char s[20];
string name;
Student stud[10000];
int test=0;
int n;
int m;
string t;
cin>>n;
for(int i=0;i<n;i++){
scanf("%d %s %d %d",&i,s,&c,&a);
stud[i].id=i;
stud[i].name=s;
stud[i].c=c;
stud[i].a=a;
}
cin>>m;
for(int i=0;i<m;i++){
cin>>t;
test=0;
for(int j=0;j<n;j++){
name=stud[i].name;
if(name==t){
printf("%d ",stud[i].id);
printf(" %d %d\n",stud[i].c,stud[i].a);
test=1;
continue;
}
}
if(test==0){
printf("%d",-1);
}
}
}
/*
5
2145 Evan 10 0
1954 Adela 8 2
7452 Chris 9 1
2465 Cygnus 2 8
8613 Lucid 5 5
2
Adela
Lucid
2
1657 Damian 1 2
5476 Bead 5 6
2
Damian
James
*/