1 solutions
-
0
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
Information
- ID
- 10237
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By