1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-08 08:54:34 +05:30

countLettersInTextFile.d: improve the output format

This commit is contained in:
Intel A80486DX2-66 2024-03-14 22:10:17 +03:00
parent 4a81d7cd47
commit f2746abffb
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -11,5 +11,5 @@ void main(string[] argv)
count(filter!(a => isAlpha(a) || isWhite(a))(fileContent));
auto percentage = (totalLetters * 100) / cast(double)fileContent.length;
writefln("Percentage of letters: %.0f", percentage);
writefln("Letters: %.0f%%", percentage);
}