3013: 求小数的某一位 摘要:```cpp #include #include using namespace std; int main() { long double a,b,n; cin>>a>…… 题解列表 2023年01月08日 0 点赞 0 评论 574 浏览 评分:9.9
3013: 求小数的某一位 摘要:解题思路:注意事项:这里的cout要在外面写a的值可以改变参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long lo…… 题解列表 2024年01月15日 0 点赞 0 评论 479 浏览 评分:9.9
Yu(正确的做法)求小数的某一位 #解题思路**很多题解都是错误的**首先这是循环题,很多题解不使用循环,也没有算法。如果数据按题目给的量级,那些题解的方法不可能过,longdouble没有那么大的范围。我们应该把商放大,取余最后一位来得到结果。为了不超过数据范围,需要不断取模。 题解列表 2023年12月01日 0 点赞 0 评论 461 浏览 评分:9.9
【稳定做法】求小数的某一位-模拟列竖式 前排题解基本用浮点数运算,但是对于$$n\leq10000$$的数据范围来说理论上都是错误的,无论是`double`还是`longdouble`在$$10^{10000}$$面前都无法保证精度正确做法应该模拟列竖式除法的过程,商只保留运算到的最后一位, 题解列表 2023年10月30日 0 点赞 0 评论 624 浏览 评分:9.9
3013: 求小数的某一位 摘要:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a,b,n;//定义a,b,n, cin>>a>>b>>n…… 题解列表 2023年07月11日 0 点赞 0 评论 713 浏览 评分:9.9
求小数的某一位 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a,b,n,c; cin>>a>>b>>n…… 题解列表 2023年07月11日 0 点赞 0 评论 482 浏览 评分:9.9
优质题解 3013: 求小数的某一位 解题思路:这道题的难点是怎么查询小数点后的位数,最简单的做法是将浮点数转换成字符串,查找到小数点后就可以找到小数点n位后的那个值了,c++里的string库里提供了浮点数转字符串的to_string函数,不过这个函数只能保存小数点后六位有效数字,对于需要很多位的就失效了。 题解列表 2022年11月29日 0 点赞 0 评论 1481 浏览 评分:9.9
求小数的某一位 摘要:解题思路:#include <bits/stdc++.h>using namespace std;int main(){ int a,b,n,c; cin>>a>>b>>n; for…… 题解列表 2023年07月11日 0 点赞 0 评论 491 浏览 评分:0.0
aaaaaaaaaaaaaaaaaaaa 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a,b,c,n; cin>>a>>b>>n…… 题解列表 2023年07月11日 0 点赞 0 评论 499 浏览 评分:0.0
呢个大神看看为啥我这个有一个案例过不去 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ double n,m; long long l; doubl…… 题解列表 2023年03月01日 0 点赞 0 评论 549 浏览 评分:0.0