본문 바로가기
공부

아스키코드 증가를 이용한 알파벳 출력

by 하프상 2017. 3. 25.

import java.io.IOException;

import java.util.Scanner;


public class homework2 {


public static void main(String[] args) throws IOException {

// TODO Auto-generated method stub

int a;

int b;

a = System.in.read();

b = a;

for(int i=97; i<=a; i++)

{

for(int j=97; j<=b; j++)

{

System.out.print((char)j + " ");

}

System.out.println();

b--;

}


}


}



댓글