看板 Programming 關於我們 聯絡資訊
※ 引述《jiannrong@kkcity.com.tw ( )》之銘言: : #include<iostream> : #include<cmath> : using namespace std; : void is_square(int num); : int m; ^^^ : m=sqrt(num); ^^^^^^^^^^^^ sqrt()是return double parameter也要是double或float http://www.cplusplus.com/ref/cmath/sqrt.html : if(m * m == num) : cout<<"是平方數"<<endl; : else : cout<<"不是平方數"<<endl; : } : 請問我這樣寫 語法上哪裡有錯呢 : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.218.176 ※ 編輯: buganini 來自: 140.114.218.176 (11/10 07:14)