Solve of URI 1012 | (Area) Solution

Solve of URI 1012 (Area) in C & C++


Problem Description of URI Online Judge 1012:

Problem number: 1012.
Problem name: Area.
Problem level: 2.
Problem category: Beginner.
Points: 2.1 points
Base time limit: 1 second.
Memory limit: 200 MB.
Problem subject: Sequential.
Problem adapted by: Neilor Tonin (Brazil).
Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1012
Solution language: C & C++
My profile: https://www.urionlinejudge.com.br/judge/en/profile/38770


Solution of URI 1009 in C:


//URI online judge 1009 solution in C
//This solution is made and uploaded by Mehedi Hasan Kajol 
#include<stdio.h>
int main(void){
    double a, b, c;
    double triangle, circle, trapezium, square, rectangle;
    double PI=3.14159;
    scanf("%lf %lf %lf", &a, &b, &c);


    triangle = 0.5 * a * c;

    printf("TRIANGULO: %.3lf\n", triangle);

    circle = PI * c * c;

    printf("CIRCULO: %.3lf\n", circle);

    trapezium = (a+b) / 2.0 * c;

    printf("TRAPEZIO: %.3lf\n", trapezium);

    square = b * b;

    printf("QUADRADO: %.3lf\n", square);

    rectangle = a * b;
    printf("RETANGULO: %.3lf\n", rectangle);
    return 0;
}



Solution of URI 1009 in C:


//URI online judge 1009 solution in C
//This solution is made and uploaded by Mehedi Hasan Kajol 

#include<iostream>
using namespace std;
int main(void){
    double a, b, c;
    double triangle, circle, trapezium, square, rectangle;
    double PI=3.14159;
    cin >> a >> b >> c;


    triangle = 0.5 * a * c;
    printf("TRIANGULO: %.3lf\n", triangle);

    circle = PI * c * c;

    printf("CIRCULO: %.3lf\n", circle);

    trapezium = (a+b) / 2.0 * c;

    printf("TRAPEZIO: %.3lf\n", trapezium); 

    square = b * b;

    printf("QUADRADO: %.3lf\n", square);

    rectangle = a * b;
    printf("RETANGULO: %.3lf\n", rectangle);
    return 0;

}


Post a Comment

Previous Post Next Post