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!

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <string>

using namespace std;

class Header{public:int n=3;}; class Packet{Header h; public:int size(){return h.n+7;} };

int main(){

Packet p; cout<<p.size();

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <vector>

#include <list>

#include <deque>

#include <set>

#include <map>

#include <iterator>

#include <algorithm>

using namespace std;

int main(){

vector<int> v={1,2}; auto it=back_inserter(v); *it=3; for(int x:v) cout<<x;

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <set>

#include <map>

#include <string>

#include <functional>

using namespace std;

int main(){

map<int,int> m={{1,10},{2,20}}; m.erase(1); cout<<m.size()<<m[2];

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

using namespace std;

struct A {

protected:int a=3; public:int getA(){return a;}

};

struct B : public A {

int b=4; public:int sum(){return getA()+b;}

};

int main() {

B obj;

cout<<obj.sum();

return 0;

}

View this question

Який буде результат виконання цього коду?

Введіть відповідь точно так, як зазначено у варіантах екзамену.

#include <iostream>

#include <stdexcept>

using namespace std;

int main() {

int age = -1;

if (age < 0) throw invalid_argument("bad age");

cout << age;

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <vector>

#include <algorithm>

#include <numeric>

using namespace std;

int main(){

vector<int> v={4,2,7}; cout<<*max_element(v.begin(),v.end());

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

using namespace std;

struct P {

int x=5; public:void g(){cout<<"P"<<x;}

};

struct Q : public P {

public:void g(){cout<<"Q"<<x;}

};

int main() {

Q obj;

obj.g();

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <stack>

#include <queue>

#include <vector>

#include <functional>

#include <string>

using namespace std;

int main(){

queue<int> q; q.push(1); q.push(2); cout<<q.front()<<q.back();

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<int> v={1,2,3}; v.insert(v.begin()+1,9); for(int x:v) cout<<x;

return 0;

}

View this question

Що буде виведено в результаті виконання коду?

Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.

#include <iostream>

#include <vector>

#include <algorithm>

#include <numeric>

using namespace std;

int main(){

vector<int> v={1,2,3}; reverse(v.begin(),v.end()); for(int x:v) cout<<x;

return 0;

}

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