fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int hcfof(int a,int b){
  6. int h=1;
  7. int m=a;
  8. if(b<a) m=b;
  9. for(int i=2;i<m+1;i++){
  10. if(a%i==0 && b%i==0) h=i;
  11. }
  12.  
  13. return h;
  14. }
  15.  
  16. int main(){
  17. int t;
  18. cin>>t >>"\n";
  19. for(int i=0;i<t;i++){
  20. float a;
  21. cin >> a >> "\n";
  22. int p=a;
  23. float q=p;
  24. if((a-q)==0) cout << 1 <<"\n";
  25. else{
  26. float d=a-q;
  27. int n=0;
  28. int c=d;
  29. float e=c;
  30. while((d-e)!=0){
  31. d=d*10;
  32. c=d;
  33. e=c;
  34. n=n+1;
  35. }
  36. int x=10^n;
  37. int h=hcfof(c,x);
  38. int r=x/h;
  39. cout << r <<"\n";
  40. }
  41. }
  42.  
  43. return 0;
  44. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
5
5.5
30.25
compilation info
prog.c:1:25: fatal error: bits/stdc++.h: No such file or directory
 #include <bits/stdc++.h>
                         ^
compilation terminated.
stdout
Standard output is empty