关于Polacode一个神奇的小bug
今天在做笔记截图的时候,用Polacode截代码图片,发现死活截不了
#include <iostream>
#include <cstring>
using namespace std;
const int N = 5000;
char s[N];
int main ()
{
int i, j;
while (cin.getline (s, N))
{
int len = strlen (s);
for (i = 0; i < len; i += 16)
{
printf ("%04x: ", i);
for (j = i; j < i + 16; j++)
{
if (j < len)
printf ("%02x", s[j]);
if (j >= len)
cout << " ";
if (j & 1)
cout << " ";
}
for (j = i; j < i + 16 && s[j]; j ++)
{
if (s[j] >= 'A' && s[j] <= 'Z')
printf ("%c", s[j] + 32);
else if (s[j] >= 'a' && s[j] <= 'z')
printf ("%c", s[j] - 32);
else
cout << s[j];
}
cout << endl;
}
}
return 0;
}
试了不同长度的截图, 都是可以截图的
唯独这两部分需要转化十六进制的部分截不了,真的是给我气笑了
%0是可以截图的,但是%04就不可以了
真的是给我气笑了,不知道是不是我的个案