Add tags

Add tags to the following comment

標準入力から。

この手の文字列操作はガーベジコレクタのおかげでたやすくできます。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import std.stdio, std.string;

void main() {
    auto t = chomp(readln), s = "0".dup;
    while(s.length < t.length || s <= t) {
        writeln(s);
        
        if(s[0] < '9') {
            s[0]++;
        } else {
            s = "10" ~ s[1 .. $];
        }
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...