realloc () funksiyasidan foydalanib xotirani dinamik taqsimlashni amalga oshiring .
#include using namespace std;
int main(){
cout<<"Toplamlarni teng yoki teng emasligini tekshirish:\n";
int x;
vectora;
int b[]={15,10,20};
cin>>x;
a.push_back(x);
cin>>x;
a.push_back(x);
cin>>x;
a.push_back(x);
if(equal(a.begin(),a.end(),b)){
cout<<"To'plamlar bir biriga teng! ";
}
else
cout<<"To'plamlar bir biriga teng emas! ";
return 0;}
#include
#include using namespace std;
int main()
{
vectora;
vector::iterator itr;
int n,x;
cin>>n;
for(int i=0;icin>>x;
a.push_back(x);
}
for( itr=a.begin();itr!=a.end();itr++){
cout<<*itr+*itr<<" ";
}
return 0;}