feat: add luogu questions
This commit is contained in:
45
luogu/P1085.c
Normal file
45
luogu/P1085.c
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user