#include #include #include unsigned char hexvalue(char c) { if(c >= '0' && c <= '9') return(c-'0'); if(c >= 'A' && c <= 'F') return(c-'A'+10); if(c >= 'a' && c <= 'f') return(c-'a'+10); } main(int argc, char **argv) { int x,y,z; int size; int pos; char *s; unsigned char c,d; pos=0; s=argv[1]; size = strlen(s); while(pos < size) { c = s[pos++]; if(c == '+') putc(' ',stdout); else if(c == '%') { c = s[pos++]; x = hexvalue(c); c = s[pos++]; x = x*16+hexvalue(c); putc(x,stdout); } else putc(c,stdout); } }