--> The Greatest(beecrowd- 1013) URI 1013 Solution C, Python | Alpha Codist

Search This Blog

The Greatest(beecrowd- 1013) URI 1013 Solution C, Python

the greatest 1013 URI judge beecrowd bee crowd ab (a+b+abs(a+b))/2 abs() c programming solution python alpha codist coding problem solved .c .py

The Greatest

This problem is from beeCrowd. This is a simple program where you have to use a formula to get the largest number among three numbers.

The formula is:

For two numbers AB it will be-- (a+b+abs(a+b))/2

Note that here "abs()" is a function that gives you the absolute value of any number given in the input. With this, you will get a larger one between A and B. Put the value of this in a variable(ex: ab) and calculate again using the same formula. Just replace "a" with your variable and "b" with your third number. So the solution will be.

The solution in C:


#include <stdio.h>
 
int main() {
 
   int a,b,c;
   scanf("%d %d %d",&a,&b,&c);
   int ab = ((a+b)+abs(a-b))/2;
   int abc = ((ab+c)+abs(ab-c))/2;
   printf("%d eh o maior\n",abc);
   return 0;
}


The solution in Python:


import math

a, b, c = input().split(" ")

ab = (int(a) + int(b) + abs(int(a) - int(b)))  / 2
ab_c= (int(ab) + int(c) + abs(int(ab) - int(c)))/2

print("%d eh o maior" %ab_c)

COMMENTS

Name

beeCrowd,11,C,10,Computer,9,Downloads,3,HTML,1,My Creation,2,Python,24,Python-Soft,1,Shooting,2,
ltr
item
Alpha Codist: The Greatest(beecrowd- 1013) URI 1013 Solution C, Python
The Greatest(beecrowd- 1013) URI 1013 Solution C, Python
the greatest 1013 URI judge beecrowd bee crowd ab (a+b+abs(a+b))/2 abs() c programming solution python alpha codist coding problem solved .c .py
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge4ZGM1FnvhpVffK7FUk707u1h-D3UMhhuteYyjh1fExtEyuYaBgYY3TQPD-xt327bPxoOVwXrYvqLeE0rF90uLjLspHhYgAY-yUvC0UVR59LXOc2odFbmBV8-444ywzcQJ5dj8SzoHm3sUQp9deYthxhnrY4BEYVkcgLDK5ouMh0tyqo-J8-782S07w/w640-h422/1013.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge4ZGM1FnvhpVffK7FUk707u1h-D3UMhhuteYyjh1fExtEyuYaBgYY3TQPD-xt327bPxoOVwXrYvqLeE0rF90uLjLspHhYgAY-yUvC0UVR59LXOc2odFbmBV8-444ywzcQJ5dj8SzoHm3sUQp9deYthxhnrY4BEYVkcgLDK5ouMh0tyqo-J8-782S07w/s72-w640-c-h422/1013.png
Alpha Codist
https://alphacodist.blogspot.com/2022/11/the-greatestbeecrowd-1013-uri-1013.html
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/2022/11/the-greatestbeecrowd-1013-uri-1013.html
true
7547834254111195316
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content