URI Online Judge 1005 | (Average 1) Solution

Solve of URI 1005 (Average 1) in C & C++


Problem Description of URI Online Judge 1005:


Problem number:
1005.
Problem name: Average 1.
Problem level: 2.
Problem category: Beginner.
Points: 2.4 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/1005
Solution language: C & C++
My profile: https://www.urionlinejudge.com.br/judge/en/profile/38770


Solution of URI 1005 in C: 


//URI online Judge 1005 solution in C
//This solution is made and uploaded by Mehedi Hasan Kajol 
#include<stdio.h>
int main(void){
     float a, b, average;
     scanf("%f%f", &a, &b);
     average =( a * 3.5 + b * 7.5 ) / 11.0;
     printf("MEDIA = %.5f\n", average);
     return 0;
}
 


Solution of URI 1005 in C++: 


//URI online Judge 1005 solution in C++
//This solution is made and uploaded by Mehedi Hasan Kajol 
#include<iostream>

using namespace std;
int main(void){
     float a, b, average;
     cin >> a >> b;
     average=( a * 3.5 + b * 7.5 ) / 11.0;
     printf("MEDIA = %.5f\n", average); //printf(); for precision.
     return 0;
}


Post a Comment

Previous Post Next Post