Design ideasThe following rules can be seen according to the calculation:When buying 6 books, buying 5 and buying 1 is the lowest price.When buying 7 books, buying 5 sets and 2 sets is the lowest price.When buying 8 books, buying two sets of 4 is the lowest price.When buying 9 books, buying 5 sets and 4 sets is the lowest
) {//TODO auto-generated Method Stub intN=0; intN=0; intM=0; Scanner S=NewScanner (system.in); System.out.print ("Please enter the number of the book you want to buy:"); N=S.nextint (); if(n%5==3) {n=n/5; M=n%5; if(n==0) {System.out.println ("The lowest price the reader buys for a batch of books is:" + (3*8*0.9)); } Else{System.out.print
First, the topic requirementsBookstore for the "Harry Potter" series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, a single volume of 8 yuan, the specific discount is as follows:discount on this number2 5%3 10%4 20%5 25%depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule, for example, two volume 1, one volume 2, you can enjoy 5% discount, another
Title Requirements:A bookstore for the "Harry Potter" series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, a single volume of 8 yuan, the specific discount is as follows:Discount on this number2 5%3 10%4 20%5 25%Depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule, for example, two volume 1, one volume 2, you can enjoy 5% discount, another volume
A topic requirement:Bookstore for the "Harry Potter" series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, a single volume of 8 yuan, the specific discount is as follows: this number discount 2 5% 3 10% 4 20%5 25%depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule, for example, two volume 1, one volume 2, you can enjoy 5% discount,
Topic:Bookstore for the "Harry Potter" series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, a single volume of 8 yuan, the specific discount is as follows:Discount on this number2 5%3 10%4 20%5 25%Depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule, for example, two volume 1, one volume 2, you can enjoy 5% discount, another volume does not enjoy
the market, the Austrian Billiton has already killed Audi. Why is the cost of building a high-rise? More than the construction station market? All walks of life will have such problems, but imagine: eight pieces of Army Day pounds of beef you dare to buy, 50 yuan a gram of gold you dare to buy, 600 yuan an apple mobile phone you dare to buy it? 10,000 yuan BMW y
"NetEase Science and Technology News" July 1, Microsoft China today released the Chinese version of Windows 7, the price of some retail boxed products, including the lowest price of 399 yuan in the Home normal edition, and the family advanced version of the proposed retail price of 699 yuan. This is 20% lower than the
1. Title.The bookstore for the Harry Potter series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, said,A single reel is priced at $8, and the specific discount is as follows:Discount on this number2 5%3 10%4 20%5 25%Depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule,For example, if you purchase two volumes of Volume 1, one volume 2, you can enjoy
Design ideas:The lowest price of the first five books has been calculated, each additional book, the money spent will increase 8 7.2 6 4.4 or 4.4 yuan so the cycle downSource:ImportJava.util.Scanner; Public classMinmoney { Public Static voidMain (String args[]) {intBooknumber=0; DoubleMoney=0; Scanner in=NewScanner (system.in); System.out.print ("How many Harry Potter do you want to
First, the experimental topic:Bookstore for the "Harry Potter" series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, a single volume of 8 yuan, the specific discount is as follows:Discount on this number2 5%3 10%4 20%5 25%Depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule, for example, two volume 1, one volume 2, you can enjoy 5% discount, anothe
Bookstore for the "Harry Potter" series of books for promotional activities, a total of 5 volumes, with numbers 0, 1, 2, 3, 4, a single volume of 8 yuan, the specific discount is as follows:Discount on this number2 5%3 10%4 20%5 25%Depending on the number of volumes purchased and this number, different discount rules will be applicable. The singular book only corresponds to one discount rule, for example, two volume 1, one volume 2, you can enjoy 5% discount, another volume does not enjoy the di
First, design ideasWhen the number of books to buy more than five, want to make the cheapest price, it must be as far as possible to make the book into a set of books, that is, can be continuous sets, so that can be guaranteed to enjoy more discount concessions, so:When buying 6 books, choose the purchase method is: Five this set, plus a single book, 5+1;When buying 7 books, the choice of purchase method is
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.