Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <cmath>
- using namespace std;
- int main()
- {
- double a,b,c;
- scanf("%lf%lf%lf",&a,&b,&c);
- double ans = a/b;
- for(int i=0;i<c;i++)
- {
- ans*=10;
- }
- int transform = ans+0.5;
- ans = double(transform)/10;
- for(int i=1;i<c;i++)
- {
- ans/=10;
- }
- printf("%lf\n",ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement