0
A 1 B 2 C 3 D 4 E 5 F 6 G 7 H 8 I 9 J 10 K 11 L 12 M 13 N 14 O 15 P 16 Q 17 R 18 S 19 T 20 U 21 V 22 W 23 H 24 Y 25 Z 26 pleas help Me....java coding ......one looping use
5 ответов
+ 3
Another version
char ch;
int i;
for( ch = 'A',i = 1 ; ch <= 'Z' ; i++,ch++ )
System.out.println(ch + " " + i);
+ 1
WPimpong simplified it, I like his. :)
+ 1
Thanks @James
+ 1
Thank's ,WPimpong and James.
0
Maybe something like this?
public class Program
{
public static void main(String[] args) {
char[] letters = new char[27];
letters[0] = ' ';
int increment = 1;
for(char ch = 'A'; ch <= 'Z'; ch++){
letters[increment] = ch;
System.out.println(letters[increment] + " " + increment);
increment++;
}
}
}