看板Programming
標 題Re: c++ 求平方 我解不出來
發信站政大狂狷年少 (Fri Nov 10 13:27:55 2006)
轉信站ptt!ctu-reader!ctu-peer!news.nctu!news.cis.nctu!news.cs.nthu!WHSHS
※ 引述《[email protected] ( )》之銘言:
> #include<iostream>
> #include<cmath>
> using namespace std;
> void is_square(int num);
int 改 double
> int main()
> {
> int num;
int 改 double
> cout << "請輸入一個數字";
> cin >> num;
> cout << num << " is ";
> is_square(num);
> system("PAUSE");
> return 0;
> }
好像前面回答的板友都還沒修正這些部分,
所以幫忙補一下,
不然輸入像是 6.25 之類的東西會不正確。
--
Name: Tseng, Ling-hua E-mail Address:
[email protected]
School: National Tsing Hua University Department: Computer Science
Interesting: C++, Compiler, PL/PD, OS, VM, Large-scale software design
Researching: Undecided
Homepage:
https://it.muds.net/~uranus
--
╔═══╗ ┼────────────────────────╮
║狂狷 ║ │
* Origin:[ 狂 狷 年 少 ] whshs.cs.nccu.edu.tw ╰─╮
║ 年少║ ┼╮
< IP:140.119.164.252 > ╰─╮
╚╦═╦╝ ╰
* From:61-230-234-91.dynamic.hinet.net
─╨─╨─ KGBBS ─ ◎ 遨翔"BBS"的狂狷不馴;屬於年少的輕狂色彩 ◎