mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-10-28 11:10:38 +01:00
bla bla
This commit is contained in:
9
uczelnia/2_semestr/programowanie/laby/lab12/zad3.cpp
Normal file
9
uczelnia/2_semestr/programowanie/laby/lab12/zad3.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
|
||||
template <typename T> T srednia(T a, T b) { return (a + b) / 2; }
|
||||
|
||||
int main() {
|
||||
std::cout << srednia(3, 4) << std::endl; // co się wypisze? 3
|
||||
std::cout << srednia(3.0, 4.0) << std::endl; // co się wypisze? 3.5
|
||||
std::cout << srednia<double>(3, 4.0) << std::endl; // 3.5
|
||||
}
|
||||
Reference in New Issue
Block a user