ASCII Code Quiz

Absolute Zero

Well-known member
  • Mar 31, 2015
    13,071
    1
    16,426
    113
    −273.15°C
    How to solve these kind of questions? Need Answer in step by step.

    Screenshot-2019-01-20-23-05-54.png
     

    NEMISIS

    Well-known member
  • Nov 13, 2013
    11,348
    19,441
    113
    Colombo
    ඕකෙ ඔය දීල තියනවා කියපු චාට් එකත් දාපන් බලන්න උත්තරයක් දෙන්න
     

    imhotep

    Well-known member
  • Mar 29, 2017
    14,823
    8
    35,324
    113
    Just use a ASCII to text converter... pretty simple. NOTE: The given numbers are in HEX.
    Answer - Python IDLE
     
    Last edited:

    amilabanuka

    Well-known member
  • Sep 30, 2006
    7,291
    878
    113
    Thama math hoyanooo....
    Code:
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader sc = new BufferedReader(isr);
        String line = sc.readLine();
        String[] chars = line.split("\\s+");
        StringBuilder sb = new StringBuilder();
        Arrays.stream(chars).map(c-> Integer.parseInt(c,16)).map(i-> (char)i.intValue()).forEach(
            sb::append);
        System.out.println(sb);
      }

    should work. but based on the answers seems they expect you to do it in python
     

    Djice

    Well-known member
  • Jan 17, 2011
    4,408
    3,776
    113
    out of fucked up land
    Easier with python. For python 3.x

    Code:
    x = '50 79 74 68 6F 6E 20 49 44 4C 45'.split(' ')
    
    for i in range(0,len(x)):
       print(chr(int(x[i], 16)), end='')
    print('\n')
     
    Last edited:

    Djice

    Well-known member
  • Jan 17, 2011
    4,408
    3,776
    113
    out of fucked up land
    Code:
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader sc = new BufferedReader(isr);
        String line = sc.readLine();
        String[] chars = line.split("\\s+");
        StringBuilder sb = new StringBuilder();
        Arrays.stream(chars).map(c-> Integer.parseInt(c,16)).map(i-> (char)i.intValue()).forEach(
            sb::append);
        System.out.println(sb);
      }
    should work. but based on the answers seems they expect you to do it in python


    String manipulation is easier in python I guess.