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 / iti tomar

string [] q = new string
[10];//"no","pa","re","ci","vo","mk","xa","ze","bi","so"];
q[0] = "no";
q[1] = "pa";
q[2] = "re";
q[3] = "no";
q[4] = "ci";
q[5] = "vo";
q[6] = "mk";
q[7] = "xa";
q[8] = "ze";
q[9] = "bi";
int alen = q.Length;
//q[0] = "so";
int ln;
string result= string.Empty;
int res;
string str = (string)TextBox1.Text;
ln = str.Length;
if (ln % 2 != 0)
{
Response.Write("Invalid number");
}
else
{

string r;
for (int i = 0; i <= ln-2; i = i + 2)
{
for (int ale = 0; ale < alen; ale++)

if (str.Substring(i,2) == q[ale])
{

result = result + ale.ToString();
//i++;
//i++;
}


}

TextBox2.Text = result;

}

}
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

1814


Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

4446


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.

2143


how to write a program that opens a file and display in reverse order?

2561


Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).

3186






How to Split Strings with Regex in Managed C++ Applications?

3120


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

1788


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

2365


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

2737


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!!!)

3269


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)

2931


write a program that reads a series of strings and prints only those strings begging with letter "b"

2669


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

2395


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2215


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

3953