以前看过,没啥想法,不知道是干嘛的 = =。。。
今天又研究了下,懂了= =。。7F化成2进制是1111111,也就是第一列是7个#。。。无语
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <limits.h>
#include <string.h>
#include <string>
#include <algorithm>
#define MID(x,y) ( ( x + y ) >> 1 )
#define L(x) ( x << 1 )
#define R(x) ( x << 1 | 1 )
#define BUG puts("here!!!")
#define STOP system("pause")
using namespace std;
char s[10][500];
int to16(char *s)
{
int ans = 0;
if( isdigit(s[0]) )
ans = s[0] - '0';
else
ans = s[0] - 'A' + 10;
ans *= 16;
if( isdigit(s[1]) )
ans += s[1] - '0';
else
ans += s[1] - 'A' + 10;
return ans;
}
int main()
{
int ncases, n, r, ind = 1;
char str[5];
scanf("%d", &ncases);
while( ncases-- )
{
scanf("%d", &n);
for(int i=0; i<7; i++)
for(int k=0; k<500; k++)
s[i][k] = ' ';
for(int i=0; i<n; i++)
{
r = i*6;
for(int k=0; k<5; k++)
{
scanf("%s", str);
int p = to16(str);
for(int l=0; l<7; l++)
{
if( p % 2 == 1 )
s[l][r] = '#';
else
s[l][r] = ' ';
p /= 2;
}
r++;
}
}
printf("Case %d:\n\n", ind++);
for(int i=0; i<7; i++)
{
for(int k=0; k<6*n-1; k++)
printf("%c",s[i][k]);
printf("\n");
}
printf("\n");
}
return 0;
}