Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. In stations and airports you often see this type of screen. Have you ever asked yourself how it might be possible to simulate this display on a good old terminal? We have: with ASCII art!
  2.  
  3. ASCII art allows you to represent forms by using characters. To be precise, in our case, these forms are words. For example, the word "MANHATTAN" could be displayed as follows in ASCII art:
  4. # # # ### # # # ### ### # ###
  5. ### # # # # # # # # # # # # # #
  6. ### ### # # ### ### # # ### # #
  7. # # # # # # # # # # # # # # # #
  8. # # # # # # # # # # # # # # # #
  9.  
  10. ​Your mission is to write a program that can display a line of text in ASCII art.
  11.  
  12. INPUT:
  13. Line 1: the width L of a letter represented in ASCII art. All letters are the same width.
  14. Line 2: the height H of a letter represented in ASCII art. All letters are the same height.
  15. Line 3: The line of text T, composed of N ASCII characters.
  16. Following Lines: the string of characters ABCDEFGHIJKLMNOPQRSTUVWXYZ? Represented in ASCII art.
  17.  
  18. OUTPUT:
  19. The text T in ASCII art.
  20. The characters a to z are shown in ASCII art by their equivalent in upper case.
  21. The characters which are not in the intervals [a-z] or [A-Z] will be shown as a question mark in ASCII art.
  22.  
  23. CONSTRAINTS :
  24. 0 < L < 30
  25. 0 < H < 30
  26. 0 < N < 200
  27.  
  28. EXAMPLE 1 :
  29. Input
  30. 4
  31. 5
  32. E
  33. # ## ## ## ### ### ## # # ### ## # # # # # ### # ## # ## ## ### # # # # # # # # # # ### ### # # # # # # # # # # # # # # # # # ### # # # # # # # # # # # # # # # # # # # # # # # # ### ## # # # ## ## # # ### # # ## # ### # # # # ## # # ## # # # # # # ### # # # ## # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ### # # # # # # ## ## ## ### # ## # # ### # # # ### # # # # # # # # # ## # ### # # # # # # ### #
  34. Output
  35. ###
  36. #
  37. ##
  38. #
  39. ###
  40.  
  41. EXAMPLE 2 :
  42. Input
  43. 4
  44. 5
  45. MANHATTAN
  46. # ## ## ## ### ### ## # # ### ## # # # # # ### # ## # ## ## ### # # # # # # # # # # ### ### # # # # # # # # # # # # # # # # # ### # # # # # # # # # # # # # # # # # # # # # # # # ### ## # # # ## ## # # ### # # ## # ### # # # # ## # # ## # # # # # # ### # # # ## # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ### # # # # # # ## ## ## ### # ## # # ### # # # ### # # # # # # # # # ## # ### # # # # # # ### #
  47. Output
  48. # # # ### # # # ### ### # ### ### # # # # # # # # # # # # # # ### ### # # ### ### # # ### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  49.  
  50. Download the files provided in the test script:
  51. Test only one letter: E: in.txt out.txt
  52. Test MANHATTAN: in.txt out.txt
  53. Test ManhAtTan: in.txt out.txt
  54. Test M@NH@TT@N: in.txt out.txt
  55. MANHATTAN with another ASCII representation: in.txt out.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement