1 条题解

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

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    
    int main(){
    	int x,y,z;
    	cin>>x>>y>>z;
    	if(x >= 86 && y >= 86 && z >= 86 && (x + y + z) / 3 >= 90){
    		cout<<"good";
    	} else{
    		cout<<"sorry";
    	}
    }
    

    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);
    		int a = sc.nextInt();
    		int b = sc.nextInt();
    		int c = sc.nextInt();
    		double s = (double)((a + b + c) / 3);
    		if(s>=90 && a>=86 && b>=86 && c>=86){
    			System.out.println("good");
    		}else{
    			System.out.println("sorry");
    		}
    		sc.close();
    	}
    
    }
    

    Python :

    n = input().split()
    c = int(n[0])
    m = int(n[1])
    e = int(n[2])
    a = (c + m + e) / 3
    if a >= 90 and c >= 86 and m >= 86 and e >= 86:
        print('good')
    else:
        print('sorry')
    
    • 1

    【入门】能不能进入待选名单?

    信息

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