Re: c++ 求平方 我解不出來
※ 引述《jiannrong@kkcity.com.tw ( )》之銘言:
> #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: uranus@it.muds.net
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"的狂狷不馴;屬於年少的輕狂色彩 ◎
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章