feat: add luogu questions

This commit is contained in:
2023-10-03 17:51:53 +08:00
parent c9fbb1e74a
commit 261c0e95b9
9 changed files with 230 additions and 0 deletions

45
luogu/P1085.c Normal file
View File

@@ -0,0 +1,45 @@
/*
* P1085.c
*
* Copyright 2022 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <2251250136@qq.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
#include <stdio.h>
int main(int argc, char **argv)
{
int a[7][2];
int max = 0;
for (int i = 0; i < 7; i++){
scanf("%d%d",&a[i][0],&a[i][1]);
}
for (int i = 0; i < 7; i++){
if((a[max][0]+a[max][1]) < (a[i][0]+a[i][1]) && (a[i][0]+a[i][1]>8)){
max = i;
}
}
if(a[0][0]+a[0][1]<8&&a[1][0]+a[1][1]<8&&a[2][0]+a[2][1]<8&&a[3][0]+a[3][1]<8&&a[4][0]+a[4][1]<8&&a[5][0]+a[5][1]<8&&a[6][0]+a[6][1]<8){
max=-1;
}
printf("%d",max+1);
return 0;
}