Net and odd numbers



  • Hello, there's a question about one thing. Maybe who' helps decide?

    Target: 3 target numbers A, B, C♪ Determine whether there is at least one single and even one uneven among them. Chiss A, B, Cnot exceeding 10000 module. The format of output data. One line is "YES" or "NO."

    program Main;
    var
      a, b, c: longint;
    begin
      readln(a, b, c);
      if (a < abs(10000)) or (b < abs(10000)) or (c < abs(10000)) then
      begin
      if (not odd(a) or not odd(b) or not odd(c)) then writeln('YES')  
      else if odd(a) or odd(b) or odd(c) then writeln('NO')
      end
      else writeln('input error!')
    end.
    

    That's what I've got so far, the solution ended up partially correct (if you believe the test system) :

    Oh, yeah, there's another job I don't know how to deal with:

    Number X. This number should be transferred to the Roman computing system. Input file format: Number X in the decimal system (1 ≤ X 100). Discharge file format: Get X in the Roman computation system.

    It's not have to be written, I'm in principle representing how to deal with it. caseI don't know Roman numbers.



  • Either rewrite the condition in the forehead, overtake all the variables, or cut down:

    if odd(a+b) and odd(a+c) and odd(b+c)) then writeln('NO')   
    else writeln('YES')
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2