fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. double number=1.3215;
  7. for(int n=0;n<8;n++) cout << (double)((int)(number*pow(10,n))%10)/pow(10,n) << endl;
  8. return 0;
  9. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1
0.3
0.02
0.001
0.0004
9e-05
9e-06
9e-07