公式

A - Candy Cookie Law 解説 by en_translator


For beginners

Original proposer: admin

The violation of the law occurs when he has \(A\) or more candies but less than \(B\) cookies. Use an if statement to check if this condition is satisfied, and the problem can be solved.

Sample code (Python)

A,B,C,D=map(int,input().split())
if (C>=A) and (D<B):
  print("Yes")
else:
  print("No")

Sample code (C++)

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

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if((c>=a)&&(d<b)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

投稿日時:
最終更新: