1 条题解

  • 0
    @ 2023-6-11 12:20:43

    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

    信息

    ID
    2593
    时间
    1000ms
    内存
    16MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者