aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2017-11-18 23:20:16 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2017-11-18 23:20:16 +0100
commitcd497f864e490023bc321566eed4bcd94c4b7bd0 (patch)
tree5a33cc8ef87677a0cc554cd3e108bb50724e1f96
parentf0017b2fa642ed8ed65550a8162e4ed19b325b6e (diff)
downloadAceptaElReto-cd497f864e490023bc321566eed4bcd94c4b7bd0.tar.gz
AceptaElReto-cd497f864e490023bc321566eed4bcd94c4b7bd0.zip
Problema 368 resuelto.
-rw-r--r--AceptaElReto/src/problemas/Problema368.java25
-rw-r--r--AceptaElReto/src/problemas/Problema370.java1
2 files changed, 26 insertions, 0 deletions
diff --git a/AceptaElReto/src/problemas/Problema368.java b/AceptaElReto/src/problemas/Problema368.java
new file mode 100644
index 0000000..8a7f418
--- /dev/null
+++ b/AceptaElReto/src/problemas/Problema368.java
@@ -0,0 +1,25 @@
+package problemas;
+
+public class Problema368 {
+
+ static java.util.Scanner in;
+
+ public static void main(String args[]) {
+ in = new java.util.Scanner(System.in);
+
+ int huevos = in.nextInt();
+ int olla = in.nextInt();
+ while ( huevos != 0 ) {
+ System.out.println(casoDePrueba(huevos, olla));
+ huevos = in.nextInt();
+ olla = in.nextInt();
+ }
+ }
+
+ public static int casoDePrueba(int huevos, int olla) {
+ if ( huevos % olla != 0 ) {
+ return ( huevos / olla + 1 ) * 10;
+ }
+ return ( huevos / olla ) * 10;
+ }
+}
diff --git a/AceptaElReto/src/problemas/Problema370.java b/AceptaElReto/src/problemas/Problema370.java
index 48c5dce..1673b29 100644
--- a/AceptaElReto/src/problemas/Problema370.java
+++ b/AceptaElReto/src/problemas/Problema370.java
@@ -13,6 +13,7 @@ public class Problema370 {
System.out.println(casoDePrueba(llave));
}
}
+
public static String casoDePrueba(String llave) {
int calibreUno = Integer.parseInt(llave.substring(0, llave.indexOf('-')));
int calibreDos = Integer.parseInt(llave.substring(llave.indexOf('-') + 1));