c语言定两个整型变量a和b,从键盘读取输入数据前3位赋值给a,接着4位赋值给b?

完整的程序会吗?

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
int a=0,b=0;

scanf("%3d%4d", &a,&b);

system("pause");
return 0;
}
用例:1234567
结果 a=123,b=4567
温馨提示:答案为网友推荐,仅供参考
相似回答