URI Problem 1060 Solution in Java
Problem Details Link
Solution:
Solution:
import java.util.Scanner;
import java.util.Scanner;
/**
* @Author : Muhammad Harun-Or-Roshid
* @E-mail : md.parvez28@gmail.com
* @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");
}
}
Comments
Post a Comment