Circle


Submit solution


Points: 1 (partial)
Time limit: 1.0s
Memory limit: 98M

Problem types
Allowed languages
Ada, Assembly, Awk, C, C++, C11, CLANG, CLANGX, Classical, COBOL, Coffee, CSC, D lang, DART, F95, FORTH, Fortrn, GAS32, GO, Haskell, Itercal, Java, kotlin, LEAN, LISP, LUA, MONOVB, Nasm, OCAML, Pascal, Perl, php, PIKE, prolog, Pypy, Python, Ruby 2, RUST, Scala, SCM, SED, SWIFT, TCL, TUR, V8JS, VB, ZIG

Enter the real number as the radius R of a circle. calcule circumference and the area of that circle with the precision of 2 digits after the decimal point, in case R <0, print " NO CIRCLE ”.

Input:

A line of a real number R

Output:

Either 1 result "NO CIRCLE" or two lines corresponding to the circumference, the area of the circle is rounded to 2 digits after the decimal point.

Example 1:

Input:

-3.5

Output:

NO CIRCLE

Example 2:

Input:

3.0

Output:

18.85

28.27

utc

Comments


  • 0
    TuanKiet_HUSC  commented on Nov. 13, 2023, 12:05 p.m.

    test yếu quá


  • 0
    Kien  commented on Sept. 6, 2021, 9:56 a.m.

    include<stdio.h>

    include<iostream>

    using namespace std;

    int main(){

    int r;
        cout<<"nhap R: ";
        cin>> r;
    
    if(r<0){
        cout<<"NO CIRCLE";
    }
        else{
    
            float s;
            float p;
    
            p= 3.14*2*r;
            s= 3.14 * r*r;
    
            cout<<"p= "<< p <<" " <<"s= "<<s;
    
        }
    return 0;

    }


  • 0
    Tranthanh  commented on Jan. 13, 2019, 2:14 p.m.

    include<iostream>

    using namespace std;

    int main()

    {

    float n,cv,dt;
    cin>>n;
    
    if(n >= 0)
    {
        cv = 2 * 3.14 * n;
        dt = 3.14 * n * n;
        cout<<cv<<endl<<dt<<endl;
    }
    else
    {
        cout<<"NO CIRCLE";
    }
    return 0;

    }