URI Online Judge Solution 1010 Simple Calculate – URI 1010 Solution in C, C++, Java, Python and C#
URI Online Judge Solution 1010 Simple Calculate | Beginner
URI Problem Link – https://www.urionlinejudge.com.br/judge/en/problems/view/1010
Problem Name: 1010 Simple Calculate code
Problem Number : URI – 1010 Simple Calculate solution
Online Judge : URI Online Judge Solution
Category: Beginner
Solution Language : C,C plus plus, java, python, c#(c sharp)
URI Solution 1010 Simple Calculate Code/ URI 1010 solution in C:
#include <stdio.h>
int main()
{
int a, b;
double c, res;
scanf("%d %d %lf", &a, &b, &c);
res = b * c;
scanf("%d %d %lf", &a, &b, &c);
res += b * c;
printf("VALOR A PAGAR: R$ %.2lfn", res);
return 0;
}
#include<stdio.h>
int main()
{
int p_code[2], p_u[2], i;
float price[2], pay;
for(i=0; i<2; i++)
{
scanf("%d %d %f",&p_code[i],&p_u[i],&price[i]);
}
pay=((price[0]*p_u[0])+(price[1]*p_u[1]));
printf("VALOR A PAGAR: R$ %.2fn", pay);
return 0;
}
URI Solution 1010 Simple Calculate Code / URI 1010 Simple Calculate solution in CPP:
#include <cstdio>
using namespace std;
int main(int argc, char const *argv[])
{
int a, b;
double c, res;
scanf("%d %d %lf", &a, &b, &c);
res = b * c;
scanf("%d %d %lf", &a, &b, &c);
res += b * c;
printf("VALOR A PAGAR: R$ %.2lfn", res);
return 0;
}
URI Solution 1010 Simple Calculate Code / URI 1010 Simple Calculate solution in Java:
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
int a, b;
double c, res;
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextDouble();
res = b * c;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextDouble();
res += b * c;
System.out.printf("VALOR A PAGAR: R$ %.2fn", res);
}
}
URI Solution 1010 Code / URI 1010 solution in Python:
linha1 = input().split(" ")
linha2 = input().split(" ")
cod1, qtde1, valor1 = linha1
cod2, qtde2, valor2 = linha2
total = (int(qtde1) * float(valor1)) + (int(qtde2) * float(valor2))
print("VALOR A PAGAR: R$ %0.2f" %total)
URI Solution 1010 Code / URI 1010 solution in C# (C Sharp):
URI Online Judge Solution 1010 Code Demonstration:
First take 3 values in store it in a result variable
Again take 3 value and now just increment the result variable. And solved, in C that is
scanf("%d %d %lf", &a, &b, &c);
res = b * c;
scanf("%d %d %lf", &a, &b, &c);
res += b * c;
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 Simple Calculate code in C, URI 1010 code in C++, URI Simple Calculate solution in C, URI solution, URI 1010 solution in C,URI 1010 solution in C++-CPP,URI 1010 solution in C# (C sharp),URI 1010 solution in Java,URI 1010 solution in Python,