Description
啤酒每罐2.3元,饮料每罐1.9元。小明买了若干啤酒和饮料,一共花了s元。 我们还知道他买的啤酒比饮料的数量少,请你计算他买了几罐啤酒。
Input
输入数据有多组,每组占一行,包含小明买东西花的总钱数s。
Output
每行一组数据,输出小明买了多少罐啤酒。
Sample Input
82.3
Sample Output
#include<iostream>usingnamespacestd;intmain(){doubles;while(cin>>s){for(inti = 1; i * 2.3 <= s; i++)for(intj = i + 1; i * 2.3 + j * 1.9 <= s; j++){if(i * 2.3 + j * 1.9 >= s - 0.000001 && i * 2.3 + j * 1.9 <= s + 0.000001)cout<<i<<endl;} }return0;}/**************************************************************Problem: 2505User: 201358505136Language: C++Result: AcceptedTime:4 msMemory:1268 kb****************************************************************/