PTR by 51b

import std.stdio,std.string;void main(){for(string s;s=readln,s;){int c=~find(s,"."),n=32,j,k;foreach_reverse(i,u;split(chomp(s),c?".":":"))for(j=u.length,k=c?write(u,"."),0:u>""?4:n-4*i;k--;n--)write(j-->0?[u[j]]:"0",".");write(c?"in-addr":"ip6",".arpa
");}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page