CB07 - Tính chu vi, diện tích hình tròn

View as PDF

Submit solution

Points: 1.00 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C#, C++, Go, Java, Pascal, Perl, PHP, PyPy, Python, Ruby, Rust, Scratch, Swift

Viết chương trình tính chu vi, diện tích của hình tròn. Bán kính ~r~ là một số thực được nhập từ bàn phím. Để đơn giản, chúng ta làm tròn giá trị ~ \pi = 3.14 ~.

Input

  • Một số thực là bán kính ~r~

Giới hạn:

  • ~ 0 < r < 1000 ~

Output

Lần lượt là chu vi và diện tích hình tròn cách nhau bởi 1 dấu cách. Kết quả làm tròn tới chữ số thập phân thứ 3

Sample

Input #1
0.5
Output #1
3.140 0.785

Comments

Please read the guidelines before commenting.



  • -2
    tmhp369  commented on May 16, 2025, 1:02 a.m.

    r = float(input()) if r <= 0 or r >= 1000: # Sửa điều kiện theo đúng đề bài: 0 < r < 1000 print("Khong hop le") else: pi = 3.14 s = pi * r * r chuvi = 2 * pi * r print(f"{chuvi:.3f} {s:.3f}") # code python nhá


  • -1
    hoang_vyz  commented on April 21, 2025, 7:04 a.m.

    Define Pi 3.14 và nhớ in 3 số thập phân nghen các bạn


  • -2
    giaminh2606  commented on Feb. 27, 2025, 8:37 a.m. edited

    mu a ha ha


  • 2
    Phanminhtai_hv  commented on Nov. 7, 2024, 10:55 a.m.

    chúc anh em làm tốt


  • -6
    sugardaddy  commented on Nov. 5, 2024, 3:43 a.m.

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


  • -6
    Chat_gpt  commented on Oct. 24, 2024, 2:41 a.m.

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


  • -1
    super_god  commented on Oct. 8, 2024, 2:34 a.m.

    hello ae


  • -5
    sugardaddy  commented on Nov. 2, 2024, 9:39 a.m.

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


  • -7
    sugardaddy  commented on Oct. 25, 2024, 9:39 a.m.

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


  • -1
    buiphuc  commented on July 26, 2024, 5:32 a.m.

    để học. Không nhẽ đang học C++ mà bắt phải dùng python à? cái ngta muốn là kiến thức chứ kh phải AC r để đấy


  • 1
    Ayaka  commented on May 11, 2024, 3:01 a.m.

    Thay float=long dc ko ban


    • 0
      minhducyl156  commented on May 27, 2024, 10:07 a.m.

      nếu dùng long thì dữ liễu xuất ra sẽ lớn và không nhỏ như float được bạn nhé


  • 0
    e5_tuan123  commented on Dec. 2, 2023, 8:39 a.m. edited

    lm đc nhưng nó cứ 0 á


  • -3
    taithikgirl  commented on Oct. 28, 2023, 2:26 a.m.

    hao no


  • -5
    hnghia  commented on Sept. 16, 2023, 2:39 a.m.

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


  • -5
    nguyenlehieuhoc  commented on Aug. 23, 2023, 1:54 a.m.

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


  • -3
    duongngocphuong  commented on May 14, 2024, 1:29 p.m.

    sao tui làm y vậy mà vẫn lỗi nhỉ huhu


  • -1
    newbie99  commented on July 18, 2023, 2:14 a.m.

    sao lỗi v ạ


    • -1
      TorikamiTedomi  commented on Sept. 13, 2023, 3:56 p.m.

      chac tai chua lam tron ay


  • -6
    Tung_IT  commented on July 4, 2023, 9:17 a.m.

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