10878专题

uva 10878 Decode the tape

这道题可以算一道入门题,不需要用什么算法。 首先是理解题意,如果你把纸条的8个位置(点前有5个位置,不是4个,点后有3个位置)对应到char类型的8个位置上去,可以发现那正好是输出字符的ASC II码。 其次,要注意题目说了只有一个纸带,并且‘_’和‘|’也要处理。 最后,谈一下我犯的错误,就是没有把输入全部读取,而是在判断到‘\n’时就退出,导致WA,所以下次不管需不需要把输入全部读完才能

UVA之10878 - Decode the tape

【题目】 Your boss has just unearthed a roll of old computer tapes. The tapes have holes in them and might contain some sort of useful information. It falls to you to figure out what is written on them.

UVA-10878 Decode the tape

原题链接: https://vjudge.net/problem/UVA-10878 AC代码: #include <bits/stdc++.h>using namespace std;int c[11] = {0, 0, 64, 32, 16, 8, 0, 4, 2, 1,0};int main(){char str[20];fgets(str, 21, stdin);whi