mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-09-07 12:10:40 +02:00
14 lines
252 B
C++
14 lines
252 B
C++
#include <iostream>
|
|
|
|
template <typename T, int N> void powtorz(const T &wartosc) {
|
|
for (int i = 0; i < N; i++) {
|
|
std::cout << wartosc;
|
|
}
|
|
std::cout << '\n';
|
|
}
|
|
|
|
int main() {
|
|
powtorz<char, 5>('*'); // *****
|
|
powtorz<int, 3>(7); // 7 7 7
|
|
}
|