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 / sudha
#include<conio.h>
#include<iostream>
int main()
{
char *q[] = {"no", "pa", "re", "ci", "vo", "mk", "xa",
"ze", "bi", "so"};
char *lojban, num[3];
int i,j,k;
cout << "\nEnter the value in lojban\n" ;
cin >> lojban;
i=0;
while(lojban[i++]);
num[2] = '\0';
cout << "The number is \n";
for(j=0; j<i-1; j=j+2)
{
k = 0;
strncpy(num, lojban+j, 2);
do
{
if (k == 11) { cout << "<Invalid Entry>";
break;}
}while(strcmp(num,q[k++]));
if (k != 11)
cout << k-1;
}
getch();
return(0);
}
| Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L
how to diplay a external image of output on winxp by using c & c++,
How to Split Strings with Regex in Managed C++ Applications?
Write a simple encryption program using string function which apply the substitution method.
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.
how to take time as input in the format (12:02:13) from user so that controls remains between these columns?
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?
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).
We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
develop a program to calculate and print body mass index for 200 employees
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
Code for Two Classes for Doing Gzip in Memory?