Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- double a[]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.};
- int main(void){
- for(int i(0);i<10;++i)
- printf("%.0lf (%.1lf) (%d) (%d)\n",a[i],a[i],(int)a[i],(int)ceil(a[i]));
- return 0;
- }
- /*
- 0 (0.1) (0) (1)
- 0 (0.2) (0) (1)
- 0 (0.3) (0) (1)
- 0 (0.4) (0) (1)
- 0 (0.5) (0) (1)
- 1 (0.6) (0) (1)
- 1 (0.7) (0) (1)
- 1 (0.8) (0) (1)
- 1 (0.9) (0) (1)
- 1 (1.0) (1) (1)
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement