Algorithm

Problem Name: beecrowd | 2748

Output 2

By Roberto A. Costa Jr, UNIFEI Brazil

Timelimit: 1

Your teacher would like to make a screen with the following characteristics:

1. Have 39 dashes (-) on the first line;
2. Have a | underneath the first dash and the thirty-ninth dash of the first line, below the dash should begin to write the word "Roberto" and the rest fill in the middle with white space;
3. Have a | below the first dash and the thirty-ninth dash of the first line, fill in the middle with whitespace;
4. Have a | below the first dash and the thirty-ninth dash of the first line, below the 10 dash you should begin to type the number "5786" and the rest fill in the middle with whitespace;
5. Repeat procedure 3;
6. Have a | underneath the first dash and the thirty-ninth dash of the first line, below the dash 10 should begin to write the word "UNIFEI" and the rest fill in the middle with white space;
7. Repeat procedure 1.

At the end should look like the following image:

--------------------------------------- (39 traces)
|        Roberto                      |
|                                     |
|        5786                         |
|                                     |
|        UNIFEI                       |
--------------------------------------- (39 traces)

There is not.

Output

The output will be printed as shown above.

 Input Sample Output Sample --------------------------------------- |        Roberto                      | |                                     | |        5786                         | |                                     | |        UNIFEI                       | ---------------------------------------

Code Examples

#1 Code Example with C Programming

```Code - C Programming```

``````
#include <stdio.h>
int main() {
printf("---------------------------------------\n");
printf("|        Roberto                      |\n");
printf("|                                     |\n");
printf("|        5786                         |\n");
printf("|                                     |\n");
printf("|        UNIFEI                       |\n");
printf("---------------------------------------\n");
}
``````
Copy The Code &

Output

cmd
--------------------------------------- | Roberto | | | | 5786 | | | | UNIFEI | ---------------------------------------

#2 Code Example with C++ Programming

```Code - C++ Programming```

``````
#include <iostream>

int main() {
printf("---------------------------------------\n");
printf("|        Roberto                      |\n");
printf("|                                     |\n");
printf("|        5786                         |\n");
printf("|                                     |\n");
printf("|        UNIFEI                       |\n");
printf("---------------------------------------\n");
}
``````
Copy The Code &

Output

cmd
--------------------------------------- | Roberto | | | | 5786 | | | | UNIFEI | ---------------------------------------

#3 Code Example with Java Programming

```Code - Java Programming```

``````
public class Main {
public static void main(String[] args) {
System.out.printf("---------------------------------------\n");
System.out.printf("| Roberto                      |\n");
System.out.printf("|             |\n");
System.out.printf("| 5786                         |\n");
System.out.printf("|             |\n");
System.out.printf("| UNIFEI                       |\n");
System.out.printf("---------------------------------------\n");
}
}
``````
Copy The Code &

Output

cmd
--------------------------------------- | Roberto | | | | 5786 | | | | UNIFEI | ---------------------------------------

#4 Code Example with Javascript Programming

```Code - Javascript Programming```

``````
"use strict"

const isSuccessfullyDefined = Reflect.defineProperty(String.prototype, "pad", {
const splited = [...this]
return splited.join("").substr(0, this.length)
},
writable: false,
configurable: false,
enumerable: true,
})

const ROW_SIZE = 39

const SPACE = " "
const DIV = "|"
const DASH = "-"

function main() {
const separator = DASH.repeat(ROW_SIZE)

const row = SPACE.repeat(ROW_SIZE)

const output = [
separator,
row,
row,
separator,
]

console.log(output.join("\n"))
}

if (isSuccessfullyDefined) {
main()
}

``````
Copy The Code &

Output

cmd
--------------------------------------- | Roberto | | | | 5786 | | | | UNIFEI | ---------------------------------------

#5 Code Example with Python Programming

```Code - Python Programming```

``````
print('---------------------------------------')
print('|        Roberto                      |')
print('|                                     |')
print('|        5786                         |')
print('|                                     |')
print('|        UNIFEI                       |')
print('---------------------------------------')
``````
Copy The Code &

Output

cmd
--------------------------------------- | Roberto | | | | 5786 | | | | UNIFEI | ---------------------------------------