# include < stdio . h > void main ( ) { int a , i , j ; char n ; do { fflush ( stdin ) ; printf ( " 숫자 ( 1 ~ 4 ) 선택 n "); printf ( "[ 짝 수단 : 1 ] [ 홀 수단 : 2 ] n "); printf ( "[ 전체 단 : 3 ] [ 3 의 배 수단 : 4 ] : "); scanf ( "% d ",& a ) ; if ( a == 1 ) { for ( i = 2 ; i <= 9 ; i = i + 2 ) { printf ( "<% d 단 > n ", i ) ; for ( j = 1 ; j <= 9 ; j ++){ if ( ( j % 3 ) == 0 ) printf ( "% d *% d =% dn ", i , j , i * j ) ; else printf ( "% d *% d =% dt ", i , j , i * j ) ; } printf ( " n "); } } else if ( a == 2 ) { for ( i = 3 ; i <= 9 ; i = i + 2 ) { printf ( "<% d 단 > n ", i ) ; for ( j = 1 ; j <= 9 ; j ++){ if ( ( j % 3 ) == 0 ) printf ( "% d *% d =% dn ", i , j , i * j ) ; else printf ( "% d *% d =% dt ", i , j , i * j ) ; } printf ( " n "); } } else if ( a == 3 ) { for ( i = 2 ; i <= 9 ; i = i ++){ printf ( "<% d 단 > n ", i ) ; for ( j = 1 ; j <= 9 ; j ++){ if ( ( j % 3 ) == 0 ) printf ( "% d *% d =% dn ", i , j , i * j ) ; else printf ( "% d *% d =% dt ", i , j , i * j ) ; } printf ( " n "); } } else if ( a == 4 ) { for ( i = 3 ; i <= 9 ; i = i + 3 ) { printf ( "<% d 단 > n ", i ) ; for ( j = 1 ; j <= 9 ; j ++){ if ( ( j % 3 ) == 0 ) printf ( "% d *% d =% dn ", i , j , i * j ) ; else printf ( "% d *% d =% dt ", i , j , i * j ) ; } printf ( " n "); } } else { } do { fflush ( stdin ) ; printf ( " 다시 선택 y / s : "); scanf ( "% c ",& n ) ; } while ( n ! = ` n ` && n ! = ` N ` && n ! = ` y ` && n ! = ` Y `); } while ( n == ` y `|| n == ` Y `); } 출 처 :