#include <iostream> #include <string> #include <algorithm> using namespace std; // 1 red yellow black // 2 int main() { int t; while (cin >> t) { int a[3] = { 0, 3, 6 }; if (t <= 2) cout << a[t] << endl; else { cout << 3 * 2 * (t - 2) << endl; } } return 0; } |
Double click to view unformatted code.