运行成功,输入错误

来源:3-2 算术运算符

Kcyber

2019-06-20 11:40

#include <stdio.h>

int main()

{

    int x,y;

    x = 10;

    y = -3;

    printf("x+y=%d\n",10+(-3));  

    printf("x-y=%d\n",10-(-3));

    printf("x*y=%d\n",10*(-3));

    printf("x/y=%d\n",(-10)/3);

    printf("x%%y=%d\n",(10/3/3));  

    return 0;    

}


写回答 关注

2回答

  • 慕的地21332321
    2019-07-15 17:16:51

    #include <stdio.h>

    int main()

    {

        int x,y;

        x = 10;

        y = -3;

        int a = x+y;

        int b = x-y;

        int c = x*y;

        int d = x/y;

        int e = x%y;

        printf("x+y=%d\n",a);  

        printf("x-y=%d\n",b);

        printf("x*y=%d\n",c);

        printf("x/y=%d\n",d);

        printf("x%%y=%d\n",e);  

        return 0;    

    }


  • 慕盖茨0354880
    2019-06-20 14:58:36

    #include <stdio.h>

    int main()

    {

        int x,y;

        x = 10;

        y = -3;

        //变量就是拿来用的

        printf("x+y=%d\n", x+y);  

        printf("x-y=%d\n", x-y);

        printf("x*y=%d\n",x*y);

        printf("x/y=%d\n",x/y);

        printf("x%%y=%d\n",x%y);  

        return 0;    

    }


C语言入门

C语言入门视频教程,带你进入编程世界的必修课-C语言

926299 学习 · 20799 问题

查看课程

相似问题