// 남은 생각 해결 < P >/입력 x78 x 89 x 5xff
// 공백 없음
// 출력 87985 < P >/// Stdio.h>
#include < String.h>
void bcd2str(char *m, char *n);
void str2bcd(char *m, char *n);
intmain ()
{
charbcd [124];
char str[124];
printf("input bcd:\n ");
gets(bcd) :
bcd2str(bcd, str);
printf("str = %s\n", str);
//printf("input str:\n ");
//gets(str)
//str2bcd(s);
//printf("bcd = %s\n", BCD);
리턴 ;
}
void bcd2str (char * m, char * n)
{
intlen;
char *p1;
char *p2;
P1 = m;
p2 = n;
while (* P1)
{
P1+;
}
len = P1-m;
if (len% 4)
{
strcpy (p2, "error! \n ");
리턴;
}
if (strcmp (P1-4, "xff"))
{
strcpy (p2, "error! Not end with \"oxff\"\n ");
리턴;
}
for(p1=m+3,p2=n; P1< M+len-4; P1+,P1++,P1++,P1++,p2++,p2++)
{
* p2 = * P1;
*(p2+1) = *(p1-1);
}
*p2 = '\';
}
//voidstr2 BCD (char * m, char * n)
//{
//
//}