Solve of URI 1013 | (The Greatest) Solution

Solve of URI 1013 (The Greatest) in C & C++


Problem Description of URI Online Judge 1013:


Problem number: 1013.
Problem name: The Greatest.
Problem level: 3.
Problem category: Beginner.
Points: 3.3 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/1013
Solution language: C & C++
My profile: https://www.urionlinejudge.com.br/judge/en/profile/38770



Solution of URI 1013 in C:


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

#include <stdio.h>
int main() {
    int i, greatest=0;
    int numbers[3];
    for( i=0 ; i<3  ;i++){
        scanf(" %d ", &numbers[i]);
        if( numbers[i] > greatest)
             greatest = numbers[i];
    }
    printf("%d eh o maior\n", greatest);
    return 0;
}



Solution of URI 1013 in C:


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

#include <iostream>
using namespace std;
int main() {
    
int numbers[3];
    for( int i=0 ; i<3  ;i++)
        cin >> numbers[i];
    int greatest = max( numbers[0], max( numbers[1], numbers[2] ));
    cout << greatest << " eh o maior" << endl;
    return 0;
}


Post a Comment

Previous Post Next Post