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 Wheel{public:Wheel(){cout<<"W";} }; class Bike{Wheel w1,w2; public:Bike(){cout<<"B";} };

int main(){

Bike b;

return 0;

}

View this question

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

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

#include <iostream>

#include <deque>

using namespace std;

int main(){

deque<int> d={1,2,3}; d.pop_front(); cout<<d.front()<<d.back();

return 0;

}

View this question

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

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

#include <iostream>

#include <vector>

#include <algorithm>

#include <numeric>

using namespace std;

int main(){

vector<int> v={1,2,3,4}; auto it=remove(v.begin(),v.end(),2); v.erase(it,v.end()); for(int x:v) cout<<x;

return 0;

}

View this question

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

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

#include <iostream>

#include <stack>

#include <queue>

#include <vector>

#include <functional>

#include <string>

using namespace std;

int main(){

priority_queue<int> pq; for(int x:{4,2,7}) pq.push(x); while(!pq.empty()){cout<<pq.top(); pq.pop();}

return 0;

}

View this question

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

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

#include <iostream>

using namespace std;

class A{public: virtual void f(){cout<<"A";}}; class B:public A{public:void f(){cout<<"B";}}; class C:public B{public:void f(){cout<<"C";}};

int main(){

C c; A* p=&c; p->f();

return 0;

}

View this question

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

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

#include <iostream>

using namespace std;

class A{public: virtual int f(){return 1;}}; class B:public A{public:int f(){return A::f()+2;}};

int main(){

B b; A& r=b; cout<<r.f();

return 0;

}

View this question

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

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

#include <iostream>

#include <vector>

using namespace std;

class CPU{public:int cores; CPU(int c):cores(c){} }; class PC{CPU& cpu; public:PC(CPU& c):cpu(c){} int get(){return cpu.cores;} };

int main(){

CPU cpu(4); PC pc(cpu); cpu.cores=8; cout<<pc.get();

return 0;

}

View this question

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

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

#include <iostream>

#include <set>

#include <map>

#include <string>

#include <functional>

using namespace std;

int main(){

multimap<string,int> mm; mm.insert({"A",1}); mm.insert({"A",2}); cout<<mm.count("A");

return 0;

}

View this question

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

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

#include <iostream>

#include <deque>

using namespace std;

int main(){

deque<int> d={2,3}; d.push_front(1); d.push_back(4); for(int x:d) cout<<x;

return 0;

}

View this question

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

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

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<int> v(3,7); cout<<v[0]<<v.size();

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