C语言 宏定义练习:判别式

题目描述

#include <stdio.h>
/******************************************/
/// Change the code here to make this progress correct.

#define DERTA(a, b, c) (((b) * b) - (4 * (a) * (c ))))

/*****************************************/
int main()
{
double _1, _2, _3;
scanf("%lf%lf%lf", &_1, &_2, &_3);
printf("%.0f\n", DERTA(_1/5, _2+4, _3
2));
return 0;
}

样例输入 Copy

5 6 7

样例输出 Copy

44

代码

#include <stdio.h>
/******************************************/
/// Change the code here to make this progress correct.

#define DERTA(a, b, c) (((b) *(b) - (4 * (a) * (c))))

/******************************************/
int main()
{
    double _1, _2, _3;
    scanf("%lf%lf%lf", &_1, &_2, &_3);
    printf("%.0f\n", DERTA(_1/5, _2+4, _3*2));
    return 0;
}
发布了47 篇原创文章 · 获赞 29 · 访问量 1500

猜你喜欢

转载自blog.csdn.net/Qianzshuo/article/details/103757537