小编nsi*_*son的帖子

Short int不接受该值

给予以下程序的输入是

10 10

10 10

但输出是

0 20

为什么?

/* scanf example */
#include <stdio.h>


int main ()
{
    short int a, b, c, d, e, f;
    a=b=c=d=e=f=0;
    scanf("%d %d",&a,&b);
    scanf("%d %d",&e,&d);
    c=a+b;
    f=d+e;

    printf("%d %d\n",c,f);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c compiler-construction

2
推荐指数
1
解决办法
843
查看次数

标签 统计

c ×1

compiler-construction ×1