Decimal to Roman Numerals

R

Richard Heathfield

Chris Dollin said:
Please don't abbreviate "you" and "people" like that. It makes
your text harder to read for old-timers like what I am. There'
no hortage of vowel on Uenet.

I ympathie. I have the ame problem here. If your order arrive before mine,
would you be o kind a to end a few over by email? It eem that nail mail
doen't work o well in thee circumtance.
 
R

Rethish

oops Sorry!!

thanks for the tip

I would also like to know if there is a way to "disguise" starements
like printf/scanf/define in a similar fashion.

Thanks & regards
Rethish
 
M

mark_bluemel

Chris Dollin said:

would you be o kind a to end a few over by email? It eem that nail mail
doen't work o well in thee circumtance.

I thi a viru? My ytem eem to be afflicted a well...

Or might it be becaue of the tea in my keyboard?
How did that character after the "i" get in there?
 
M

mark_bluemel

I would also like to know if there is a way to "disguise" starements
like printf/scanf/define in a similar fashion.

Look up the IOCC (International Obfuscated C Contest) and you'll find
loads of even better ideas... (for some value of better).

By the way, please don't top-post...
 
C

CBFalconer

Rethish said:
I would like to learn how the below mentioned program works.

how does ??< evaluate to a '(' and how ??( to '['

could u ppl give a short explanation and if possible point me to some
info I can read to get more info on this.

How does 'u ppl' evaluate to coherent English? How does rude
top-posting expect to provoke explanations?

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
 
K

Kenneth Brody

I "" a vowel?
I thi a viru? My ytem eem to be afflicted a well...

Or might it be becaue of the tea in my keyboard?

The "tea" i working jut fine on both of our keyboard. The "e" appear
to be tuck. Perhap a broken LIP connection i dropping what it think
i an xoff?
How did that character after the "i" get in there?

A lip of the finger?

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\pamcop.net | www.fptech.com | <td_diclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:[email protected]>
 
C

Charlton Wilbur

CBM> Plenty of freshmen before you have figured at least that much
CBM> out, or possibly gone on to flip burgers. You still have a
CBM> choice; I suggest you choose wisely.

Oh, no, they don't go on to flip burgers. They transfer to the
business school, where they learn to make my life a living hell.

Charlton
 
C

Clever Monkey

ARMAS said:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIX
I'm through with doing homework in this lifetime.
 
A

ARMAS

ARMAS said:
Make a program that allows the user to input a number and aoutput it's
roman numeral equivalent..... plzzzzzz help....
Ex: 109 output:CIXI wrote a program to do this. I won't give you all of it but I will give
you a framework where you can fill in the algorithm.

#include <stdio.h>
#include <string.h>

/*
Known Roman numerals are:
I=1, V=5, X=10, L=50, C=100, D=500, M=1000
Anything greater is represented by appending '~'s.
Each '~' represents multiplication by 1000.

The length of the input is unlimited.
*/

static const char *rom[] = {
"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX",
"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC",
"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"

};int main(int argc, char **argv)
{
size_t i, j, k, len, m, numdig;
const char *p;

if(argc != 2)
{
fprintf(stderr, "Usage requires one argument: "
"a decimal number to convert.\n");
return 0;
}
numdig = strlen(argv[1]);
for(i = 0; i < numdig; i++)
{
j = numdig - i - 1; /* reverse index */

if(argv[1] < '0' || argv[1] > '9')
{
putchar('\n');
fprintf(stderr, "Invalid digit: %c\n", argv[1]);
return 0;
}

/* Add your algorithm here. How to determine
which element of the 'rom' array to
output?

It's all about mathematics. Think about the
values of:

argv[1] - '0'

j % 3

j % 3 * 10

j / 3
*/

}
putchar('\n');
return 0;

}--
Simon.



Thanks a lot, all i need is little clue... thank you bro....
 
U

user923005

Thanks a lot, all i need is little clue... thank you bro....

{insert clue-by-four joke here}

Actually, you will find that once you actually make the effort yourself
to write such a function (and it's not all that difficult, as evidenced
by the fact that *I* could do it) and post it here, asking for
suggestions and improvements you will find that the entire tone of how
you are treated will change. Trying to browbeat the newsgroup into
free consulting and having the work done for you will result in nothing
but gags at your expense (where's Peter Seebach when you need him!?)
 
F

Flash Gordon

user923005 wrote, On 25/01/07 19:45:
On Jan 25, 2:25 am, "ARMAS" <[email protected]> wrote:

you are treated will change. Trying to browbeat the newsgroup into
free consulting and having the work done for you will result in nothing
but gags at your expense (where's Peter Seebach when you need him!?)

Well, if he is buying the gag and pays my travelling expenses I will
happily gag him. :)
 
D

Dave Thompson

(e-mail address removed) wrote:
The "tea" i working jut fine on both of our keyboard. The "e" appear
to be tuck. Perhap a broken LIP connection i dropping what it think
i an xoff?
#if OT
This is an FGA on comp.protocols.ppp.

1) build and use the original, not some distro's hacked-up version *

2) use asyncmap a0000 to workaround implementations that need to
protect xon/xoff and brokenly don't negotiate it correctly

(* this FGA also applies to comp.protocols.time.ntp)
#endif

/* we now return you to your regularly scheduled c.l.c */

- David.Thompson1 at worldnet.att.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top