阅读以下程序,当输入数据的形式为: 12a345b789↓,正确的输出结果为( A )。
void main ( )
{
char c1, c2;
int a1, a2;
c1=getchar ( ) ;
scanf ("%2d", &a1) ;
c2=getchar ( ) ;
scanf ("%3d", &a2);
printf ("%d, %d, %c, %c\n", a1, a2, c1, c2);
}
A.2, 345, 1, a
B.12, 345, a, b
C.2a, 45b, 1, 3
D.2, 789, 1, a
解答:A