更新了许多

This commit is contained in:
OhFengGO
2023-08-23 21:52:51 +08:00
parent 971a1d91d6
commit fc324f936b
197 changed files with 6500 additions and 0 deletions

32
最美苹果数.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <bits/stdc++.h>
using namespace std;
int main(){
int N1;
int N2;
int N3;
int Number;
cin >>N1>>N2>>N3;
if(N3<=2 || N2<=1 || N1<=0){
cout <<"-1";
}
else{
if(N2>=N3){
Number=N2-N3+1;
if(N1>=N3-1){
Number=N2-N3+1+N1-N3+2;
}
else{
cout <<Number;
}
}
else{
if(N1>=N2){
Number=N1-N2+1;
}
else{
cout <<Number;
}
}
}
return 0;
}