URI-1035 Solve

Selection Test 1

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Read 4 integer values A, B, C and D. Then if B is greater than C and D is greater than A and if the sum of C and D is greater than the sum of A and B and if C and D were positives values and if A is even, write the message “Valores aceitos” (Accepted values). Otherwise, write the message “Valores nao aceitos” (Values not accepted).

Input

Four integer numbers A, B, C and D.

Output

Show the corresponding message after the validation of the values​​.
Input SampleOutput Sample
5 6 7 8Valores nao aceitos
2 3 2 6Valores aceitos

Problem link: https://www.urionlinejudge.com.br/judge/en/problems/view/1035

Solution:

  • [tab]
    • C++
      • #include <cstdio>
        
        #define SC4(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
        
        using namespace std;
        
        int main(int argc, char const *argv[])
        {
         int a, b, c, d;
         SC4(a, b, c, d);
        
         if((b > c) && (d > a) && (c + d > a + b) && c > 0 && c > 0 && (a % 2 == 0)) puts("Valores aceitos");
         else puts("Valores nao aceitos");
        
         return 0;
        }
3/Technology/post-list
Name

Codeforces,53,Problem Solve,90,Programming Tricks,1,URI,37,
ltr
item
DorHubs: URI-1035 Solve
URI-1035 Solve
DorHubs
https://dorhubs.blogspot.com/2019/08/uri-2035-solve.html
https://dorhubs.blogspot.com/
https://dorhubs.blogspot.com/
https://dorhubs.blogspot.com/2019/08/uri-2035-solve.html
true
9087637800571592252
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