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
develop a program to calculate and print body mass index for 200 employees
what mean void creat_object?in public class in this code class A{ public: int x; A(){ cout << endl<< "Constructor A";} ~A(){ cout << endl<< "Destructor A, x is\t"<< x;} }; void create_object(); void main() { A a; a.x=10; { A c; c.x=20; } create_object(); } void create_object() { A b; b.x=30; }
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
Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).
How to swap two ASCII numbers?
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
how to diplay a external image of output on winxp by using c & c++,
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
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
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
Code for Method of Handling Factorials of Any Size?
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)
How to Split Strings with Regex in Managed C++ Applications?