summaryrefslogtreecommitdiffstats
path: root/šola/p1/vaje/2023-10-19/Roman.java
diff options
context:
space:
mode:
Diffstat (limited to 'šola/p1/vaje/2023-10-19/Roman.java')
-rw-r--r--šola/p1/vaje/2023-10-19/Roman.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/šola/p1/vaje/2023-10-19/Roman.java b/šola/p1/vaje/2023-10-19/Roman.java
new file mode 100644
index 0000000..d44f633
--- /dev/null
+++ b/šola/p1/vaje/2023-10-19/Roman.java
@@ -0,0 +1,15 @@
+import java.util.*;
+public class Roman {
+ public static void main (String[] args) {
+ Scanner sc = new Scanner(System.in);
+ int p = sc.nextInt();
+ int d = sc.nextInt();
+ int z = sc.nextInt();
+ int dan = 0;
+ while (p > 0 && d > 0) {
+ System.out.println(++dan + ": " + p + " -> " + (p-d > 0 ? p-d : 0));
+ p -= d;
+ d -= z;
+ }
+ }
+}