mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-12-24 04:39:51 +05:30
countLettersInTextFile.d: improve the output format
This commit is contained in:
parent
4a81d7cd47
commit
f2746abffb
@ -11,5 +11,5 @@ void main(string[] argv)
|
|||||||
count(filter!(a => isAlpha(a) || isWhite(a))(fileContent));
|
count(filter!(a => isAlpha(a) || isWhite(a))(fileContent));
|
||||||
auto percentage = (totalLetters * 100) / cast(double)fileContent.length;
|
auto percentage = (totalLetters * 100) / cast(double)fileContent.length;
|
||||||
|
|
||||||
writefln("Percentage of letters: %.0f", percentage);
|
writefln("Letters: %.0f%%", percentage);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user