求救!玄5关!
查看原帖
求救!玄5关!
877753
封禁用户楼主2023/9/18 22:15

RT,代码如下

#include<bits/stdc++.h>
using namespace std;

int main(){
	int T;cin>>T;
	while(T!=0){
		T--;
		int x,y,z;cin>>x>>y>>z; 
		if(x+y-z<0||x+y-z<=x||x+y-z<=z)cout<<-1<<endl;
		else if(x+y==z)cout<<z+1<<endl;
		else cout<<x+y-z<<endl;
	}
	return 0;
}

2023/9/18 22:15
加载中...