答案
2026-04-25 21:17:43
发布于:吉林
8阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
double total = 0; // 改成double
double price;
while(1){
cin >> price;
if(price == 0) break;
total += price;
}
double pay;
if(total > 100){
pay = 100 + (total - 100) * 0.9;
} else {
pay = total;
}
printf("%.3f", pay);
return 0;
}
全部评论 1
666
#include<bits/stdc++.h> using namespace std; int main(){ double total = 0; // 改成double double price; while(1){ cin >> price; if(price == 0) break; total += price; } double pay; if(total > 100){ pay = 100 + (total - 100) * 0.9; } else { pay = total; } printf("%.3f", pay); return 0; }1周前 来自 吉林
0




有帮助,赞一个