當(dāng)前位置:
首頁 >
UVa 740 - Baudot Data Communication Code
發(fā)布時間:2025/3/15
39
豆豆
生活随笔
收集整理的這篇文章主要介紹了
UVa 740 - Baudot Data Communication Code
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
稱號:目前編碼,他們shift鍵被按下,并提出,對應(yīng)的兩個編碼,其中,2相應(yīng)的編碼shift操作。
? ? ? ? ? ? ? 給你適當(dāng)?shù)木幋a值。尋求相應(yīng)的字符串。
分析:模擬。字符串。
簡單題,標(biāo)記shift的升降分類處理就可以。
說明:數(shù)據(jù)量較小,直接掃描查詢就可以。
#include <iostream> #include <cstdlib> #include <string> #include <cstdio>using namespace std;#define down 1 #define up 0string ushift,dshift,buf;int code(int space) {int value = 0;for (int i = 0 ; i < 5 ; ++ i) {value <<= 1;value += buf[space+i]-'0';}return value; }int main() {getline(cin, dshift);getline(cin, ushift);while (getline(cin, buf)) {int state = down;for (int i = 0 ; i < buf.length() ; i += 5) {int value = code(i);if (value == 27) {state = down;}else if (value == 31) {state = up;}else if (state == down)cout << dshift[value];else cout << ushift[value];}cout << endl;}return 0; }版權(quán)聲明:本文博客原創(chuàng)文章,博客,未經(jīng)同意,不得轉(zhuǎn)載。
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的UVa 740 - Baudot Data Communication Code的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 时空大数据实践之GeoWave安装部署实
- 下一篇: ./configure会报错:pr co