Algorithm


Problem Name: beecrowd | 2759

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

Input and Output Character

 

By Roberto A. Costa Jr, UNIFEI BR Brazil

Timelimit: 1

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

  1. Create 3 variables to store a single character;
  2. Read a character value for the first variable;
  3. Read a character value for the second variable;
  4. Read a character value for the third variable;
  5. Print the letter A, a space, the equals sign, a blank, the character stored in the first variable read in step 2, a comma, a blank, the letter B, a blank, the sign equal to one blank, the character stored in the second variable read in step 3, the letter C, a blank, the equal sign, a blank, the character stored in the third variable read in step 4. No forget to skip line;
  6. Print the letter A, a space, the equals sign, a blank, the character stored in the first variable read in step 3, a comma, a blank, the letter B, a blank, the sign equal to one blank, the character stored in the second variable read in step 4, the letter C, a blank, the equal sign, a blank, the character stored in the third variable read in step 2. No forget to skip line;
  7. Print the letter A, a blank, the equals sign, a blank, the character stored in the first variable read in step 4, a comma, a blank, the letter B, a blank, the sign equal to one blank, the character stored in the second variable read in step 2, the letter C, a blank, the equal sign, a blank, the character stored in the third variable read in step 3. No Forget to skip line.

 

Input

 

The entry consists of several test files. Each test file has three rows. In the first line has a variable A that stores a character value. The second line has a variable B that stores a character value. The third line has a variable C that stores a character value. As shown in the following input example.

 

Output

 

For each file in the entry, you have an output file. The output file has three rows as described in items 5, 6, and 7. As shown in the following output example.

 

 

 

Input Samples Output Samples

a

b

c

A = a, B = b, C = c

A = b, B = c, C = a

A = c, B = a, C = b

 

 

 

0

1

2

A = 0, B = 1, C = 2

A = 1, B = 2, C = 0

A = 2, B = 0, C = 1

 

Code Examples

#1 Code Example with C Programming

Code - C Programming


#include <stdio.h>

int main(void)
{
    char a, b, c;

    while (scanf(" %c %c %c", &a, &b, &c) != EOF)
    {
        printf("A = %c, B = %c, C = %c\n", a, b, c);
        printf("A = %c, B = %c, C = %c\n", b, c, a);
        printf("A = %c, B = %c, C = %c\n", c, a, b);
    }

    return 0;
}

Copy The Code & Try With Live Editor

Input

x
+
cmd
a b c

Output

x
+
cmd
A = a, B = b, C = c A = b, B = c, C = a A = c, B = a, C = b

#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) {
	char a,b,c;
	cin >>a >> b >> c;
	printf("A = %c, B = %c, C = %c\n",a,b,c);
	printf("A = %c, B = %c, C = %c\n",b,c,a);
	printf("A = %c, B = %c, C = %c\n",c,a,b);
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
a b c

Output

x
+
cmd
A = a, B = b, C = c A = b, B = c, C = a A = c, B = a, C = b

#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);
		char a = sc.next().charAt(0);//2
		char b = sc.next().charAt(0);//3
		char c = sc.next().charAt(0);//4
/* 05 */System.out.printf("A = %c, B = %c, C = %c\n",a,b,c);
/* 06 */System.out.printf("A = %c, B = %c, C = %c\n",b,c,a);
/* 07 */System.out.printf("A = %c, B = %c, C = %c\n",c,a,b);
		sc.close();
	}
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
a b c

Output

x
+
cmd
A = a, B = b, C = c A = b, B = c, C = a A = c, B = a, C = b

#4 Code Example with Javascript Programming

Code - Javascript Programming


const { readFileSync } = require("fs")
const [A, B, C] = readFileSync("/dev/stdin", "utf8").split("\n")

console.log("A = %s, B = %s, C = %s", A, B, C)
console.log("A = %s, B = %s, C = %s", B, C, A)
console.log("A = %s, B = %s, C = %s", C, A, B)
Copy The Code & Try With Live Editor

Input

x
+
cmd
a b c

Output

x
+
cmd
A = a, B = b, C = c A = b, B = c, C = a A = c, B = a, C = b

#5 Code Example with Python Programming

Code - Python Programming


a = str(input())
b = str(input())
c = str(input())
print('A = {}, B = {}, C = {}'.format(a, b, c))
print('A = {}, B = {}, C = {}'.format(b, c, a))
print('A = {}, B = {}, C = {}'.format(c, a, b))
Copy The Code & Try With Live Editor

Input

x
+
cmd
a b c

Output

x
+
cmd
A = a, B = b, C = c A = b, B = c, C = a A = c, B = a, C = b
Advertisements

Demonstration


Previous
#2758 Beecrowd Online Judge Solution 2758 Floating Number Input and Output Solution in C, C++, Java, Js and Python
Next
#2760 Beecrowd Online Judge Solution 2760 String Input and Output Solution in C, C++, Java, Js and Python