2215 - IP_2020_YOU_LAB11 Scoreboard

Time

2020/12/15 15:30:00 2020/12/17 12:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13051 Drum Rudiments
13052 ISO-8601

13051 - Drum Rudiments   

Description

In essence, rudiments are drum patterns that you can use for drills or warm-ups, or develop into more complex drum beats. The simplest drum rudiments may look like this:

 

 

L means to swing the drum stick with your left hand, R means to swing it with your right hand.

 

Please complete the class drum16beat, which is derived from drumPattern, to set different drum pattern base on the above drum rudiment and print them out.

note that you don’t need to implement drumPattern

 

drumPattern:

Protected Variables:

  • pattern(string).

note that the length of pattern need to be exactly 16 when playing it.

Protected Methods:

  • void play() – print out the pattern as above format. For example, when pattern is “RRLLRRLLRRLLRRLL”, should print RRLL RRLL RRLL RRLL

 

 

drum16beat: (derived from drumPattern)

Public Methods:

  • void play() – should call play() from drumPattern to print out the pattern from drumPattern.
  • void setPattern(char c1) – should set pattern to “c1(*16)”

note that “c1(*16)” means “c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1

  • void setPattern(char c1, char c2) – should set pattern to “c1c2(*8)”

note that “c1c2(*8)” means “c1c2c1c2c1c2c1c2c1c2c1c2c1c2c1c2

  • void setPattern(char c1, char c2, char c3, char c4) – should set pattern to “c1c2c3c4(*4)”
  • void setPattern(char c1, char c2, char c3, char c4, char c5, char c6, char c7, char c8) – should set pattern to “c1c2c3c4c5c6c7c8(*2)”
  • void setPattern(char c1, char c2, char c3, char c4, char c5, char c6, char c7, char c8, char c9, char c10, char c11, char c12, char c13, char c14, char c15, char c16) – should set pattern to “c1c2c3c4c5c6c7c8c9c10c11c12c13c14c15c16”

 

Input

No need to handle input. (Input would be number 1~5 to represent the index of test-case)

Output

Depend on test case show in main.cpp.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13051.cpp

Partial Judge Header

13051.h

Tags




Discuss




13052 - ISO-8601   

Description

Please write a C++ Program to turn a string of numbers separated by commas, into ISO-8601 format.

 

ISO-8601

  • The format is: yyyy-mm-ddThh:mm:ssZ.
  • Use capital ‘T’ to separate date information and time information.
  • Z represents the GMT time-zone, when the time-zone is GMT+8 than Z = +8. Usually use capital ‘Z’ to represent the GMT+0.

 

note that, you may use std::setfill(char) and std::setw(int) to help printing time in format.

 

Example:

#include <iostream> // std::cout
#include <iomanip> // std::setfill, std::setw
 
std::cout << std::setfill(‘-’)  << std::setw(4) << 35; // --35

 

if you don’t know how to use them, feel free to use your own method.

Input

A string of seven numbers separated by commas, represents year, month, day, hour, minute, second, time-zone respectively. For examples: “2020,12,10,21,6,17,8

note that year may be smaller 1000, but would not be larger than 9999. For example year = 525, year = 0, year 1995.

Output

Output should follow as below format:

yyyy-mm-ddThh:mm:ssZ

Sample Input  Download

Sample Output  Download

Tags




Discuss