--> Selection Test 1 (beeCrowd- 1035) URI 1035 Solution C, Python | Alpha Codist

Search This Blog

Selection Test 1 (beeCrowd- 1035) URI 1035 Solution C, Python

Selection Test 1 beeCrowd 1035 URI 1035 Solution C Python programming coding solution solved easy solution Read 4 integers and validate them with some

Selection Test 1

Selection Test 1 beeCrowd 1035 URI 1035 Solution C Python programming coding solution solved easy solution Read 4 integers and validate them with some


Read 4 integers and validate them with some conditions. After this, print if they are valid or not.

The formula is:

  1. Take input. 
  2. Check If b>c and d>a and c+d>a+b and c>0 and d>0 and a%2==0(If a is even) then print "Valores aceitos"
  3. If any of these conditions are not true then print "Valores nao aceitos"
  4. DON'T FORGET TO PUT NEWLINE CHARACTER(\n) AT THE END OF THE LINE EVERY TIME YOU PRINT SOMETHING. ELSE YOU WILL GET A PRESENTATION ERROR.


The solution in C:


#include <stdio.h>

int main() {
 
    int a,b,c,d;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    if(b>c && d>a && c+d>a+b && c>0 && d>0 && a%2==0){
        printf("Valores aceitos\n");
    } else{
        printf("Valores nao aceitos\n");
    }
 
    return 0;
}


The solution in Python:


a,b,c,d=map(int, input().split())
if b>c and d>a and c+d>a+b and c>0 and d>0 and a%2==0:
    print("Valores aceitos")
else:
    print("Valores nao aceitos")

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: Selection Test 1 (beeCrowd- 1035) URI 1035 Solution C, Python
Selection Test 1 (beeCrowd- 1035) URI 1035 Solution C, Python
Selection Test 1 beeCrowd 1035 URI 1035 Solution C Python programming coding solution solved easy solution Read 4 integers and validate them with some
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZbUdalrCuslDA2AG0t5KlWvrEK2btHzrymJ0-nj8cPoEZujSAzSQavRobV68BOceUs5wv6HzzeK1IuWoKaJCH30lBfpnsDuZBHzpRejqlGMvEC0hbqFBkUKgCxMxEYpUgqcKBClPwHz5BZpsCr5LYkY44mqM28tI3beQzYdvi-mKuxzvPH_S4P_P-Uw/w640-h422/1035.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZbUdalrCuslDA2AG0t5KlWvrEK2btHzrymJ0-nj8cPoEZujSAzSQavRobV68BOceUs5wv6HzzeK1IuWoKaJCH30lBfpnsDuZBHzpRejqlGMvEC0hbqFBkUKgCxMxEYpUgqcKBClPwHz5BZpsCr5LYkY44mqM28tI3beQzYdvi-mKuxzvPH_S4P_P-Uw/s72-w640-c-h422/1035.png
Alpha Codist
https://alphacodist.blogspot.com/2022/12/selectiontest11035.html
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/2022/12/selectiontest11035.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