URI Online Judge Solution 1012 Area – URI 1012 Solution in C, C++, Java, Python and C#

URI Online Judge Solution 1012 Area | Beginner
URI Problem Link – https://www.urionlinejudge.com.br/judge/en/problems/view/1012

Problem Name: 1012 Area code
Problem Number : URI – 1012 Area solution
Online Judge : URI Online Judge Solution
Category: Beginner
Solution Language : C,C plus plus, java, python, c#(c sharp)

URI Online Judge Solution 1012 Area - URI 1012 Solution in C, C++, Java, Python and C#

URI Solution 1012 Area Code in C/ URI 1012 solution in C:

URI 1012 in simple way:
#include <stdio.h>

int
main()
{

double
a, b, c;

scanf("%lf %lf %lf", &a, &b, &c);
 printf("TRIANGULO: %.3lfn", (a * c) / 2);
printf("CIRCULO: %.3lfn", c * c * 3.14159);
printf("TRAPEZIO: %.3lfn", ((a + b) / 2) * c);
printf("QUADRADO: %.3lfn", b * b);
printf("RETANGULO: %.3lfn", a * b);

return
0;
}

URI 1012 in advanced way (Using while loop):

#include <stdio.h>
#define pi 3.14159
int main ()
{

float
a,b,c;
while
(scanf("%f %f %f",&a,&b,&c) != EOF)
{


printf ("TRIANGULO: %.3fn",.5*(a*c));
printf ("CIRCULO: %.3fn",pi*(c*c));
printf ("TRAPEZIO: %.3fn",.5*(a+b)*c);
printf ("QUADRADO: %.3fn",b*b);
printf ("RETANGULO: %.3fn",a*b);

}

return
0;

}

URI Solution 1012 Area Code / URI 1012 Area solution in CPP:

#include <cstdio>

int
main()
{

double
a, b, c;

scanf("%lf", &a);
scanf("%lf", &b);
scanf("%lf", &c);

printf("TRIANGULO: %.3lfn", (a * c) / 2);
printf("CIRCULO: %.3lfn", c * c * 3.14159);
printf("TRAPEZIO: %.3lfn", ((a + b) / 2) * c);
printf("QUADRADO: %.3lfn", b * b);
printf("RETANGULO: %.3lfn", a * b);

return
0;
}

URI Solution 1012 Area Code / URI 1012 Area solution in Java:

import java.util.Scanner;

public class
Main {

public static
void main(String[] args) {
double
a, b, c;

Scanner sc = new Scanner(System.in);
a = sc.nextDouble();
b = sc.nextDouble();
c = sc.nextDouble();

System.out.printf("TRIANGULO: %.3fn", (a * c) / 2);
System.out.printf("CIRCULO: %.3fn", c * c * 3.14159);
System.out.printf("TRAPEZIO: %.3fn", ((a + b) / 2) * c);
System.out.printf("QUADRADO: %.3fn", b * b);
System.out.printf("RETANGULO: %.3fn", a * b);

}

}

URI Solution 1012 Area Code / URI 1012 Area solution in  Python:

valor = input().split(" ")

a, b, c = valor
pi = 3.14159

triangulo = (float(a) * float(c))/2
circulo = pi * (float(c)* float(c))
trapezio = float(c) *(float(a) + float(b)) / 2
quadrado = float(b) * float(b)
retangulo = float(a) * float(b)


print("TRIANGULO: %0.3fnCIRCULO: %0.3fnTRAPEZIO: %0.3fnQUADRADO: %0.3fnRETANGULO: %0.3f" % (triangulo, circulo, trapezio, quadrado, retangulo))

URI Solution 1012 Area Code / URI 1012 Area solution in  C# (C Sharp):

Demonstration:

By the rules of all of the rectangles, just do this..
Just implement this in coding. Since having any problem just put a comment below. Thanks

Tags: URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI area code in C, URI 1012 Area code in C++, URI Area solution in C, URI solution, URI 1012 Area solution in C,URI 1012 Area solution in C++-CPP,URI 1012 Area solution in C# (C sharp),URI 1012 Area solution in Java,URI 1012 Area solution in Python,

By Maniruzzaman Akash

Maniruzzaman Akash is a freelance web developer with most popular Laravel PHP frameork and Vue JS

Leave a Reply

Your email address will not be published. Required fields are marked *