Đăng nhập để hỏi chi tiết


input:37
ouput:59500
làm code c++
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
\begin{array}{c} \color{#FFFFFFff}{H}\color{#E7E7E7ff}{o}\color{#CFCFCFff}{r}\color{#B7B7B7ff}{i}\color{#9F9F9Fff}{z}\color{#878787ff}{o}\color{#6F6F6Fff}{n} \end{array} $\\$
#include <bits/stdc++.h>
using namespace std;
int main() {
freopen("CAU2.INP", "r", stdin);
freopen("CAU2.OUT", "w", stdout);
long long n, s = 0;
cin >> n;
if (n <= 15)
s = n * 2000;
else if (n <= 30)
s = 15 * 2000 + (n - 15) * 1500;
else
s = 15 * 2000 + 15 * 1500 + (n - 30) * 1000;
cout << s;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll n,tt=0;
cin>>n;
if(n>30){
tt+=(n-30)*1000;
n=30;
}
if(n>15){
tt+=(n-15)*1500;
n=15;
}
if(n>0){
tt+=n*2000;
}
cout<<tt;
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
Bảng tin