Logo
(追記) (追記ここまで)

26554번 - Draw 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB68352644.828%

문제

You’re bored during class one day. Instead of drawing shapes all over your paper, you decide to write a program that will do it for you! Write a program that, when given the type of shape and the dimensions, will draw the specified shape. The program will also be able to either leave the shape empty or fill it in. The shape names and examples are shown below.

rectangle
##
##
###
# #
###
###
###
###
left triangle
#
##
###
#
##
# #
####
#
##
###
####
right triangle
 #
 ##
###
 #
 ##
 # #
####
 #
 ##
 ###
####
diamond
 #
# #
 #
 # 
 # #
# #
 # #
 #
 #
 ###
#####
 ###
 #

The rectangle can be any number of rows and columns. The left triangle, the right triangle, and the diamond will always have the same number of rows and columns. For the diamond, the number of rows and columns will always be odd.

입력

The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will be one line that starts with the shape name. If the shape is a rectangle, the name will be followed by two integers, r and c, representing the number of rows and columns respectively. If not, then the shape name will be followed by one integer, denoting the number of both rows and columns. The line will end with either y or n, y meaning that the shape is filled in and n meaning that the shape is empty.

출력

You will print the specified shape of the specified size, either filled or empty as denoted by the letter at the end of the line. There are examples of the shapes in the table above. There are no lines of whitespace between data sets.

제한

예제 입력 1

3
rectangle 3 5 n
right triangle 4 n
diamond 7 y

예제 출력 1

#####
# #
#####
 #
 ##
 # #
####
 #
 ###
 #####
#######
 #####
 ###
 #

힌트

출처

School > PLU High School Programming Contest > PLU 2018 > Novice 12번

School > PLU High School Programming Contest > PLU 2018 > Advanced 12번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /