diff --git a/d-programming/countLettersInTextFile.d b/d-programming/countLettersInTextFile.d index aebb3d7..471d23e 100644 --- a/d-programming/countLettersInTextFile.d +++ b/d-programming/countLettersInTextFile.d @@ -4,9 +4,9 @@ import std.ascii : isAlpha, isWhite; import std.file : read; import std.stdio : writefln; -void main() +void main(string[] argv) { - auto fileContent = cast(string)read("file.txt"); + auto fileContent = cast(string)read(argv[1]); auto totalLetters = count(filter!(a => isAlpha(a) || isWhite(a))(fileContent)); auto percentage = (totalLetters * 100) / cast(double)fileContent.length;