Jump to content


Photo

Help with writing a java program?


  • Please log in to reply
No replies to this topic

#1 jeckvishva

jeckvishva

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 26 August 2011 - 05:11 PM

Here is what i was given for a class. I'm so lost, it's very confusing and I get caught up in it. If you could please help I could really use it. Thanks

A decal is an integer where all digit pairs either side of its center add up to 10. For example, 159 is a decal, as 1 + 9 = 10 and 5 + 5 = 10.
The first 11 decals are 5, 19, 28, 37, 46, 55, 64, 73, 82, 91 and 159.

Write a program that, given an integer n (where 0 < n < 2^31), outputs the nth decal.
Your program must be written in Java, C or C++ and terminate within 5 seconds. It should read a single integer from the command line, and output the result on the next line.

Example:

100
9911
_____________

Jenny

Edited by jeckvishva, 01 July 2012 - 09:54 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users