Header Ads

Header ADS

1002 - Area of circle| URI Online Judge Solution | C | C++ | Python | Java

1002 - Area of circle | URI Online Judge:

1002 - Area of circle| URI Online Judge Solution
Main Problem Link - https://www.urionlinejudge.com.br/
Problem Name: Area of circle
Problem Number : URI Problem 1002
Solution Online Judge : URI Online Judge Solution
Level: Beginner
Solution Language : C | C++ | Python | Java 


 


Steps to Follow to Solve this Problem:

  • প্রথমে পাই এর মান ইনপুট নিতে হবে
  • বৃত্তের ক্ষেত্রফলের সূত্র একটি ভেরিয়েবলে লিখতে হবে 
  • প্রসেস করতে হবে । 

URI Solution 1001 Code in C++:

  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {    
  6.      double r,a = 0;  
  7.      cin>>r;    a = 3.14159 * r*r;
  8.     cout<<fixed<<setprecision(4)<<"A="<<a<<endl;
  9.     return 0;
  10. }


URI Solution 1001 Code in Python:

    1. class Student:
    2.     tStudent = 0
    3.  
    4.     def __init__(self, name, roll):
    5.         self.name = name
    6.         self.roll = roll
    7.         Student.tStudent += 1
    8.  
    9.     def display(self):
    10.         self.infoAboutClass()
    11.         print("Name: %s\nRoll: %s" % (self.name, self.roll))
    12.  
    13.     @staticmethod
    14.     def infoAboutClass():
    15.         print("=============== Student Information ===============")
    16.  
    17.     @classmethod
    18.     def totalStudent(cls):
    19.         print(cls.tStudent)


URI Solution 1001 Code in Java:

      1. public class HelloWorld {
      2.     public static void main(String[] args) {
      3.         // Write your code here
      4.     }
      5. }

No comments

Powered by Blogger.