1-vazifa
8. Ikki xonali raqam berilgan. Raqamlarini o’rnini almashtirishda paydo bo’lgan raqamni uning kvadratini chiqaring.
#include using namespace std;
int main(){
int n,q1,q2,q3;
cout<<" Sonni kiriting: ";
cin>>n;
q1=n/10;
q2=n%10;
q3=q2*10+q1;
q3=q3*q3;
cout<<" Natija: "<cout<return main();
}
8. N o’lchamli massiv berilgan. Undagi 3 ga qoldiqsiz bo’linadigan elementlarini yangi vektorga yozing
#include using namespace std;
int main(){
srand(time(0));
int n;
cout<<" n = "; cin>>n;
int son[n]; vector g1;
for(int i=0; ison[i]=rand()%25+1;
}
for(int i=0; icout<} cout<int q1,q2,q3;
for(int i=0; iif(son[i]%3==0) g1.push_back(son[i]);
} cout<<" New vektor: ";
for (auto i = g1.begin(); i != g1.end(); ++i)
cout << *i << " ";
cout<return main();
}