|
|
вернуться в форумLook at my prog, why WA? Some tests plzz. Послано Akshin 31 мар 2005 20:59 Plz give me some tests. And it will be great if you can find mistake in my prog : var s:array[1..40] of string; n,i,j,k:integer; b:boolean; procedure readdata; begin { assign(input,'in.in'); reset(input);} n:=0; while not eoln do begin inc(n); readln(s[n]); end; { close(input);} end; begin readdata; b:=true; for i:=1 to n do for j:=1 to length(s[i]) do if (b) and ((s[i][j] in ['A'..'Z']) or (s[i][j] in ['a'..'z'])) then begin b:=false; if s[i][j] in ['a'..'z'] then inc(k); end else if (s[i][j]='.') or (s[i][j]='!') or (s[i][j]='?') then begin b:=true; end else if (s[i][j] in ['A'..'Z']) then begin if (j>1) and ((s[i][j-1] in ['A'..'Z']) or (s[i][j-1] in ['a'..'z'])) then inc(k); end; writeln(k); end. Re: Look at my prog, why WA? Some tests plzz. Here is Test #4: Sgfghfgh...... jknkj klnmkln klnkl klnklnklnlk ..A.S.S.SD.D.D.F.F.FF.FF.F.F the answer is 4 |
|
|