|
許多人應該被債務或金錢上的問題壓得喘不過氣
往往走上不好的方向高利貸之類的..
今天分享一個好資訊給大家^^
免費諮詢專業人員
最快的時間解決你所遇到問題
解決你個人困難幫助你的問題
http://goo.gl/lKlJKd


首次購屋優惠房貸2015條件標題:
C語言 符號問題
發問:申請信用貸款
#include //將檔(stdio.h)引入程式#include //將檔(stdlib.h)引入程式void hnt(int n,int a,int b,int c); //宣告hnt函式原型int main(void) //主程式{int n; //宣告盤子n變數printf("Enter the starting number of disks:"); //印出字串scanf("%d",&n); ... 顯示更多 #include //將檔(stdio.h)引入程式 #include信貸利率低 //將檔(stdlib.h)引入程式 void hnt(int n,int a,int b,int c); //宣告hnt函式原型 int main(void) //主程式 { int n; //宣告盤子n變數 printf("Enter the starting number of disks:"); //印出字串 scanf("%d",&n); //使輸入的數值指定給變數n hnt(n,a,b,c); //呼叫遞迴函式 system("pause"); //暫停程式,直到按下任意一個按鍵 return 0; //離開函式 } void hnt(int n,int a,int b,int c) //遞迴函式 { if(n==1) //函式終止條件 printf("Disk%d:from feg%d to feg%d.\n",n,a,c); //將Disk1從Pega移到Pegc else { hnt(n-1,a,c,b); //使用hnt函式將上面的Disk(n-1)從Peg(a)移到Peg(b) printf("Disk%d:from feg%d to feg%d.\n",n,a,c); //將最下面的Disk(n)從Peg(a)移到Peg(c) hnt(n-1,b,a,c); //使用hnt函式再將Disk(n-1)從Peg(b)移到Peg(c) } } ------------------------------------------------------------------------------------------- 為什麼main裡面有一串是錯的 hnt(n,a,b,c); 他寫說 error C2065: 'a' : undeclared identifier 什麼意思... 我有看知識加別人的解答都是hnt(n,1,2,3); 可是這樣印出來是123 我想印出a.b.c 該怎麼改?? 更新: 可是我想要顯示的是Peg a --->英文 這樣子設會顯示數字耶
最佳解答:負債整合
你的a,b,c忘了宣告了,修改後就沒有問題了 #include //將檔(stdio.h)引入程式 #include //將檔(stdlib.h)引入程式 void hnt(int n,int a,int b,int c); //宣告hnt函式原型 int main(void) //主程式 { int n,a=1,b=2,c=3; //宣告盤子n變數 printf("Enter the starting number of disks:"); //印出字串 scanf("%d",&n); //使輸入的數值指定給變數n hnt(n,a,b,c); //呼叫遞迴函式 system("pause"); //暫停程式,直到按下任意一個按鍵 return 0; //離開函式 } void hnt(int n,int a,int b,int c) //遞迴函式 { if(n==1) //函式終止條件 printf("Disk%d:from feg%d to feg%d.\n",n,a,c); //將Disk1從Pega移到Pegc else { hnt(n-1,a,c,b); //使用hnt函式將上面的Disk(n-1)從Peg(a)移到Peg(b) printf("Disk%d:from feg%d to feg%d.\n",n,a,c); //將最下面的Disk(n)從Peg(a)移到Peg(c) hnt(n-1,b,a,c); //使用hnt函式再將Disk(n-1)從Peg(b)移到Peg(c) } } 2007-10-24 18:47:46 補充: 如果要變成印出來是a,b,c而不是1,2,3的話 就把原本a,b,c宣告的int型態改成char的型態,並且初始值都給a,b,c就可以了 void hnt(int n,char a,char b,char c); //宣告hnt函式原型 char a='a',b='b',c='c'; 2007-10-24 18:47:50 補充: void hnt(int n,char a,char b,char c) //遞迴函式 printf("Disk%d:from feg%c to feg%c.\n",n,a,c); //將Disk1從Pega移到Pegc printf("Disk%d:from feg%c to feg%c.\n",n,a,c); //將最下面的Disk(n)從Peg(a)移到Peg(c)
其他解答:
華南銀行個人信貸C9287EEA6517C6A4
|