#include<iostream> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <cmath> using namespace std; int main() { int s1[100]; int n; n = 10; int temp; for (int i = 0; i < 10; i++) { scanf("%d", &s1[i]); } for (int i = 0; i < 10; i++) { for (int j = i+1; j < 10; j++) { if (s1[i] > s1[j]) { temp = s1[i]; s1[i] = s1[j]; s1[j] = temp; } } printf("%d\n", s1[i]); } return 0; } |
Double click to view unformatted code.