Перенос страниц

This commit is contained in:
Alexander Zhirov 2023-03-05 15:30:34 +03:00
parent 4d57446057
commit 4c954c9186
129 changed files with 14 additions and 15 deletions

View file

@ -0,0 +1,19 @@
import std.stdio, std.string;
import std.algorithm;
void main()
{
size_t [string] dictionary;
foreach (line; stdin.byLine())
{
// Раз­бить стро­ку на сло­ва
// До­ба­вить ка­ж­дое сло­во стро­ки в сло­варь
foreach (word; line.strip.splitter)
{
if (word in dictionary) continue; // Ни­че­го не де­лать
auto newID = dictionary.length;
dictionary[word.idup] = newID;
writeln(newID, '\t', word);
}
}
}