1-6-03: Calculating the book fee

Source: Internet
Author: User

Describe

Below is a price list for a book:
Introduction to calculation 28.9 yuan/book
Data structure and algorithm 32.7 yuan/This
Digital logic 45.6 yuan/This
C + + Programming tutorial 78 yuan/Book
Ai 35 Yuan/This
Computer architecture 86.2 Yuan/This
Compilation principle 27.8 Yuan/this
Operating system 43 Yuan/This
Computer network 56 Yuan/This
Java programming 65 Yuan/This
Given the quantity purchased for each type of book, the total cost to be calculated is programmed.

Input
Enter a row, containing 10 integers (greater than or equal to 0, less than or equal to 100), respectively, the purchase of "Introduction to Computing", "Data structure and algorithm", "Digital Logic", "C + + Programming Tutorial", "Artificial Intelligence", "Computer Architecture", "Compiling principle", "Operating system", " Computer network, the number of Java programming (in this unit). Each of the two integers is separated by a single space.
Output
The
output line contains a floating-point number F, which represents the total cost to be met. Accurate to one digit after the decimal point.
Sample input
1 5 8 10 5 1 1 2 3 4
Sample output
2140.2
1#include <stdio.h>2 intMain ()3 {4     inta[ One]={0};5     floatC=0;6      for(intI=1; i<=Ten; i++)7scanf"%d",&a[i]);8C=28.9*a[1]+32.7*a[2]+45.6*a[3]+ +*a[4]+ **a[5]+86.2*a[6]+27.8*a[7]+ +*a[8]+ About*a[9]+ $*a[Ten];9printf"%.1f\n", c);Ten     return 0; One}

1-6-03: Calculate the book fee

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.