Another method, I don't know if there is any error
橄榄枝之恋
橄榄枝之恋 2020-01-17 13:54:08
0
0
1048

public class SaveMoney {
/*** Xiaofang's mother gives her 2.5 yuan every day, and she will save it. Whenever she saves money on the 5th day or a multiple of the 5th day, she will spend 6 yuan. * Question: After how many days, can you save up to 100? Yuan * * Define the number of days, define the total amount of money money*/ public static void main(String[] args) {

int days=0;

double money = 0 ;

while(money<=100){

money =2.5;

days;

if(days%5==0){

                                                                                                                                                                                                                        # # }

System.out.println("Need" days "to save 100 yuan"); }

}

橄榄枝之恋
橄榄枝之恋

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!