Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Uri/beecrowd problem no 1118 solution in Java

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();
        }
        
    }
}
Comment

Uri/Beecrowd problem no - 1150 solution in Java

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);
    }
}
Comment

Uri/Beecrowd problem no 1180 solution in JAVA

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);
    }
}
Comment

Uri/Beecrowd Problem no - 1185 Solution in Java

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);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java convert string with commas to long 
Java :: The create method: 
Java :: google pass api integration in java 
Java :: get selected text in java 
Java :: electron driver window maximize selenium webdriver 
Java :: Number Formating in java by javatpoint 
Java :: spring boot endpoint getting list from the body 
Java :: Bad JNI version returned from JNI_OnLoad in 
Java :: Java array nested equals 
Java :: spigot check if inventory is empty 
Java :: java for loop example 
Java :: string split to list java 
Java :: pyqt tree view 
Java :: open youtube in landscape mode on button click in android progmatically 
Java :: before first method in jdbc 
Java :: TYPE_INT_ARGB 
Java :: buffered reader for big integer 
Java :: what is the import for gogga class java 
Java :: spigot item break 
Java :: concatenar java 
Java :: No Duplicate Key on HashMap 
Java :: navigation view item selected 
Java :: jdbc code 
Java :: android autocompletetextview hashmap 
Java :: set timeout volley android 
Java :: Sling authentication handler example 
Java :: spring boot dto example 
Java :: get material of block bukkit 
Java :: Create hashmap from another maps java 
Java :: java hashset api 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =