Algorithm


Problem Name: beecrowd | 2753

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

Output 7

 

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 twenty-six integers;
  2. Assign the first variable the value 97;
  3. Assign the other variables to the value of the first sum of a unit;
  4. Show on the screen the numeric values of the first variable, a space in arm, the character 'e', another white space and its alphanumeric value (characters);
  5. Repeat for all other variables.

 

Input

 

There is not.

 

Output

 

The result of your program should be the same as the output example.

 

 

 

Input Sample Output Sample
 

97 e a

98 e b

99 e c

100 e d

101 e e

102 e f

103 e g

104 e h

105 e i

106 e j

107 e k

108 e l

109 e m

110 e n

111 e o

112 e p

113 e q

114 e r

115 e s

116 e t

117 e u

118 e v

119 e w

120 e x

121 e y

122 e z

 

Code Examples

#1 Code Example with C Programming

Code - C Programming


#include <stdio.h>

int main(void)
{
    int i, x=97, a[26];

    for (i = 0; i  <  26; ++i)
        a[i]=x++;

    for (i = 0; i  <  26; ++i)
        printf("%d e %c\n", a[i], a[i]);

    return 0;
}
Copy The Code & Try With Live Editor

Output

x
+
cmd
97 e a 98 e b 99 e c 100 e d 101 e e 102 e f 103 e g 104 e h 105 e i 106 e j 107 e k 108 e l 109 e m 110 e n 111 e o 112 e p 113 e q 114 e r 115 e s 116 e t 117 e u 118 e v 119 e w 120 e x 121 e y 122 e z

#2 Code Example with Java Programming

Code - Java Programming


public class Main {
	public static void main(String[] args) {
		int a = 97;
		for(int i=0 ; i < 26 ; i++,a++)
			System.out.println(a + " e " + (char)a);
	}
}
Copy The Code & Try With Live Editor

Output

x
+
cmd
97 e a 98 e b 99 e c 100 e d 101 e e 102 e f 103 e g 104 e h 105 e i 106 e j 107 e k 108 e l 109 e m 110 e n 111 e o 112 e p 113 e q 114 e r 115 e s 116 e t 117 e u 118 e v 119 e w 120 e x 121 e y 122 e z

#3 Code Example with Javascript Programming

Code - Javascript Programming


const start = 97
const output = Array.from({ length: 26 }, (_, i) => `${(start + i)} e ${String.fromCharCode(start + i)}`)

console.log(output.join("\n"))
Copy The Code & Try With Live Editor

Output

x
+
cmd
97 e a 98 e b 99 e c 100 e d 101 e e 102 e f 103 e g 104 e h 105 e i 106 e j 107 e k 108 e l 109 e m 110 e n 111 e o 112 e p 113 e q 114 e r 115 e s 116 e t 117 e u 118 e v 119 e w 120 e x 121 e y 122 e z

#4 Code Example with Python Programming

Code - Python Programming


for i in range(97, 123):
    print('%d e %c'%(i, chr(i)))
Copy The Code & Try With Live Editor

Output

x
+
cmd
97 e a 98 e b 99 e c 100 e d 101 e e 102 e f 103 e g 104 e h 105 e i 106 e j 107 e k 108 e l 109 e m 110 e n 111 e o 112 e p 113 e q 114 e r 115 e s 116 e t 117 e u 118 e v 119 e w 120 e x 121 e y 122 e z
Advertisements

Demonstration


Previous
#1009 - Beecrowd Online Judge Solution 1009 - Salary with bonus - Solution in C, C++, Java, Python, C#
Next
#1011 Beecrowd Online Judge Solution 1011 Sphere Solution in C, C++, Java, Python and C#