import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
for (int i = 0; i < n; i++)
{
String s = sc.nextLine().trim();
System.out.format("%d.%d.%d.%d\n", convert(s.substring(0, 8)),
convert(s.substring(8, 16)), convert(s.substring(16, 24)),
convert(s.substring(24, 32)));
}
}
static int convert(String s)
{
int sum = 0;
int factor = 1;
for (int i = s.length() - 1; i >= 0; i--)
{
sum += (s.charAt(i) - '0') * factor;
factor *= 2;
}
return sum;
}
}
ZOJ-2482
最新推荐文章于 2018-08-17 15:14:32 发布