Add tags

Add tags to the following comment

Javaのprintfを使って書いてみました。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
public class Answer81 {
    public static void main(String[] args) {
        String format = String.format("%%0%dd:%%s%%n", args[1].length());
        for (int index = Integer.parseInt(args[0]), end = Integer.parseInt(args[1]);
                index <= end; index++) {
            String value = "";
            for (int keyIndex = 2; keyIndex < args.length; keyIndex += 2) {
                if (index % Integer.parseInt(args[keyIndex]) == 0) {
                    value += args[keyIndex + 1];
                }
            }
            if (value.length() == 0) {
                value = "hoge";
            }
            System.out.format(format, index, value);
        }
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...