题目 https://leetcode-cn.com/problems/convert-binary-number-in-a-linked-list-to-integer/
/*** Definition for singly-linked list.* struct ListNode {* int val;* struct ListNode *next;* };*/int getDecimalValue(struct ListNode* head){int num = 0;struct ListNode* node = head;while(node != NULL){num = num<<1;num |= node->val;node = node->next;}return num;
}