15-variat
15. Talabalarni ikkinchi imtihoni natijasi bo‘yicha pasaish ketma-ketlik tartibida.
#include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cout<<"talabalar sonini kiriting ";cin>>n;
int a[n];
for (int i=1;i{cout<>a[i];
}cout<<" talabalarning 2 imtixon natijalari";
for(int i=1;i{
cout<
}
cout<<" \n ";
int Temp,i,j;
for(i=1; i{
Temp = a[i];
j = i-1;
while(Temp<=a[j] && j>=0)
{
a[j+1] = a[j];
j = j-1;
}
a[j+1] = Temp;
}cout<<" imtixon natijalari ketma ketligi_";
for(i=1; i{
cout<}cout<<" \n ";
cout<<"imtixon natijalari pasayish ketma ketligi_ ";
for(i=n; i>0; i--)
{
cout<}cout<<" \n ";
return main();
}
Boshlash
Dasturning block sxemasi c++ da ko`rinishi
Int n;
cout<<"talabalar sonini kiriting ";cin>>n;
Int a[n];
int Temp,i,j;
Insection sort
C++ masala taxlili
I
Temp<=a[j] && j>=0
cout<>a[i];
folse
true
a[j+1]=a[j];
j = j-1;
I
Natija:
cout<
I
cout<<" imt N_";
cout<
Do'stlaringiz bilan baham: |