Do the old question again (raise the salary again)

Source: Internet
Author: User
/* 02 .* Program Copyright and version description section 03. * copyright (c) 2013, Yantai University Computer college student 04. * All rightsreserved. 05. * file name: score. CPP 06. * Author: Liu Mingliang 07. * Completion Date: April 8, June 25, 2013. * version: V1.0 09. * input Description: 10. * Problem description: salary increase 12. * output: salary after increase. 13. */# include <fstream> # include <iostream> # include <cstdlib> using namespace STD; int main () {double A [500], T; int I, J; ifstream infile ("salary.txt", IOS: In); If (! Infile) {cout <"Open error! "<Endl; exit (1) ;}for (I = 0; I <500; I ++) infile> A [I]; infile. close (); for (I = 0; I <500; I ++) A [I] * = 2; for (j = 0; j <500; j ++) for (I = 0; I <500-j-1; I ++) if (a [I]> A [I + 1]) {T = A [I]; A [I] = A [I + 1]; A [I + 1] = T;} ofstream OUTFILE ("ordered_salary.txt", IOS: Out); If (! OUTFILE) {cout <"Open error! "<Endl; exit (1) ;}for (I = 0; I <500; I ++) {OUTFILE <A [I] <Endl; if (I % 7 = 0) cout <Endl; cout <A [I] <"\ t";} OUTFILE. close (); Return 0 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.