大佬救救!是不是我思路有问题?全是REqwq
查看原帖
大佬救救!是不是我思路有问题?全是REqwq
706384
master_chicken楼主2023/7/4 21:59
#include<iostream>
using namespace std;
int main(){
	int L,N,s,zg,zd,fx,fir,las,M,cnt;
	cin>>N;
	int a[]={};
	for(int i=1;i<=N;i++){
		cin>>s;
		a[cnt]=s;
		cnt+=1;
	}
	fx=L%2;
	if(fx=1){
		zd=L/2+1+1;
	}
	else{
		zd=L/2+1;
	}
	fir=a[0];
	las=a[N-1];
	M=L;
	L/=2.0;
	if(fir>L){
		zg=las;
	}
	else if(las<L){
		zg=M-fir;
	}
	else{
		if(M-fir<las){
			zg=las;
		}
		else{
			zg=las;
		}
	}
	cout<<zd<<""<<zg;
}
2023/7/4 21:59
加载中...