Algorithm
Problem Name: beecrowd | 2756
Problem Link: https://www.beecrowd.com.br/judge/en/problems/view/2756
Output 10
By Roberto A. Costa Jr, UNIFEI Brazil
Timelimit: 1
Your programming teacher would like you to do a program with the following characteristics:
- Put seven blanks and put the 'A' character;
- Put six blanks and place the character 'B', a space and the character 'B';
- Put five blanks and place the 'C' character, three white space, and the 'C' character;
- Put four blanks and place the 'D' character, five white space, and the 'D' character;
- Put three blanks and put the 'E' character, seven white space and the 'E' character;
- Repeat procedure 4;
- Repeat procedure 3;
- Repeat procedure 2;
- Repeat procedure 1.
Input
There is not.
Output
The result of your program should be written according to the output example.
Input Sample | Output Sample |
A B B C C D D E E D D C C B B A |
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include <stdio.h>
int main(void)
{
printf(" A\n");
printf(" B B\n");
printf(" C C\n");
printf(" D D\n");
printf(" E E\n");
printf(" D D\n");
printf(" C C\n");
printf(" B B\n");
printf(" A\n");
return 0;
}
Copy The Code &
Try With Live Editor
Output
#2 Code Example with C++ Programming
Code -
C++ Programming
#include <iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iterator>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<cstdio>
#include<stack>
#include<queue>
#include<math.h>
#include <utility>
#include <sstream>
#include<bitset>
using namespace std;
typedef long long ll;
typedef std::vector < double> vi;
#define PI acos(-1)
#define E 2.718281828459
int main(int argc, char** argv) {
printf(" A\n");
printf(" B B\n");
printf(" C C\n");
printf(" D D\n");
printf(" E E\n");
printf(" D D\n");
printf(" C C\n");
printf(" B B\n");
printf(" A\n");
return 0;
}
Copy The Code &
Try With Live Editor
Output
#3 Code Example with Java Programming
Code -
Java Programming
import java.util.*;
public class Main {
public static void main(String[] args) {
System.out.printf(" A\n");
System.out.printf(" B B\n");
System.out.printf(" C C\n");
System.out.printf(" D D\n");
System.out.printf(" E E\n");
System.out.printf(" D D\n");
System.out.printf(" C C\n");
System.out.printf(" B B\n");
System.out.printf(" A\n");
}
}
Copy The Code &
Try With Live Editor
Output
#4 Code Example with Javascript Programming
Code -
Javascript Programming
const output = [
" A",
" B B",
" C C",
" D D",
" E E",
" D D",
" C C",
" B B",
" A",
]
console.log(output.join("\n"))
Copy The Code &
Try With Live Editor
Output
#5 Code Example with Python Programming
Code -
Python Programming
print(' A')
print(' B B')
print(' C C')
print(' D D')
print(' E E')
print(' D D')
print(' C C')
print(' B B')
print(' A')
Copy The Code &
Try With Live Editor
Output