QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#474907#6749. Targethebaodan77777777Compile Error//C++14399b2024-07-13 09:10:092024-07-13 09:10:09

Judging History

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

  • [2024-07-13 09:10:09]
  • 评测
  • [2024-07-13 09:10:09]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 2e3+10;

int main (){
	double a,b;
	cin>>a>>b;
	
	int flag = 0 ;
	while(abs(a-b) > 1e-4 && flag < =50){
			double t1 = a*0.5;
			double t2 = (a-1)*0.5 + 1 ;
			
			if( abs (t1 - b) <= abs(t2 - b)){
				cout<<'1';
				a = t1;
			}else{
				cout<<'2';
				a = t2; 
			}
		
		flag++;
			
		}
		cout<<endl;
	
	
}

詳細信息

answer.code: In function ‘int main()’:
answer.code:12:41: error: expected primary-expression before ‘=’ token
   12 |         while(abs(a-b) > 1e-4 && flag < =50){
      |                                         ^