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 <vector>
using namespace std;
int main(){
vector<int> v={1,2,3,4}; v.erase(v.begin()+2); for(int x:v) cout<<x;
return 0;
}
Що буде виведено в результаті виконання коду?
Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.
#include <iostream>
#include <vector>
using namespace std;
class Address{public:string city; Address(string c):city(c){} }; class Person{Address* a; public:Person(Address* x):a(x){} void print(){cout<<a->city;} };
int main(){
Address ad("Lviv"); Person p(&ad); ad.city="Kyiv"; p.print();
return 0;
}
Що буде виведено в результаті виконання коду?
Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> v={3,1,2}; v.push_back(4); cout<<v.size()<<v[0]<<v[3];
return 0;
}
Що буде виведено в результаті виконання коду?
Введіть відповідь точно так, як її виведе програма, без додаткових пробілів.
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main(){
vector<int> v={1,2,2,3}; cout<<count(v.begin(),v.end(),2);
return 0;
}