We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d52933 commit c8c8e3aCopy full SHA for c8c8e3a
3/1.cpp
@@ -0,0 +1,16 @@
1
+#include <bits/stdc++.h>
2
+
3
+using namespace std;
4
5
+int n = 1260;
6
+int cnt = 0;
7
+int types[4] = {500, 100, 50, 10};
8
9
+int main() {
10
+ for (int i = 0; i < 4; i++) {
11
+ int coin = types[i];
12
+ cnt += n / coin;
13
+ n %= coin;
14
+ }
15
+ cout << cnt << '\n';
16
+}
3/1.java
@@ -0,0 +1,19 @@
+import java.util.Scanner;
+public class Main {
+ public static void main(String[] args) {
+ int n = 1260;
+ int cnt = 0;
+ int[] types = {500, 100, 50, 10};
+ System.out.println(cnt);
17
18
19
0 commit comments