#include #include const char *notes = "C C#D D#E F F#G G#A A#B C2C2#"; // Notes in order. Note #i is at position i * 2 in the string const char *ex[] = { // ! instead of \\ since escaped backslashes are ugly "----|-!-----------------------------------------------------------------------------+", " | } |", "----|-/-----------------------------------------------------|----|------------------|", " |/ 4 | | | | (@) #(@) |", "---/|-----------------------------------|----|----|----|----|----|--(@)--|----|-----|", " / | 4 | | | | | (@) #(@) | | | |", "-{--|-!------------------|----|----|----|----|--(@)-#(@)------------|----|----|-----|", " !_|_/ | | | | | (@) #(@) | |", "----|!---------|----|----|----|--(@)------------------------------------------------+", " |_} | | (@) #(@) ", " (@) #(@) "}; int v[255]; void print(int l, int a, int b) { for(int i = a ; i < b ; i++) putchar(ex[l][i] == '!' ? '\\' : ex[l][i]); // Replace ! with \\ } int main() { int n; char note[10]; scanf("%d ", &n); for(int i = 0 ; i < n ; i++){ scanf("%s ", note); v[i] = (strstr(notes, note) - notes) / 2; // Index of the note v[i] = 12 + v[i] * 5; // Start position of the note } for (int l = 0; l < 11; l++) { // For each line of ex... print(l, 0, 12); // ... print the clef and measure for(int i = 0; i < n; i++) print(l, v[i], v[i] + 5); // ... print the note print(l, 82, 85); // ... print the final bar puts(""); // ... print a newline } return 0; }