DWITE '07 R5 #1 - I heart you

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, February 2008, Problem 1

Just in time for Valentine's Day 2008, we require an ASCII heart generator. Based on Tony's horrible "artwork" below:

 ~.~ 
`   `
 \./ 

The input will contain 5 lines, integers 0 \le N \le 5

The output will contain 5 sets of 3 lines, 15 in total. Each set will have a specified number of hearts generated. Refer to the sample output for examples.

Note: each heart is made up of 3 lines, 5 characters each. Don't forget to have all the spaces at the end.

Sample Input

1
0
3

Sample Output

 ~.~ 
`   `
 \./ 



 ~.~  ~.~  ~.~ 
`   ``   ``   `
 \./  \./  \./ 

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


Comments