Study/숙제

구구단

나나83 2009. 11. 5. 17:09

class test
{
 public static void main(String[] args)
 {
  int a = Integer.parseInt(args[0]);
  if( a == 0 || a < 0)
  {
   System.out.println("장난치지마");
  }
  else
  {
  for(int i = 1 ; i <= 9 ; i++)
  {
  System.out.println(a + " * " + i + " = " + (a*i));
  }
  }
 }
}

'Study > 숙제' 카테고리의 다른 글

야구 게임  (0) 2011.05.09
다이아몬드 찍기  (0) 2011.05.09
구구단  (0) 2009.11.06
if문으로 바꾸기  (0) 2009.11.05
수를 받아서 5 * 4* 3* 2* 1 = 결과가 나오겠금  (0) 2009.11.05