fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. double x;
  8. cin >> x;
  9.  
  10. // Tìm số nguyên lớn nhất bé hơn hoặc bằng x
  11. int lower = floor(x);
  12.  
  13. // Tìm số nguyên nhỏ nhất lớn hơn x
  14. int upper= lower + 1;
  15.  
  16. cout << lower << " " << upper << endl;
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
0 1