#31063: 請問一下各位高手，為什麼我在第三個測資無法ＡＣ（50%)

#### jason096727@gmail.com (Jason Ho)

School : 高雄市苓雅區福東國民小學
ID : 189939
2023-07-15 21:32:51
a647. 投資專家 | From: [150.116.71.227] | Post Date : 2022-07-09 15:36

#include <bits/stdc++.h>

using namespace std;

int main()
{
int n;
while (cin >> n){
float m, p;
for (int i=1; i<=n; i++){
cin >> m >> p;
float x=(p-m)/m*100;
cout << fixed << setprecision(2) << x << '%' << " ";
if (x>=10 || x<=-7){
cout << "dispose" << endl;
}
else {
cout << "keep" << endl;
}
}
}

return 0;
}

#31089: Re: 請問一下各位高手，為什麼我在第三個測資無法ＡＣ（50%)

#### cges30901 (cges30901)

School : No School
ID : 30877
2023-12-03 22:42:14
a647. 投資專家 | From: [39.9.78.186] | Post Date : 2022-07-10 16:31

#include

using namespace std;

int main()
{
int n;
while (cin >> n){
float m, p;
for (int i=1; i<=n; i++){
cin >> m >> p;
float x=(p-m)/m*100;
cout << fixed << setprecision(2) << x << '%' << " ";
if (x>=10 || x<=-7){
cout << "dispose" << endl;
}
else {
cout << "keep" << endl;
}
}
}

return 0;
}

#31113: Re: 請問一下各位高手，為什麼我在第三個測資無法ＡＣ（50%)

#### jason096727@gmail.com (Jason Ho)

School : 高雄市苓雅區福東國民小學
ID : 189939
2023-07-15 21:32:51
a647. 投資專家 | From: [150.116.71.227] | Post Date : 2022-07-12 17:08

#include

using namespace std;

int main()
{
int n;
while (cin >> n){
float m, p;
for (int i=1; i<=n; i++){
cin >> m >> p;
float x=(p-m)/m*100;
cout << fixed << setprecision(2) << x << '%' << " ";
if (x>=10 || x<=-7){
cout << "dispose" << endl;
}
else {
cout << "keep" << endl;
}
}
}

return 0;
}

ZeroJudge Forum