#include <iostream> #include <map> using namespace std; map<float, int> mymap; //这里为啥不能用double啊,结果和答案不一样 int main() { int count = 0; for(int i = 0; i <= 5; i++){ for(int j = 0; j <= 4; j++){ for(int k = 0; k <= 6; k++){ float value = 0.8 * i + 1 * j + k * 1.8; if(mymap[value] == 0){ mymap[value]++; count++; } } } } printf("%d", --count); } // 64 位输出请用 printf("%lld")