7-labaratoriya
1-topshiriq
Complex sinfidan foydalanib, kompleks sonlar inkrementini (prefiks (++i) va postfiks (i++) lar uchun) amalga oshiring.
#include
using namespace std;
int main(){
complexa(5,-3);
cout< cout<<++real(a)<<" "<<++imag(a);
return 0;
}
2-topshiriq
Valarray sinfidan foydalanib, massiv elementlarini o’sish tartibda saralang.
#include
using namespace std;
int main(){
int n,j=1;
valarrayvarr ={ 10, 25, 12,15};
n=varr.size();
int a[n];
for(auto i=begin(varr);i!=end(varr);i++){
a[j]=*i;
j++;
}
for(int i=0;i for(int i=0;i if(a[i+1]<=a[i]){
swap(a[i],a[i+1]);}}}
for(int i=0;i cout< }
Do'stlaringiz bilan baham: |