I before E except after C: Difference between revisions

(Add rust's)
Line 248:
Overall plausibility of "I before E EXCEPT after C": FALSE
Press any key to continue . . .</pre>
 
=== Fast solution using standard external commands FINDSTR and FIND: ===
<lang dos>::I before E except after C task from Rosetta Code Wiki
::Batch File Implementation
@echo off
setlocal enableDelayedExpansion
for /f %%A in ('findstr "[^c]ie" words.txt ^| find /c /v ""') do set Atrue=%%A
for /f %%A in ('findstr "[^c]ei" words.txt ^| find /c /v ""') do set Afalse=%%A
for /f %%A in ('findstr "[c]ei" words.txt ^| find /c /v ""') do set Btrue=%%A
for /f %%A in ('findstr "[c]ie" words.txt ^| find /c /v ""') do set Bfalse=%%A
set /a Aresult=Atrue/Afalse/2, Bresult=Btrue/Bfalse/2, Result=Aresult*Bresult
for %%A in (Aresult Bresult Result) do if !%%A! gtr 0 (set %%A=Plausible) else set %%A=Implausible
echo I before E when not preceded by C: True=%Atrue% False=%Afalse% : %Aresult%
echo E before I when preceded by C: True=%Btrue% False=%Bfalse% : %Bresult%
echo I before E, except after C : %Result%</lang>
{{Out}}
<pre>I before E when not preceded by C: True=464 False=194 : Plausible
E before I when preceded by C: True=13 False=24 : Implausible
I before E, except after C : Implausible</pre>
 
=={{header|C}}==
Anonymous user