1 solutions
-
0
C :
#include<stdio.h> int main() { double x,y; scanf("%lf%lf",&x,&y); if((x>=60.0&&y<60.0)||(x<60.0&&y>=60.0)) printf("green"); else printf("red"); return 0; }
C++ :
#include <bits/stdc++.h> using namespace std; int main(){ double x,y; cin>>x>>y; if(x >= 60 && y < 60 || x < 60 && y >= 60){ cout<<"green"; }else{ cout<<"red"; } }
Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); double a = sc.nextDouble(); double b = sc.nextDouble(); if((a>=60 && b<60) || (a<60 && b>=60)){ System.out.println("green"); }else{ System.out.println("red"); } sc.close(); } }
Python :
n = input().split() a = float(n[0]) b = float(n[1]) if a >= 60 and b < 60 or a < 60 and b >= 60: print('green') else: print('red')
- 1
Information
- ID
- 10252
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By