ONLINE COMPILERS
LIBRARY
MANUAL PAGES & DOCS
CONTACT
Latest Users' Questions
User Submitted Source Code!
Description:
123
Language: C/C++
Code:
123
Language: C/C++
Code:
print("Vyber si Program")
print()
print("1=kalkulacka")
print("2=mnoziny")
print()
program = int(input("Zadaj kod programu: "))
if program == 1:
print()
print("KALKULACKA 1.0.")
print()
x = int(input("Zadaj x = "))
print()
print("vyber si poctovu operaciu:")
print("1 pre +")
print("2 pre -")
print("3 pre *")
print("4 pre /")
print("5 pre x na druhu (y zadaj 0)")
print("6 pre x na tretiu (y zadaj 0)")
print()
operacia = int(input("Zadaj cislo poctovej operacie: "))
print()
y = int(input("Zadaj y = "))
print()
def scitanie(x,y):
print(x+y)
def odcitanie(x,y):
print(x-y)
def nasobenie(x,y):
print(x*y)
def delenie(x,y):
print(x/y)
def na_druhu(x):
print(x*x)
def na_tretiu(x):
print(x*x*x)
print(v)
if operacia == 1:
scitanie(x,y)
elif operacia == 2:
odcitanie(x,y)
elif operacia == 3:
nasobenie(x,y)
elif operacia == 4:
delenie(x,y)
elif operacia == 5:
na_druhu(x)
elif operacia == 6:
na_tretiu(x)
print()
print ("x is y = " , end="")
print (x is y)
if program == 2:
a = [1]
b = [2]
c = [3]
d = [4]
#overenie mnozim
print()
print(" a b c d")
print(a,b,c,d)
print()
print ("a is b = " , end="")
print (a is b)
print ("a is c = " , end="")
print (a is c)
print ("a is d = " , end="")
print (a is d)
print ("b is c = " , end="")
print (b is c)
print ("b is d = " , end="")
print (b is d)
print ("c is d = " , end="")
print (c is d)
print()
e = int(input("Zadaj jeden prvok mnoziny e: "))
f = int(input("Zadaj jeden prvok mnoziny f: "))
print()
print ("f is e = " , end="")
print (f is e)
print ("f is not e = " , end="")
print (f is not e)
if program == 3:
print()
print()
print("1=kalkulacka")
print("2=mnoziny")
print()
program = int(input("Zadaj kod programu: "))
if program == 1:
print()
print("KALKULACKA 1.0.")
print()
x = int(input("Zadaj x = "))
print()
print("vyber si poctovu operaciu:")
print("1 pre +")
print("2 pre -")
print("3 pre *")
print("4 pre /")
print("5 pre x na druhu (y zadaj 0)")
print("6 pre x na tretiu (y zadaj 0)")
print()
operacia = int(input("Zadaj cislo poctovej operacie: "))
print()
y = int(input("Zadaj y = "))
print()
def scitanie(x,y):
print(x+y)
def odcitanie(x,y):
print(x-y)
def nasobenie(x,y):
print(x*y)
def delenie(x,y):
print(x/y)
def na_druhu(x):
print(x*x)
def na_tretiu(x):
print(x*x*x)
print(v)
if operacia == 1:
scitanie(x,y)
elif operacia == 2:
odcitanie(x,y)
elif operacia == 3:
nasobenie(x,y)
elif operacia == 4:
delenie(x,y)
elif operacia == 5:
na_druhu(x)
elif operacia == 6:
na_tretiu(x)
print()
print ("x is y = " , end="")
print (x is y)
if program == 2:
a = [1]
b = [2]
c = [3]
d = [4]
#overenie mnozim
print()
print(" a b c d")
print(a,b,c,d)
print()
print ("a is b = " , end="")
print (a is b)
print ("a is c = " , end="")
print (a is c)
print ("a is d = " , end="")
print (a is d)
print ("b is c = " , end="")
print (b is c)
print ("b is d = " , end="")
print (b is d)
print ("c is d = " , end="")
print (c is d)
print()
e = int(input("Zadaj jeden prvok mnoziny e: "))
f = int(input("Zadaj jeden prvok mnoziny f: "))
print()
print ("f is e = " , end="")
print (f is e)
print ("f is not e = " , end="")
print (f is not e)
if program == 3:
print()
Comments: