-
HackerRank.com Practice > C++ > Introduction > Conditional Statementshackerrank.com 2020. 4. 16. 20:27728x90
#include <string> #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cin.ignore(numeric_limits<streamsize>::max(), '\n'); string ss[] = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "Greater than 9"}; n = (n>9)? 10: n; cout << ss[n]; return 0; }
728x90'hackerrank.com' 카테고리의 다른 글
HackerRank.com Practice > C++ > Introduction > Functions (0) 2020.04.17 HackerRank.com Practice > C++ > Introduction > For Loop (0) 2020.04.17 HackerRank.com Practice > C++ > Introduction > Basic Data Types (0) 2020.04.16 HackerRank.com Practice > C++Introduction > Input and Output (0) 2020.04.16 HackerRank.com Practice > C++ > Introduction > Say "Hello, World!" With C++ (0) 2020.04.16