Counting in Lojban, an artificial language developed over
the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.

Answer Posted / manoj pathak

#include<iostream.h>
#include<conio.h>

void main()
{
int i=0,k;
char ph,ch[10];
clrscr();
while(ph!='\r')
{
ph=getche();
ch[i]=ph;
i++;
}
cout<<endl<<endl<<endl;
for(k=0;k<i;)
{
if(ch[k]=='n')
{
if(ch[k+1]=='o')
cout<<"0";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}
if(ch[k]=='p')
{
if(ch[k+1]=='a')
cout<<"1";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='r')
{
if(ch[k+1]=='e')
cout<<"2";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='c')
{
if(ch[k+1]=='i')
cout<<"3";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='v')
{
if(ch[k+1]=='o')
cout<<"4";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='m')
{
if(ch[k+1]=='k')
cout<<"5";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='x')
{
if(ch[k+1]=='a')
cout<<"6";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='z')
{
if(ch[k+1]=='e')
cout<<"7";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='b')
{
if(ch[k+1]=='i')
cout<<"8";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

if(ch[k]=='s')
{
if(ch[k+1]=='o')
cout<<"9";
else
{
clrscr();
cout<<"Entered String is not code" ;
break;
}
}

k=k+2;
}
getch();
}

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect

2396


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

2908


Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.

2142


how to diplay a external image of output on winxp by using c & c++,

2930


Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

2188






output for printf("printf");

1977


i don't know about working of nested for loop can any one help me

1788


3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...

4349


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

2930


Code for Two Classes for Doing Gzip in Memory?

2807


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

3952


can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

2736


How can I Draw an ellipse in 3d space and color it by using graph3d?

2130


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2061


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3262