3 喜歡 0 不喜歡
86 瀏覽
Write a program that reads 8 bits (each bit is 0 or 1) and displays the corresponding decimal number, assuming that the bits are entered from left to right (The first digit is MSB: Most Significant Binary). For example, if the user enters 10000000 the program should display 128.

Sample Input:

101

Sample Output:

5

 

References: C From Theory
[正常] Coding (C) - 最新提問 分類:Introduction to Computer Programming I (C) | 用戶: (20.9k 分)
ID: 21867 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 86 瀏覽
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.42.23
©2016-2024

相關問題

3 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 2月 6, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21873 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 94 瀏覽
6 喜歡 0 不喜歡
1 回答
[正常] Coding (C) - 最新提問 10月 16, 2017 分類:Introduction to Computer Programming I (C) | 用戶: thopd (12.1k 分)
ID: 27170 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 154 瀏覽
3 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 1月 25, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21795 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 99 瀏覽
3 喜歡 0 不喜歡
0 回答
[正常] 開放式問答 - 最新提問 2月 12, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21926 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 108 瀏覽
3 喜歡 0 不喜歡
0 回答
[正常] 開放式問答 - 最新提問 2月 12, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21923 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 111 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶