01./* 02 .* Program Copyright and version description section 03. * copyright (c) 2013, Yantai University Computer college student 04. * All rightsreserved. 05. * file name: salary. CPP 06. * Author: Zhao guanzhe 07. * Completion Date: April 8, June 14, 2013. * version: V1.0 09. * input Description: 10. * Problem description: 11. */# include <fstream> # include <iostream> # include <cstdlib> using namespace STD; int main () {double A [500], T; ifstream infile ("salary.txt", IOS: In); If (! Infile) {cerr <"failed to open the file! "<Endl; exit (1) ;}for (INT I = 0; I <500; I ++) {infile> A [I] ;} infile. close (); For (INT I = 0; I <500; I ++) {A [I] + = 1000;} For (Int J = 0; j <500; j ++) {for (int K = 0; k <500-j-1; k ++) {if (a [k + 1] <A [k]) {T = A [k + 1]; A [k + 1] = A [k]; A [k] = T ;}} for (INT I = 0; I <500; I ++) {cout <A [I] <Endl;} return 0 ;}
Running result: