CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Yui Hong Tsang
#include <iostream>
#include <string>
using namespace std;
int main() {
string input;
getline(cin,input);
int n = input.size();
for(int i = 0; i < n; i++)
{
switch(input[i])
{
case '1':
if(input[i+1]==' '){
cout << "one";}
else
{cout << "ten"; i++;}
break;
case '2':
cout << "two";
break;
case '3':
cout << "three";
break;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run