Algorithm


Problem Name: beecrowd | 2752

Problem Link: https://www.beecrowd.com.br/judge/en/problems/view/2752

Output 6

 

By Roberto A. Costa Jr, UNIFEI BR Brazil

Timelimit: 1

Your teacher would like you to do a program with the following characteristics:

  1. Create a variable to store 50 characters;
  2. Assign the variable before the phrase: "AMO FAZER EXERCICIO NO URI";
  3. Show in the first line the <character, the value stored in the variable with the format "% s" and the character>;
  4. Show in the next line the character <, the value stored in the variable with the format "% 30s" and the character>;
  5. Show in the next line the <, the value stored in the variable with the format "% .20s" and the character>;
  6. Show in the following line the <character, the value stored in the variable with the format "% -20s" and the character>;
  7. Show in the next line the <character, the value stored in the variable with the format "% -30s" and the character>;
  8. Show in the next line the <character, the value stored in the variable with the format "% .30s" and the character>;
  9. Show in the next line the <character, the value stored in the variable with the format "% 30.20s" and the character>;
  10. Show in the next line the <character, the value stored in the variable with the format "% -30.20s" and the character>;

 

Input

 

There is not.

 

Output

 

The result of your program should be written according to the output example.

 

 

 

Input Sample Output Sample
 

<AMO FAZER EXERCICIO NO URI>

<    AMO FAZER EXERCICIO NO URI>

<AMO FAZER EXERCICIO >

<AMO FAZER EXERCICIO NO URI>

<AMO FAZER EXERCICIO NO URI    >

<AMO FAZER EXERCICIO NO URI>

<          AMO FAZER EXERCICIO >

<AMO FAZER EXERCICIO           >

 

Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming


#include <cstdio>
#include <string>

using namespace std;

int main()
{
    string s="AMO FAZER EXERCICIO NO URI";
    printf(" < %s>\n", s.c_str());
    printf("<%30s>\n", s.c_str());
    printf(" < %.20s>\n", s.c_str());
    printf("<%-20s>\n", s.c_str());
    printf(" < %-30s>\n", s.c_str());
    printf("<%.30s>\n", s.c_str());
    printf(" < %30.20s>\n", s.c_str());
    printf("<%-30.20s>\n", s.c_str());
    return 0;
}

Copy The Code & Try With Live Editor

Output

x
+
cmd
< AMO FAZER EXERCICIO NO URI> < AMO FAZER EXERCICIO >

#2 Code Example with Java Programming

Code - Java Programming


public class Main {
	public static void main(String[] args) {
		int a,b;
		System.out.printf(" < AMO FAZER EXERCICIO NO URI>\n");
		System.out.printf("<    AMO FAZER EXERCICIO NO URI>\n");
		System.out.printf(" < AMO FAZER EXERCICIO >\n");
		System.out.printf("\n");
		System.out.printf(" < AMO FAZER EXERCICIO NO URI    >\n");
		System.out.printf("\n");
		System.out.printf(" <           AMO FAZER EXERCICIO >\n");
		System.out.printf("\n");
	}
}
Copy The Code & Try With Live Editor

Output

x
+
cmd
< AMO FAZER EXERCICIO NO URI> < AMO FAZER EXERCICIO >

#3 Code Example with Javascript Programming

Code - Javascript Programming


console.log("")
console.log("<    AMO FAZER EXERCICIO NO URI>")
console.log("")
console.log("")
console.log("")
console.log("")
console.log("<          AMO FAZER EXERCICIO >")
console.log("")
Copy The Code & Try With Live Editor

Output

x
+
cmd
< AMO FAZER EXERCICIO NO URI> < AMO FAZER EXERCICIO >
Advertisements

Demonstration


Previous
#2750 Beecrowd Online Judge Solution 2750 Output 4 Solution in C, C++, Java, Js and Python
Next
#2754 Beecrowd Online Judge Solution 2754 Output 8 Solution in C, C++, Java, Js and Python