题解 1038: [编程入门]宏定义练习之三角形面积 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>#define area sqrt(S*(S-a)*(S-b)*(S-c))#define S ((a+b+c)/2)usi…… 题解列表 2023年12月02日 0 点赞 0 评论 280 浏览 评分:9.9
1038: [编程入门]宏定义练习之三角形面积 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ double a,b,c; cin>>a>>b…… 题解列表 2023年12月02日 0 点赞 0 评论 155 浏览 评分:9.9
题解 1038: [编程入门]宏定义练习之三角形面积 摘要:解题思路:注意事项:1.根据题目给的公式,输入a,b,c分别为三角形的三条边,S为(a+b+c)/2(这个就是著名的海伦公式),置到这两个东西之后就可以直接求解area了,由于题目要求使用宏定义来写,…… 题解列表 2023年12月02日 0 点赞 0 评论 151 浏览 评分:7.3
编写题解 1038: [编程入门]宏定义练习之三角形面积 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ double a,b,c; cin>>a>>b…… 题解列表 2023年12月02日 0 点赞 0 评论 147 浏览 评分:9.9
(轻轻松松)宏定义练习之三角形面积 摘要:解题思路: 直接用它给的公式算起!注意事项: 要用开方!参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int …… 题解列表 2023年11月27日 0 点赞 0 评论 87 浏览 评分:0.0
1038: [编程入门]宏定义练习之三角形面积 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h> //注意:代码中用到 sqrt(开平方)需添加头文件<math.h>#define S(a,b…… 题解列表 2023年11月24日 0 点赞 0 评论 54 浏览 评分:0.0
宏定义练习之三角形面积 摘要:解题思路:已知三边可用海伦公式注意事项:参考代码:#include<stdio.h>#include<math.h>#define S(x,y,z) ((x)+(y)+(z))/2.0#define …… 题解列表 2023年10月15日 0 点赞 0 评论 90 浏览 评分:0.0
宏定义练习之三角形面积 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>#define S(c,a,b) float s=(a+b+c)/2#define area(c,a…… 题解列表 2023年09月22日 0 点赞 0 评论 72 浏览 评分:0.0
注意头文件包含math.h 摘要:#include<stdio.h>#include<math.h>#define S(a,b,c) (a+b+c)*0.5#define area(S,a,b,c) sqrt(S*(S-a)*(S-b…… 题解列表 2023年08月11日 0 点赞 0 评论 90 浏览 评分:0.0
简化宏定义求三角形面积 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>#define S(a,b,c) (a+b+c)/2#define area(a,b,c) sqrt(…… 题解列表 2023年08月08日 0 点赞 0 评论 332 浏览 评分:8.0