Re: [問題] 錯在哪??????
※ 引述《stevevai (GOD)》之銘言:
: 第一次用遞迴寫了a的b次方的程式~~~~
: import javax.swing.JOptionPane;
: public class REC
: {
: public static void main(String args[])
: {
: // int a;
: //int b;
: a=Integer.parseInt(JOptionPane.showInputDialog(null, "底數"));
: b=Integer.parseInt(JOptionPane.showInputDialog(null, "指數"));
: JOptionPane.showMessageDialog(null,fac(a,b));
^ ^
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 這段錯在哪???這邊一直說我錯 = =
錯誤訊息應該會告訴你 cannot find symbol
去查查這段錯誤訊息的意思吧
: }
: public static int fac(int a,int b)
: {
: if(b==1)
: return a;
: else
: return a*fac(a,b-1);
: }
: }
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the complier will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.pratice()); | Bone everything
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.138.240.58
java 近期熱門文章
PTT數位生活區 即時熱門文章