单选题 C语言
题号 #2061650

执行以下程序时输人1234567<CR>,则输出结果是(  )。
#include<stdio.h>
main()
{
     int a =1,b;
     scanf("%3d%2d",&a,&b);
     printf("%d%d\n",a,b);
}

进入在线模考

参考答案

D

答案解析

scanf函数中的格式控制说明为”%3d%2d”,分别选中输人中的三位和两位,因此a=123,b=45。因此正确答案为D)选项。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考