#include<stdio.h>
struct Date{
int year;
int month;
int day;
}data;
int dayofyear(struct Date data){
int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
if(data.year % 4 == 0&&data.year % 100 != 0||data.year % 400 == 0)
days[1] = 29;
else
days[1] = 28;
int i,sum = 0;
for(i = 0;i < data.month - 1;i++){
sum += days[i];
}
return sum + data.day;
}
int main(){
scanf("%d %d %d",&data.year,&data.month,&data.day);
printf("%d",dayofyear(data));
return 0;
}
#include<stdio.h>
struct student{
char number[100];
char name[100];
int grade1;
int grade2;
int grade3;
}stu[100];
void input(struct student stu[],int N){
int i;
for(i = 0;i < N;i++){
scanf("%s %s %d %d %d",stu[i].number,stu[i].name,&stu[i].grade1,&stu[i].grade2,&stu[i].grade3);
}
}
void print(struct student stu[],int N){
int i;
for(i = 0;i < N;i++){
printf("%s,%s,%d,%d,%d",stu[i].number,stu[i].name,stu[i].grade1,stu[i].grade2,stu[i].grade3);
printf("\n");
}
}
int main(){
int N;
scanf("%d",&N);
input(stu,N);
print(stu,N);
return 0;
}
#include<stdio.h>
struct student{
char number[100];
char name[100];
int grade1;
int grade2;
int grade3;
}stu[100];
int main(){
int N;
scanf("%d",&N);
int average[3] = {0,0,0};
int i;
for(i = 0;i < N;i++){
scanf("%s %s %d %d %d",stu[i].number,stu[i].name,&stu[i].grade1,&stu[i].grade2,&stu[i].grade3);
}
for(i = 0;i < N;i++){
average[0] += stu[i].grade1;
average[1] += stu[i].grade2;
average[2] += stu[i].grade3;
}
int sum[100];
for(i = 0;i < N;i++){
sum[i] = stu[i].grade1 + stu[i].grade2 + stu[i].grade3;
}
int maxaverage = sum[0],flag = 0;
for(i = 0;i < N;i++){
if(sum[i] > maxaverage){
maxaverage = sum[i];
flag = i;
}
}
for(i = 0;i < 3;i++){
if(i > 0){
printf(" ");
}
printf("%d",average[i] / N);
}
printf("\n");
printf("%s %s %d %d %d",stu[flag].number,stu[flag].name,stu[flag].grade1,stu[flag].grade2,stu[flag].grade3);
return 0;
}