summaryrefslogtreecommitdiffstats
path: root/19/cpp/01-2.cpp
diff options
context:
space:
mode:
Diffstat (limited to '19/cpp/01-2.cpp')
-rw-r--r--19/cpp/01-2.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/19/cpp/01-2.cpp b/19/cpp/01-2.cpp
deleted file mode 100644
index 7ce1a82..0000000
--- a/19/cpp/01-2.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include<iostream>
-
-int getFuel(int mass) {
- int fuel = (mass / 3) - 2;
- if (fuel <= 0) return 0;
- return fuel + getFuel(fuel);
-}
-
-int main() {
- int mass, sum = 0;
- while (std::cin >> mass) sum += getFuel(mass);
- std::cout << sum << std::endl;
-}
-