[Làm quen OJ]. Bài 6. Hàm ceil, floor, round

View as PDF

Submit solution


Points: 1.00 (partial)
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Author:
Problem source:
28Tech
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Hàm ceil : làm tròn lên số nguyên gần nhất, floor : làm tròn xuống số nguyên gần nhất, round : làm tròn số nguyên phụ thuộc vào phần thập phân.

Cho số thực X nhiệm vụ của bạn là sử dụng 3 hàm trên để tìm số nguyên nhỏ hơn gần X nhất, số nguyên lớn hơn gần X nhất, số nguyên gần X nhất.

Lưu ý bạn cần in ra số nguyên nên không được in trực tiếp giá trị của 3 hàm này, nó sẽ là số thực.


Đầu vào

Dòng duy nhất chứa số thực X


Ràng buộc

1<=X<=10^6


Đầu ra

In ra 3 số trên 3 dòng


Ví dụ

Input 01
3.59
Output 01
3
4
4

Comments

Please read the guidelines before commenting.



  • -8
    le_anh_khoa2006  commented on Nov. 5, 2024, 8:18 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -22
    longhk2012  commented on May 26, 2024, 12:13 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -20
      nguyen_quoc_cuonghihi  commented on June 4, 2024, 4:41 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.