-
Notifications
You must be signed in to change notification settings - Fork 0
/
QUANLYSINHVIEN.cpp
58 lines (57 loc) · 963 Bytes
/
QUANLYSINHVIEN.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
#include<stdio.h>
#include<math.h>
#include<string.h>
#define f(i,a,b) for(int i=a;i<=b;i++)
typedef long long ll;
const int N=1e6+3;
struct hs
{
int ma;
char s[200];
float a,b,c;
};
struct hs a[1000];
int main()
{
int i=0;
while(1)
{
int n;
scanf("%d",&n);
if(n==1)
{
int t;
scanf("%d\n",&t);
while(t--)
{
a[i].ma=i+1;
gets(a[i].s);
scanf("%f%f%f\n",&a[i].a,&a[i].b,&a[i].c);
i++;
}
printf("%d\n",i);
}
else if(n==2)
{
int t;
scanf("%d\n",&t);
char f[1000];
gets(f);
strcpy(a[t-1].s,f);
float a1,b1,c1;
scanf("%f%f%f\n",&a1,&b1,&c1);
a[t-1].a=a1;
a[t-1].b=b1;
a[t-1].c=c1;
printf("%d\n",t);
}
else
{
for(int j=i-1;j>=0;j--)
{
printf("%d %s %.1f %.1f %.1f\n",a[j].ma,a[j].s,a[j].a,a[j].b,a[j].c);
}
break;
}
}
}