看板 C_and_CPP 關於我們 聯絡資訊
※ 引述《crycry (哭哭)》之銘言: : 看起來不難的一題 : 測資也都OK 還是WA @@" : #include <iostream> : #include <cmath> : using namespace std; : int main() : { : double n; : double p; : while(cin >> n >> p){ : cout<< pow(p,(double)1/n)<<endl; : } : return 0; : } : thanks! 有個地方沒注意到的樣子, 給你我當初的測資: input: 2 16 3 27 7 4357186184021382204544 output: 4 3 1234 看看你能不能自己找出來? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.175.150.115
crycry:似乎是小數點問題 我加setiosflas setprecision就AC了 感謝 02/01 16:36
jtmh:恭喜囉! 02/02 00:40