Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Cao Beijian
- Result: AC Submission_id: 4276984
- Created at: Tue Apr 05 2022 12:42:13 GMT+0800 (China Standard Time)
- Problem: 5493 Time: 25 Memory: 1744
- */
- #include <stdio.h>
- int main(){
- double a[1024] = { 0 }, tmp;
- int n, i, j;
- scanf("%d", &n);
- for(i = 0; i < n; i++){
- scanf("%lf", a + i);
- }
- for(i = 0; i < n; i++){
- for(j = i + 1; j < n; j++){
- if(a[i] > a[j]){
- tmp = a[i]; a[i] = a[j]; a[j] = tmp;
- }
- }
- }
- for(i = 0; i < n; i++){
- printf("%.5f\n", a[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment