logo

Crowdly

Browser

Add to Chrome

Програмування мовою С++

Looking for Програмування мовою С++ test answers and solutions? Browse our comprehensive collection of verified answers for Програмування мовою С++ at e-learning.lnu.edu.ua.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Введіть один рядок коду, який знаходить і виводить максимальний елемент вектора

View this question

Введіть один рядок коду, який знаходить кількість входжень значення value у вектор і результат виводить на консоль

View this question

Введіть один рядок коду, для того, щоб змінити кожен елемент вектора, множачи його на 2.

View this question

Що відбудеться під час компіляції?

template<typename T>

T* ptr(T& x) { return &x; }

int main() {

int a = 5;

auto p = ptr(a);

}

View this question

Що надрукує програма?

#include <iostream>

template<typename T>

T mul(T a, T b) { return a * b; }

int main() {

std::cout << mul<double>(2, 4.5);

}

View this question

Яка причина помилки в цьому коді?

template<typename T>

class Box {

T value;

public:

Box(T v) : value(v) {}

};

int main() {

Box b(10);

}

View this question

Яке значення надрукує програма?

#include <iostream>

template<typename T>

struct Holder {

static int count;

};

template<typename T>

int Holder<T>::count = 0;

int main() {

Holder<int>::count = 3;

std::cout << Holder<int>::count;

}

View this question

Який результат виведе програма?

#include <iostream>

template<typename T>

T Max(T a, T b) {

return (a > b) ? a : b;

}

int main() {

std::cout << Max(2, 5);

}

View this question

Позначте всі коректні виклики для шаблону:

template<typename T>

T Min(T a, T b) { return (a < b) ? a : b; }

View this question
Зіставте поняття
View this question

Want instant access to all verified answers on e-learning.lnu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome