Advertisement
Morass

Untitled

Apr 4th, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. double a[]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.};
  4. int main(void){
  5.     for(int i(0);i<10;++i)
  6.         printf("%.0lf (%.1lf) (%d) (%d)\n",a[i],a[i],(int)a[i],(int)ceil(a[i]));
  7.     return 0;
  8. }
  9. /*
  10. 0 (0.1) (0) (1)
  11. 0 (0.2) (0) (1)
  12. 0 (0.3) (0) (1)
  13. 0 (0.4) (0) (1)
  14. 0 (0.5) (0) (1)
  15. 1 (0.6) (0) (1)
  16. 1 (0.7) (0) (1)
  17. 1 (0.8) (0) (1)
  18. 1 (0.9) (0) (1)
  19. 1 (1.0) (1) (1)
  20. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement