QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#232083#7062. Prince and PrincessRonbogo#Compile Error//C++20214b2023-10-29 20:37:432023-10-29 20:37:43

Judging History

你现在查看的是最新测评结果

  • [2024-03-10 21:15:22]
  • hack成功,自动添加数据
  • (/hack/570)
  • [2024-03-10 21:10:56]
  • hack成功,自动添加数据
  • (/hack/569)
  • [2023-10-29 20:37:43]
  • 评测
  • [2023-10-29 20:37:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a,b,c;
	cin>>a>>b>>c;
	if (b+c>=a){
		cout<<"NO";
                return 0;
	}
	cout<<"YES"<<'\n';
	else cout<<(b+c)*2+1;
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:11:9: error: ‘else’ without a previous ‘if’
   11 |         else cout<<(b+c)*2+1;
      |         ^~~~