677 - CS135501_I2P2014_extra_Lab2 Scoreboard

Time

2015/01/05 15:30:00 2015/01/05 17:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
10100 Bell Triangle
10152 wave
10171 Chinese Words

10100 - Bell Triangle   

Description

As described in Wikipedia,
Bell triangle is a triangle of numbers analogous to Pascal's triangle, whose values count partitions of a set in which a given element is the largest singleton.

Construction of the Bell triangle:

Bell(1,1) = 1
Bell(n,1) = Bell(n-1,n-1), for n = 2, 3, 4, ...
Bell(n,k) = Bell(n-1,k-1) + Bell(n,k-1), for n = 2, 3, ... and k = 2, 3, ...

Or you can do step by step as follow:



Given a postive integer N,
display the Bell’s triangle from row 1 to row N.
Use '%11d' to print each row element and print a newline at the end of each row.

Input

Given a postive number N and the range of N is 1 ≦ N ≦ 15.

Output

Print the Bell triangle from row 1 to row N,
and all elements of Bell triangle are smaller than 231-1.

Sample Input  Download

Sample Output  Download

Tags




Discuss




10152 - wave   

Description

Give a character C , a length L and number N.

Print out a wave is build by the character C and maximum length L.
Total print N wave.

Input

Three input, C, L, N.
C means character.
L means length, 1
N means number, 1

Output

Print out a wave is build by the character C and maximum length L N times.
Note: There is no newline at last line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




10171 - Chinese Words   

Description

In traditional chinese, people write words from right top to left down.

Now  you have a grid paper which contains N words. N will not bigger than 4096.

The size of the grid paper is H * W (height * width). The size of H and W are between 1 to 64.

Each grid only write a character.

You have to implement two parts :

  1. You have to rewrite an article from right top to left down.
  2. If the word is a space, namely ' ',  then you have to skip it.

[Note]The blanks at the left down should be filled with ' '.

Hint:

Input

There are 3 input.

1. The number of characters (N) in the article. 0<=N<=4096

2. The size of the grid paper : H (height) and W (width).  1<=H<=64, 1<=W<=64

3. The contents of the article

Output

Rewrite the article which is height H and width W from right top to left down.

There is a newline at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss