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 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

PREVIOUS NEXT
Code Example
Java :: how to use int 
Java :: kotless scheduled event 
Java :: spring converter in initbinder 
Java :: truncar a 2 decimales java 
Java :: Java TreeMap Example remove() 
Java :: getter and setter in java 
Java :: run java in cmd 
Java :: java :: operator 
Java :: Caused by: java.lang.ClassNotFoundException: 
Java :: query spring boot 
Java :: date to timestamp java 
Java :: java use of super keyword 
Java :: convert long to localdatetime java 
Java :: final class java 
Java :: palindrome in java 
Java :: how to create a boolean list in java 
Java :: javadoc link 
Java :: code to get date and time in android 
Java :: java button with jpg image 
Java :: android cella 20*20 java 
Java :: como pegar o valor de um campo de texto swing 
Sql :: mysql workbench turn off safe mode 
Sql :: ADD COLOUNS CREATED AND UPDATED AT IN MYSQL 
Sql :: Failed to stop mysqld.service: Unit mysqld.service not loaded. 
Sql :: print in pl sql 
Sql :: set default today mysql 
Sql :: sql not start with vowel 
Sql :: show list of users in mysql 
Sql :: mysql select random id from table 
Sql :: mysql first day of month 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =