public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in).useLocale(Locale.US); double a = s.nextDouble(); double b = s.nextDouble(); double c = s.nextDouble(); double d = s.nextDouble(); double sum = 0.0; if (a > 5) sum += a; if (b > 5) sum += b; if (c > 5) sum += c; if (d > 5) sum += d; System.out.println(sum); } }
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in).useLocale(Locale.US);
double a = s.nextDouble();
double b = s.nextDouble();
double c = s.nextDouble();
double d = s.nextDouble();
double sum = 0.0;
if (a > 5) sum += a;
if (b > 5) sum += b;
if (c > 5) sum += c;
if (d > 5) sum += d;
System.out.println(sum);
}
}
using namespace std;
int main()
{
cout << "Enter month num: " << endl;
unsigned month = 0;
cin >> month;
if (month <= 12 && month >= 1) {
switch (month / 3) {
case 1:
cout << "Spring" << endl;
break;
case 2:
cout << "Summer" << endl;
break;
case 3:
cout << "Autumn" << endl;
break;
default:
cout << "Winter" << endl;
break;
}
} else {
cout << "NO" << endl;
}
return 0;
}