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 swap two ASCII numbers?

2442


develop a program to calculate and print body mass index for 200 employees

2208


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?

2907


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


Write a simple encryption program using string function which apply the substitution method.

5531






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.

3389


U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)

2118


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

2042


write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20

3362


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

546


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3431


write a program using virtual function to find the transposing of a square matrix?

2837


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


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

3118


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

3186