AcWing 657. 选择练习1
原题链接
简单
作者:
STU756
,
2021-01-18 18:11:11
,
所有人可见
,
阅读 333
//C++
#include <iostream>
using namespace std;
int main(){
int a, b, c, d;
cin >> a >> b >> c >>d;
if(b > c && d > a && c + d > a + b && c > 0 && d > 0 && a %2==0) cout << "Valores aceitos"<< endl;
else cout << "Valores nao aceitos" << endl;
return 0;
}
//Java
import java.util.Scanner;
public class Main{
public static void main(String... args){
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
int c = s.nextInt();
int d = s.nextInt();
if((b > c) && (d > a) && ((c+d) > (a+b)) && (c > 0) && (d > 0) && (a % 2== 0)){
System.out.println("Valores aceitos");
}else {
System.out.println("Valores nao aceitos");
}
}
}