## Algorithm

Problem Name: beecrowd | 2761

# Input and Output of Various Types

By Roberto A. Costa Jr, UNIFEI Brazil

Timelimit: 1

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

1. Create an integer variable;
2. Create a real variable of simple precision;
3. Create a variable that stores a character;
4. Create a variable that stores a phrase of max 50 characters;
5. Read all variables in the order of the created form;
6. Print out all variables as read;
7. Print the variables, separating them by tabulation (8 spaces), in the order they were read;
8. Print the variables with exactly 10 spaces.

## Input

The input consists of several test files. In each test file there is one line. The line has a variable A that stores an integer, a variable B that stores a real number, a variable C with a character, and a variable D that stores a phrase with a maximum of 50 characters. As shown in the following input example.

## Output

For each file in the input, you have an output file. The output file has three lines as described in items 6, 7, and 8. As shown in the following output example. Print the floating-point values ​​to 6 decimal places after the comma.

 Input Samples Output Samples 12 3.141560 a Uri online 123.141560aUri online 12 3.141560 a Uri online 12 3.141560 a Uri online

 791 123.141568 | aaa 791123.141571|aaa 791 123.141571 | aaa 791123.141571 | aaa

## Code Examples

### #1 Code Example with C Programming

```Code - C Programming```

``````
#include <stdio.h>

int main(){

int inteiro;
float precSimples;
char caractere;
char frase[60];

while (scanf("%d %f %c %[^\n]s",&inteiro, &precSimples, &caractere, frase) != EOF)

{

printf("%d%.6f%c",inteiro,precSimples,caractere);
puts(frase);
printf("%d        %.6f        %c        ",inteiro,precSimples,caractere);
puts(frase);
printf("%d          %.6f          %c          ",inteiro,precSimples,caractere);
puts(frase);
}
return 0;
}

``````
Copy The Code &

Input

cmd
12 3.141560 a Uri online

Output

cmd
123.141560aUri online 12 3.141560 a Uri online 12 3.141560 a Uri online

### #2 Code Example with C++ Programming

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

``````
#include <iostream>
#include <string>
#include <cstdio>
#include <iomanip>

using namespace std;

int main()
{
int integer;
float floating;
char character;
string s;
cin >> integer >> floating >> character >> ws;
getline(cin, s);
char c='\t';
cout << integer << fixed << floating << character << s << endl;
cout << integer << c << floating << c << character << c << s << endl;
printf("%10d%10.6f%10c", integer, floating, character);
cout << right << setw(10) << s << endl;

return 0;
}

``````
Copy The Code &

Input

cmd
12 3.141560 a Uri online

Output

cmd
123.141560aUri online 12 3.141560 a Uri online 12 3.141560 a Uri online

### #3 Code Example with Java Programming

```Code - Java Programming```

``````
import java.util.Scanner;
import java.util.Locale;
public class Main {
public static void main(String[] args) {
Locale.setDefault(new Locale("en", "US"));
Scanner sc = new Scanner(System.in);

//Crie uma vari�vel inteira;
int a = Integer.parseInt(sc.next());
//Crie uma vari�vel real de simples precis�o;
float b = Float.parseFloat(sc.next());
//Crie uma vari�vel que armazene um caracter;
char c = sc.next().charAt(0);
//Crie uma vari�vel que armazene uma frase de no m�ximo 50 caracteres;
String[] d = new String[50];
String input = sc.nextLine();
d = input.split("");
String sd="";
for(int i=1 ; i <  d.length; i++) sd+=d[i];
//Leia todas as vari�veis na ordem da forma criada;

//Imprima todas as vari�veis como foram lidas;
System.out.printf("%d%.6f%c%s\n",a,b,c,sd);
//Imprima as vari�veis, separando-as por uma tabula��o (8 espa�os), na ordem que foram lidas;
System.out.printf("%d\t%.6f\t%c\t%s\n",a,b,c,sd);
//Imprima as vari�veis com exatos 10 espa�os.
System.out.printf("%10d%10.6f%10c%10s\n",a,b,c,sd);

sc.close();
}
}
``````
Copy The Code &

Input

cmd
12 3.141560 a Uri online

Output

cmd
123.141560aUri online 12 3.141560 a Uri online 12 3.141560 a Uri online

### #4 Code Example with Javascript Programming

```Code - Javascript Programming```

``````
const { readFileSync } = require("node:fs")

const [input] = readFileSync("/dev/stdin", "utf-8").split("\n", 1)
const [, int, decimal, chr, str] = input.match(/(-?\d+) (-?\d+\.\d+) (.) ([\w\s]+)\$/s)

function main() {
const float = Math.fround(Number.parseFloat(decimal)).toFixed(6)
const all = [int, float, chr, str]

console.log(all.join(""))
console.log(all.join("\t"))
}

main()
``````
Copy The Code &

Input

cmd
12 3.141560 a Uri online

Output

cmd
123.141560aUri online 12 3.141560 a Uri online 12 3.141560 a Uri online

### #5 Code Example with Python Programming

```Code - Python Programming```

``````
print('%s' % tudo)
print('%d\t%f\t%c\t%s' % (inteiro, real, caracter, frase))
print('%10d%10.6f%10c%10s' % (inteiro, real, caracter, frase))

``````
Copy The Code &

Input

cmd
12 3.141560 a Uri online

Output

cmd
123.141560aUri online 12 3.141560 a Uri online 12 3.141560 a Uri online