# -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 09:16:38 2026

@author: student
"""

#%%
a= input("Podaj liczbe ")
a1 = float(a)

print("Liczba = ",a1)


#%%
a = float(input("Podaj liczbe a="))
print("Liczba a= ", a)

#%%

a = float(input("Podaj liczbe a="))
b = float(input("Podaj liczbe b="))
print("suma = ", a+b)


#%%

def WczytajLiczbe():
    a = float(input("Podaj liczbe a="))
    return a
    
    
x =WczytajLiczbe() 
print("Wartosc funkcji = ", x)   


#%%

def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
    
x = WczytajLiczbe("Podaj 1 liczbe=") 
y = WczytajLiczbe("Podaj 2 liczbe=") 
print("Suma liczb = ", x+y)   

#%%

def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a
    
    
a = WczytajLiczbe("Podaj parametr a =") 
b = WczytajLiczbe("Podaj parametr b =") 
x = WczytajLiczbe("Podaj wartosc x =")  

def FunkcjaLiniowa(a,b,x):
    f = a*x + b
    return f
f= FunkcjaLiniowa(a,b,x)
print('Wartosc funkcji =', f)
    
#%%

def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a

def FunkcjaLiniowa(a,b,x):
    f = a*x + b
    return f
    
def Wczytaj3Liczby():
    a = WczytajLiczbe("Podaj parametr a =") 
    b = WczytajLiczbe("Podaj parametr b =") 
    x = WczytajLiczbe("Podaj wartosc x =")  
    return a, b, x    

a,b,x =Wczytaj3Liczby()

f= FunkcjaLiniowa(a,b,x)
print('Wartosc funkcji =', f)

#%%

def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a

def FunkcjaKwadratowa(a,b,c,x):
    f = a*x*x + b*x + c
    return f
    
def Wczytaj4Liczby():
    a = WczytajLiczbe("Podaj parametr a =") 
    b = WczytajLiczbe("Podaj parametr b =")
    c = WczytajLiczbe("Podaj parametr c =")
    x = WczytajLiczbe("Podaj wartosc x =")  
    return a, b, c, x    

a,b,c,x =Wczytaj4Liczby()

f= FunkcjaKwadratowa(a,b,c,x)
print('Wartosc funkcji =', f)

#%%

def WczytajLiczbe(lancuch):
    a = float(input(lancuch))
    return a

def FunkcjaKwadratowa(a,b,c,x):
    f = a*x*x + b*x + c
    return f

def FunkcjaLiniowa(a,b,x):
    f = a*x + b
    return f
    
def Wczytaj4Liczby():
    a = WczytajLiczbe("Podaj parametr a =") 
    b = WczytajLiczbe("Podaj parametr b =")
    c = WczytajLiczbe("Podaj parametr c =")
    x = WczytajLiczbe("Podaj wartosc x =")  
    return a, b, c, x    

a,b,c,x =Wczytaj4Liczby()

f= FunkcjaLiniowa(a,b,x)
print('Wartosc funkcji liniowej=', f)


f= FunkcjaKwadratowa(a,b,c,x)
print('Wartosc funkcji kwadratowej=', f)