Very Inefficient translator.
I am trying to make a code translator where you would type in a certain number and it would spit out a certain letter. I'm a total newb so I'm guessing this is the most inefficient way of doing this.
Here's the code. If there are bugs don't be surprised.
Code:
#include <iostream.h>
#include <stdio.h>
using namespace std;
int main(){
int translate;
while(translate!=0){
cout<< "translate?";
cin>> translate;
}
if (translate==1){
cout<< "a";
}else{
while(translate!=0){
cout<< "translate?";
cin>> translate;
}
if (translate==2){
cout<< "b";
}else{
while(translate!=0){
cout<< "translate?";
cin>> translate;
}
return 0;
}