import java.util.Scanner;
public class Main{
public static void main (String[] args) {
Scanner obj = new Scanner(System.in);
int limit = 1;
while(limit != 2){
if(limit == 1){
int counter = 0;
float sum = 0;
while(counter != 2){
float num = obj.nextFloat();
if(num >= 0.0 && num <= 10.0){
counter++;
sum += num;
}else{
System.out.println("nota invalida");
}
}
System.out.format("media = %.2f
", (sum/counter));
}
System.out.println("novo calculo (1-sim 2-nao)");
limit = obj.nextInt();
}
}
}
import java.util.Scanner;
public class Main{
public static void main (String[] args) {
Scanner obj = new Scanner(System.in);
int X,Z,counter = 1,c = 0,i;
X = obj.nextInt();
Z = obj.nextInt();
while(Z <= X){
Z = obj.nextInt();
for (i = X; i <= Z; i++){
c += i;
if(c > Z){
break;
}else{
counter++;
}
}
}
System.out.println(counter);
}
}
import java.util.Scanner;
public class Main{
public static void main (String[] args) {
Scanner obj = new Scanner(System.in);
int N,o,i,min = 0,position = 0;
N = obj.nextInt();
int X[] = new int[N+1];
for(i = 0; i < N; i++){
o = obj.nextInt();
X[i] = o;
if(X[i] < 0){
min = X[i];
position = i;
}
}
System.out.println("Menor valor: " + min);
System.out.println("Posicao: " + position);
}
}
import java.util.Scanner;
public class Main{
public static void main (String[] args) {
Scanner obj = new Scanner(System.in);
double M[][] = new double[12][12];
double sum = 0.0;
int i,j,counter = 1;
String O = obj.next();
for(i = 0; i < 12; i++){
for(j = 0; j < 12; j++){
M[i][j] = obj.nextDouble();
}
}
for(i = 10; i >= 0; i--){
for(j = 0; j < counter; j++){
sum += M[i][j];
}
counter++;
}
if(O.equals("S")){
System.out.printf("%.1f
", sum);
}else if(O.equals("M")){
System.out.printf("%.1f
", sum/66.0);
}
}
}