Programming in D – Solutions

Formatted Input

Using a format string where the parts of the date are replaced with %s would be sufficient:

import std.stdio;

void main() {
    int year;
    int month;
    int day;

    readf("%s.%s.%s", &year, &month, &day);

    writeln("Month: ", month);
}