#include<iostream> #include<vector> #include<iomanip> using namespace std; int main() { int n; while (cin >> n) { cout << fixed << setprecision(0); if (n <= 100000)cout << floor( n / 10); else if (n <= 200000)cout << floor( 10000 + (n - 10000)*0.075); else if (n <= 400000)cout << floor(10000 + 100000 * 0.075 + (n - 200000)*0.05); else if (n <= 600000)cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + (n - 400000)*0.03); else if (n <= 1000000)cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + (n - 600000)*0.015); else cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015 + (n - 1000000)*0.01); cout << endl; } } /* Main.cc: In function 'int main()': Main.cc:9:27: error: 'floor' was not declared in this scope if (n <= 100000)cout << floor( n / 10); ^~~~~ Main.cc:9:27: note: suggested alternative: 'float' if (n <= 100000)cout << floor( n / 10); ^~~~~ float Main.cc:10:32: error: 'floor' was not declared in this scope else if (n <= 200000)cout << floor( 10000 + (n - 10000)*0.075); ^~~~~ Main.cc:10:32: note: suggested alternative: 'float' else if (n <= 200000)cout << floor( 10000 + (n - 10000)*0.075); ^~~~~ float Main.cc:11:32: error: 'floor' was not declared in this scope else if (n <= 400000)cout << floor(10000 + 100000 * 0.075 + (n - 200000)*0.05); ^~~~~ Main.cc:11:32: note: suggested alternative: 'float' else if (n <= 400000)cout << floor(10000 + 100000 * 0.075 + (n - 200000)*0.05); ^~~~~ float Main.cc:12:32: error: 'floor' was not declared in this scope else if (n <= 600000)cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + (n - 400000)*0.03); ^~~~~ Main.cc:12:32: note: suggested alternative: 'float' else if (n <= 600000)cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + (n - 400000)*0.03); ^~~~~ float Main.cc:13:33: error: 'floor' was not declared in this scope else if (n <= 1000000)cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + (n - 600000)*0.015); ^~~~~ Main.cc:13:33: note: suggested alternative: 'float' else if (n <= 1000000)cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + (n - 600000)*0.015); ^~~~~ float Main.cc:14:16: error: 'floor' was not declared in this scope else cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015 + (n - 1000000)*0.01); ^~~~~ Main.cc:14:16: note: suggested alternative: 'float' else cout << floor(10000 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015 + (n - 1000000)*0.01); ^~~~~ float */ |
Double click to view unformatted code.