Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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);
    }
}
Source by www.beecrowd.com.br #
 
PREVIOUS NEXT
Tagged: #problem #solution #JAVA
ADD COMMENT
Topic
Name
7+7 =