Blue Bridge Training codes

Clearly the
characters in the font glyph exists, even today, 16 dot matrix font is still widely used.
16 dot matrix font to each character as a 16x16 pixel information. And these information is recorded in bytes.
A byte can store 8 bits of information, 32 bytes with a character can keep the glyph.
Each byte into the represented binary, represents an ink, 0 represents background. 2 bytes per row,
a total of 16 lines, layout:
1 byte, 2 byte
3 byte, byte 4
...
31 byte, 32 byte
This question is to give you a period of multiple information composed of characters, each character is represented by 32 bytes, a byte as given herein have signed integer values.
Hidden in the subject requires this information. Your task is to restore the shape of Chinese characters, seen from the requirements of the subject, and fill in the answers on request.
This information is (a total of 10 characters):
404040432-1-16 4,324,324,324,324,328,328 32 16 3416343230-640
16 64 16 64 346812712666 -124 67 466466-124126 100 6,636,664,664,664,126,466 40 16 0
404040432-1-16 32. 4 32. 4 32. 4 32. 4 4,328,328,321,634,163,432 30 -64 0
0-12864-12848 -128 1781-42888016 643264-326432 -9632-96331634 36 14 40. 8. 4
. 4 0 0 0. 4. 3. 1 0 -1 - 2 404167-8416416 416,816,816,161,632 -96 64 64
16 64 20 is 72 62-4733251610 63-810-1-20640 80 63-88644641640 -128
0 16 63-810101014-1 -2,101,010,101,010,105,020
2 0 207-168322464 37-1282-12812 -128 113-428121618 32 33-64101401120
1,010,109,329,161,712,174 331,665,161,321,640. 1 0 2 0 12 is -128 112 0 0
00007-16242448 1256120560-320 -64 0-12800001-128 3-641-12800
Note: You need to submit is an integer, do not fill out any extra content.

Report problem solving: Title meaning she did not understand, and now understand, interpret it, each row 32 the number of their eight binary number can be used to express a character, a total of ten characters, each of two digital accounted for one line.

#include<bits/stdc++.h>
using namespace std;
int main()
{
	for(int m=1;m<=10;m++)
	for(int i=1;i<=16;i++)
	{
		for(int j=1;j<=2;j++)
		{
			int a,b;
			string ans;
			string a1,a2;
			cin>>a>>b;
			if(a>=0)
			{
				while(a)
				{
					a1+=(a%2+'0');
					a/=2;
				}
				int tt=a1.size();
				for(int jj=1;jj<=8-tt;jj++)
				a1+='0';
				reverse(a1.begin(),a1.end());
			}
			else
			{
				a=abs(a);
				while(a)
				{
					a1+=(a%2+'0');
					a/=2;
				}
				int tt=a1.size();
				for(int jj=1;jj<=8-tt;jj++)
				a1+='0';
				reverse(a1.begin(),a1.end());
				int t=a1.rfind('1');
				for(int k=0;k<t;k++)
				if(a1[k]=='0')
				a1[k]='1';
				else
				a1[k]='0';
			}
			if(b>=0)
			{
				while(b)
				{
					a2+=(b%2+'0');
					b/=2;
				}
				int tt=a2.size();
				for(int jj=1;jj<=8-tt;jj++)
				a2+='0';
				reverse(a2.begin(),a2.end());
			}
			else
			{
				b=abs(b);
				while(b)
				{
					a2+=(b%2+'0');
					b/=2;
				}
				int tt=a2.size();
				for(int jj=1;jj<=8-tt;jj++)
				a2+='0';
				reverse(a2.begin(),a2.end());
				int t=a2.rfind('1');
				for(int k=0;k<t;k++)
				if(a2[k]=='0')
				a2[k]='1';
				else
				a2[k]='0';
			}
			ans=a1+a2;
			for(int kk=0;kk<ans.size();kk++)
			if(ans[kk]=='0')
			ans[kk]=' ';
			cout<<ans<<endl;
		}
	}
}
Published 165 original articles · won praise 8 · views 2468

Guess you like

Origin blog.csdn.net/qq_45961321/article/details/105010830