题解 2779: 输出绝对值

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

2779: 输出绝对值

摘要:解题思路:else的条件是a<0 此时a为负数 所以a的绝对值是 -a ,--a=a。注意事项:都是成功提交过的可以直接使用。参考代码:#include<iostream>……

C++简单解法

摘要:解题思路:属于基础题目,重要的是知道求绝对值的函数fabs及如何控制小数点后的位数注意事项:参考代码:#include<iostream>#include<cmath>#inc……

题解 2779: 输出绝对值

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    double a;    cin>>a;    pr……

2779: 输出绝对值

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    double x;    cin >> x  ;  ……

2779: 输出绝对值

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    double x;    cin >> x  ;  ……

2779: 输出绝对值

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    double x;    cin >> x  ;  ……

编写题解 2779: 输出绝对值

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    double a;    cin>>a;    pr……

题解 2779: 输出绝对值

摘要:解题思路:创建一个浮点型变量,再用printf输出就可以了。注意事项:要用#include <bits/stdc++.h>当头文件参考代码:#include <bits/stdc++.h>using ……

2779: 输出绝对值

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cmath> #include<iomanip> using namespace std; int mai……