time limit: 1000ms
memory limit: 65536kb
problem description
輸入多個整數,以-1作為結束標誌,順序建立乙個帶頭結點的單鏈表,之後對該單鏈表的資料進行逆置,並輸出逆置後的單鏈表資料。
input
輸入多個整數,以-1作為結束標誌。
output
輸出逆置後的單鏈表資料。
example input
12 56 4 6 55 15 33 62 -1
example output
62 33 15 55 6 4 56 12
hint
#include#includestruct node
;struct node *creat()
return head;
}void reverse(struct node *head)
}void show(struct node *head)
}void main()
資料結構實驗之鍊表三 鍊錶的逆置
time limit 1000ms memory limit 65536k 輸入多個整數,以 1作為結束標誌,順序建立乙個帶頭結點的單鏈表,之後對該單鏈表的資料進行逆置,並輸出逆置後的單鏈表資料。輸入多個整數,以 1作為結束標誌。輸出逆置後的單鏈表資料。12 56 4 6 55 15 33 62 1...
資料結構實驗之鍊表三 鍊錶的逆置
資料結構實驗之鍊表三 鍊錶的逆置 輸入多個整數,以 1作為結束標誌,順序建立乙個帶頭結點的單鏈表,之後對該單鏈表的資料進行逆置,並輸出逆置後的單鏈表資料。輸入多個整數,以 1作為結束標誌。輸出逆置後的單鏈表資料。12 56 4 6 55 15 33 62 1 62 33 15 55 6 4 56 1...
資料結構實驗之鍊表三 鍊錶的逆置
time limit 1000ms memory limit 65536k 輸入多個整數,以 1作為結束標誌,順序建立乙個帶頭結點的單鏈表,之後對該單鏈表的資料進行逆置,並輸出逆置後的單鏈表資料。輸入多個整數,以 1作為結束標誌。輸出逆置後的單鏈表資料。12 56 4 6 55 15 33 62 1...