웹 프로그래밍 기초/자바기반의 웹&앱 응용SW 개발자
코로나 휴강 대체할 t형의 복습문제11.
oncerun
2020. 3. 8. 19:49
반응형
2. 입력받은 수의 구구단 출력하기
입력 예제
11
출력 예제
11x2=22 11x3=33 11x4=44 11x5=55 11x6=66 11x7=77 11x8=88 11x9=99
import java.util.Scanner;
public class corona11 {
public static void main(String[] args) {
Scanner scan =new Scanner(System.in);
int num =scan.nextInt();
for(int i =1; i <10; i++) {
int result = num*i;
System.out.printf("%dx%d=%d \n" ,num,i,result);
}
}
}
반응형