#include <set>
#include <map>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;
class nmb
{
public:
string br;
int ser;
};
nmb nums[10] = { {".***..",0},{"*.....",1},{"*.*...",2},{"**....",3},{"**.*..",4},{"*..*..",5},{"***...",6},{"****..",7},{"*.**..",8},{".**...",9} };
int main()
{
int n, i, j, k, tst;
string str, temp;
string strs[3];
while (getline(cin,str))
{
if (str == "0")
break;
getline(cin,str);
if (str == "S")
{
getline(cin,str);
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<str.size() ; j++)
if (!j) cout << nums[str[j]-'0'].br.substr(i*2,2);
else cout << " " << nums[str[j]-'0'].br.substr(i*2,2);
cout << endl;
}
}
else
{
getline(cin,strs[0]);
getline(cin,strs[1]);
getline(cin,strs[2]);
for (j=0 ; j<strs[0].size() ; j+=3)
{
temp = "";
for (i=0 ; i<3 ; i++)
{
temp += strs[i].substr( j, 2 );
}
for (k=0 ; k<10 ; k++)
{
if (temp == nums[k].br)
{
cout << k;
break;
}
}
}
cout << endl;
}
}
return 0;
}
Tuesday, November 22, 2011
[UVa] 12364 - In Braile
Subscribe to:
Post Comments (Atom)
Connect Rapoo MT750S with Linux (Tested on Manjaro)
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
I like coding a lot, keeps me glued to the PC for hours. For that reason it's a need to edit the Syntax Highlighter to suit my eyes for...
-
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
Method: The problem at first glance seems too straightforward but it's not that much. Think a bit about the lines "Erin can add ...
No comments:
Post a Comment
Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.