yicongli

Gym 101848A

Jan 23rd, 2021
725
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define gc c=getchar()
  6. #define r(x) read(x)
  7. #define ll long long
  8.  
  9. template<typename T>
  10. inline void read(T&x){
  11.     x=0;T k=1;char gc;
  12.     while(!isdigit(c)){if(c=='-')k=-1;gc;}
  13.     while(isdigit(c)){x=x*10+c-'0';gc;}x*=k;
  14. }
  15.  
  16. int main(){
  17.     // freopen(".in","r",stdin);
  18.     // freopen(".out","w",stdout);
  19.     long double a,b;
  20.     cin>>a>>b;
  21.     ll A=round(a*1000000000);
  22.     ll B=round(b*1000000000);
  23.     printf("%.20lf",(A%B)/1000000000.0);
  24.     return 0;
  25. }
RAW Paste Data