Posts

Showing posts from December, 2016

URI Problem 1020 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 8, 2016 * @Time : 10:45:35 PM */ public class Uri1020 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int years = n/365; int months = n%365; int days = months%30; months = months/30; System.out.println(years+" ano(s)\n"+months+" mes(es)\n"+days+" dia(s)"); } }

URI Problem 1019 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 8, 2016 * @Time : 10:23:50 PM */ public class Uri1019 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = 60; int minute = n / x; int second = n % x; int hour = minute / x; minute = minute % x; System.out.println(hour + ":" + minute + ":" + second); } }

URI Problem 1018 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 8, 2016 * @Time : 8:28:02 PM */ public class Uri1018 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if(n > 0 && n < 1000000){ int values[] = {100,50,20,10,5,2,1}; System.out.println(n); for (int i = 0; i < values.length; i++) { System.out.println(n/ values[i]+" nota(s) de R$ "+values[i]+",00"); n = n % values[i]; } } } }

URI Problem 1017 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 8, 2016 * @Time : 8:06:03 PM */ public class Uri1017 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s_time,distance; s_time = sc.nextInt(); distance = sc.nextInt(); double cost = (double)(distance/12.0)*s_time; System.out.printf("%.3f\n",cost); } }

URI Problem 1016 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 8, 2016 * @Time : 7:58:58 PM */ public class Uri1016 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); System.out.println(2*x+" minutos"); } }

URI Problem 1015 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 6, 2016 * @Time : 9:24:33 PM */ public class Uri1015 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x1,y1,x2,y2; x1 = sc.nextDouble(); y1 = sc.nextDouble(); x2 = sc.nextDouble(); y2 = sc.nextDouble(); double distence = Math.sqrt(Math.pow(x2-x1, 2)+Math.pow(y2-y1, 2)); System.out.printf("%.4f\n",distence); } }

URI Problem 1014 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 6, 2016 * @Time : 9:16:40 PM */ public class Uri1014 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); double Y = sc.nextDouble(); double Z = X/Y; System.out.printf("%.3f km/l\n",Z); } }

URI Problem 1013 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 6, 2016 * @Time : 8:55:55 PM */ public class Uri1013 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A,B,C; A = sc.nextInt(); B = sc.nextInt(); C = sc.nextInt(); int d = maior(maior(A,B),C); System.out.println(d+" eh o maior"); } private static int maior(int A, int B) { return (A+B+Math.abs(A-B))/2; } }

URI Problem 1012 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 6, 2016 * @Time : 8:38:17 PM */ public class Uri1012 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double A,B,C; A = sc.nextDouble(); B = sc.nextDouble(); C = sc.nextDouble(); //a) the area of the rectangled triangle that has base A and height C. double area_triangle = 0.5f*A*C; //b) the area of the radius's circle C. (pi = 3.14159) double area_radius = 3.14159*C*C; //c) the area of the trapezium which has A and B by base, and C by height. double area_trapezium = ((A+B)/2)*C; //d) the area of ​​the square that has side B. double area_square = B*B; //e) the area of the rectangle that has sides A and B. double area_rectangle = A*B; System.out.printf(...

URI Problem 1011 Solution in Java

Problem Details  Link Solution: import java.util.Scanner; /** * @Author : Muhammad Harun-Or-Roshid * @E-mail : md.parvez28@gmail.com * @Date : Oct 6, 2016 * @Time : 8:31:10 PM */ public class Uri1011 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double R = sc.nextDouble(); double VOLUME = (4.0/3.0)*3.14159*R*R*R; System.out.printf("VOLUME = %.3f\n",VOLUME); } }

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);     ...

URI Problem 1009 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:17:11 PM  */ public class Uri1009 {     public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         String name;         double f_salary,t_sell,bonus,t_salary;         name = sc.next();         f_salary = sc.nextDouble();         t_sell = sc.nextDouble();         bonus = (t_sell*15)/100;         t_salary = f_salary+bonus;         System.out.printf("TOTAL = R$ %.2f\n",t_salary);     } }

URI Problem 1008 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:08:55 PM  */ public class Uri1008 {     public static void main(String[] args) {         Scanner sc = new Scanner (System.in);         int n,h;         double m,salary;         n = sc.nextInt();         h = sc.nextInt();         m = sc.nextDouble();         salary = h*m;         System.out.println("NUMBER = "+n);         System.out.printf("SALARY = U$ %.2f\n",salary);     } }

URI Problem 1007 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:03:50 PM  */ public class Uri1007 {     public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         int A,B,C,D,DIFERENCA;         A = sc.nextInt();         B = sc.nextInt();         C = sc.nextInt();         D = sc.nextInt();         DIFERENCA = (A*B)-(C*D);         System.out.println("DIFERENCA = "+DIFERENCA);              } }

URI Problem 1006 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   : 8:58:41 PM  */ public class Uri1006 {     public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         double A,B,C;         A = sc.nextDouble();         B = sc.nextDouble();         C = sc.nextDouble();         double MEDIA = (A*2+B*3+C*5)/(2+3+5);         System.out.printf("MEDIA = %.1f\n",MEDIA);     } }

URI Problem 1005 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 : 8:35:11 PM */ public class Uri1005 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double A=sc.nextDouble(); double B =sc.nextDouble(); double MEDIA = (A*3.5+B*7.5)/(3.5+7.5); System.out.printf("MEDIA = %.5f\n",MEDIA); } }

URI Problem 1004 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 : 8:27:43 PM */ public class Uri1004 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int PROD = X*Y; System.out.println("PROD = "+PROD); } }

URI Problem 1003 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 : 8:22:41 PM */ public class Uri1003 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A= sc.nextInt(); int B= sc.nextInt(); int SOMA = A+B; System.out.println("SOMA = "+SOMA); } }

URI Problem 1002 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 : 7:52:48 PM */ public class Uri1002 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double R = sc.nextDouble(); double A = (3.14159*R*R); System.out.printf("A=%.4f\n",A); } }

URI Problem 1001 Solution in Java

Problem Details Link Solution: import java.util.Scanner; /** * * @author ParveZ */ public class Uri1001 { public static void main(String []args){ Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); int X = A+B; System.out.println("X = "+X); } }