#include <bits/stdc++.h> using namespace std; int main(){     int n;     double price;     while(cin>>n>>price)     {            double s1, s2;         if (n >= 3)             s1 = (n)*price*0.7+10;         else             s1 = n*price+10;         s1 = s1 > 50 ? s1 - 10 : s1;         s2 = n*price - n*price / 10 * 2+6;         s2 = s2 > 99 ? s2 - 6 : s2;         s1 = (int)(s1 * 100 + 0.5) / 100.0;         s2 = (int)(s2 * 100 + 0.5) / 100.0;         cout << s1 <<"fd" <<s2 << endl;         if (s1 > s2)             cout << 2 << endl;         else if (s1 < s2)             cout << 1 << endl;         else if (s1 == s2)             cout << 0 << endl;     }     return 0; }
点赞 1

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务