URI Problem (Positive Numbers) 1060 Solution in Java

Problem Solving, URI

URI Problem (Positive Numbers) 1060:
Positive Numbers is a basic problem on URI online judge for novice problem solver.
You can find details on this Link.

import java.util.Scanner;

/**
 * @Author : Muhammad Harun-Or-Roshid
 * @Date : Oct 14, 2016
 * @Time : 7:19:01 PM
 */
public class Uri1060 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double values[] = new double[6];
        int count = 0;
        for (int i = 0; i < values.length; i++) {
            values[i] = sc.nextDouble();
            if(values[i]>0){
                count++;
            }
        }
        System.out.println(count+" valores positivos");
    }

}

0 Comments

You may find interest following article