URI Problem 1010 Solution in Java

Problem Details Link

Solution:


import java.util.Scanner;

/**
 * @Author : Muhammad Harun-Or-Roshid
 * @E-mail : md.parvez28@gmail.com
 * @Date   : Oct 5, 2016
 * @Time   : 9:39:55 PM
 */
public class Uri1010 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c_1_p,c_2_p,n_1_p,n_2_p;
        double v_1_p,v_2_p,total;
        
        c_1_p = sc.nextInt();
        n_1_p = sc.nextInt();
        v_1_p = sc.nextDouble();
        
        c_2_p = sc.nextInt();
        n_2_p = sc.nextInt();
        v_2_p = sc.nextDouble();
        
        total = (n_1_p*v_1_p)+(n_2_p*v_2_p);
        
        System.out.printf("VALOR A PAGAR: R$ %.2f\n",total);
    }

}

Comments

Popular posts from this blog

URI Problem 1094 Solution in Java

URI Problem 1099 Solution in Java

URI Problem 1012 Solution in Java