Advertisement
balacitupi

1231231123erterterterterter

Mar 4th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace tsk3
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var numeralSys = 9;
  14. var digits = new[] { "LON+", "VK-", "*ACAD", "^MIM", "ERIK|", "SEY&", "EMY>>", "/TEL", "<<DON" };
  15. ulong numberIndec = ulong.Parse(Console.ReadLine());
  16. StringBuilder result = new StringBuilder();
  17. do
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. {
  26. int digitIn9th = (int)(numberIndec % (ulong)numeralSys);
  27. result.Insert(0,digits[digitIn9th]);
  28. numberIndec /= (ulong)numeralSys;
  29. }
  30. while
  31.  
  32. (numberIndec > 0);
  33.  
  34. Console.WriteLine(result.ToString());
  35.  
  36. }
  37. }
  38. }
  39.  
  40.  
  41. //Problem 1 – TRES4 Numbers
  42. The largest planet in the known universe is TRES4. It is located in the constellation Hercules. For some strange coincidence the TRES4nians (the creatures that live on TRES4) use some of the letters in the Latin alphabet in their numeral system. What is even more surprising the digits in this numeral system, called TRESNUM4, also contain some operators that we use in programming here on Earth. All digits in TRESNUM4 with their decimal representations are:
  43.  
  44. LON+ 0
  45. VK- 1
  46. *ACAD 2
  47. ^MIM 3
  48. ERIK| 4
  49. SEY& 5
  50. EMY>> 6
  51. /TEL 7
  52. <<DON 8
  53. A long time ago, Christopher, an eleven years old kid from Arizona, USA, who was extremely good at physics and astronomy, sent a message with the integer coordinates of the Sun and the Earth to the constellation Hercules. Earlier today the message has been received by the TRES4nians. The problem is they don’t know how to convert numbers from decimal numeral system to numbers in TRESNUM4 numeral system and you, like the wisest TRES4nian, must help them by writing a computer program.
  54. Input
  55. The input data consists of a single line – the integer number sent to the TRES4 planet.
  56. The input data will always be valid and in the described format. There is no need to check it explicitly.
  57. Output
  58. The output data consists of a single line holding the TRESNUM4 number representation of the integer number.
  59. Constraints
  60. The input number will be between 0 and 18 000 000 000 000 000 000.
  61. Allowed working time for your program: 0.1 seconds.
  62. Allowed memory: 16 MB.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement