Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- int mas[5];
- for (int i=0; i<5; i++) {cin >> mas[i];}
- int N;
- for(int x=1;x<N; x++) {
- int a=mas[x];
- int y=x;
- while((a<mas[y-1])&&(y>0)) {
- mas[y]=mas[y-1];
- y--;
- }
- mas[y]=a;
- }
- cout << "sakartots"<<endl;
- for (int i=0; i<5; i++) {cout << mas[i]<<endl;}
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement