Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- template <typename T>
- void display(T arr[], int size) {
- for (int i = 0; i < size; i++) {
- cout << arr[i] << " ";
- }
- cout << endl;
- }
- void display(char arr[], int size) {
- for (int i = 0; i < size; i++) {
- cout << arr[i];
- }
- cout << endl;
- }
- int main() {
- setlocale(LC_ALL, "ru");
- int arr[]{ 1, 3, 7, -4, -2, 4 };
- int size = 6;
- display(arr, size);
- double arr2[]{ 3.5, 2.5, 3.7, 1.0, 3.3, 7.2 };
- display(arr2, size);
- char arr3[]{ 'П','р','и','в','е','т' };
- display(arr3, size);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement