Tuesday 11 August 2015

A sample Python Program for Reference work ( Life Universe Everything )

  1. def main():
  2. while True:
  3. w=input()
  4. if w==42:
  5. break
  6. else :
  7. print w
  8. main()
-----------------------------------------------------------------------------------------=============================================================================================

I. Yet another A + B codeforces

def main():

            a=int(input())
            b=int(input())
            c=int(input())
           

            if a+b == c:
                print("YES")
            elif a+a == c:
                print("YES")
            elif b+b == c:
                print("YES")
            elif 2*c == b:
                print("YES")
            elif 2*a == b:
                print("YES")
            elif a+c == b:
                print("YES")
            elif 2*c == a:
                print("YES")
            elif 2*b == a:
                print("YES")
            elif c+b == a:
                print("YES")
            else:
                print("NO")

main()

No comments:

Post a Comment

Uploading and Running Lambda function in AWS

Main.go package main import ( "fmt" "encoding/json" "log" "github.com/aws/aws-lambda-g...