急求!!語法無誤但case2執行出錯!懷疑huffmancoding有問題!求改正

2022-09-17 13:05:24 字數 1028 閱讀 3967

1樓:滄海雄風

你少了兩個括號

最討厭把大括號放右邊

#include

#include

#include

#define maxsize 20

#define maxvalue 1000

typedef struct htnode, * huffmantree;

typedef char * * huffmancode;

huffmantree ht;

huffmancode hc;

char a[maxsize];

int w[maxsize];

int n;

void select(huffmantree ht,int i,int s1,int s2)

for(;i<=m;++i)

for(i=n+1;i<=m;++i)

//——————逆向求編碼

hc=(huffmancode )malloc((n+1) * sizeof(char *));

cd=(char * )malloc(n * sizeof(char));

cd[n-1]='\0';

for(i=1;i<=n;i++)

free(cd);

}void choice()

case 2:

printf("\n");

huffmancoding(ht,hc,n);

printf("\n");

printf("已建哈夫曼樹");

printf("\n");

printf("\n");

printf(" 請選擇(1,4,5):");

choice();

break;

}//其中1是輸入字符集大小,2、3為輸入名字和權值並建立哈夫曼樹

} //這個

} //還有這個

void main()

2樓:交換魅惑

好像沒有錯,看看是不是符號的問題,

sql語句 急,求sql語法

同意上面的思路,不過應該寫成這樣 select year,sum case when month 1 then amount else 0 end as m1,sum case when month 2 then amount else 0 end as m2,sum case when month...

急!求翻譯這句話,無語法錯誤

你認為學校應該培養怎麼樣的學生?how do you think that school should cultivate their students in your opinion how should the school train their students how do you thi...

求藏頭詩 挺難,但急

七言律詩四聯為常態 故改藏頭如下 七言藏頭 我愛小寶 今生永世 我聞金風過西廂,愛濃情深夜初涼,小碧佳人對紅燭,寶黛紅樓落花揚。今朝歡情相思長,生煙紫檀暗沉香,永結冰心換日月,世事紅塵莫相忘。七言藏頭 惟愛小寶 一生一世 惟有恩愛如鸞凰,愛上層樓賞月光,小園曲唱瀟湘清,寶珠簾瓏罩海棠。一首相思隨風揚...