|
|
вернуться в форумWhi WA. Please help ME. var i,j,k,l,m,n:integer; a,sol:array [0..101] of string; b:array [0..101] of integer; sintacs,word_st:string; ch1,ch2:char; function swap(s:string):string; var nn,mm,ww:integer; aa,bb:char; s1:string; begin nn:=length(s); ww:=nn;s1:=''; for mm:=nn downto 1 do s1:=s1+s[mm]; word_st:=s1; end; procedure sort; begin for i:=1 to m do begin a[i]:=a[i]+' '; inc (b[i]); end; end; begin while not (eof) do begin inc (m); while not (eoln) do begin read (ch1); a[m]:=a[m]+ch1; inc (b[m]); end; readln; end; sort; for i:=1 to m do begin for j:=1 to b[i] do begin inc (k); if (a[i][j]<>' ')and(a[i][j]<>',')and(a[i][j]<>'!')and (a[i][j]<>'?')and(a[i][j]<>'"')and(a[i][j]<>':')and (a[i][j]<>'.')and(j<>b[i]) then word_st:=word_st+a[i][j] else begin if word_st<>'' then swap(word_st); sol[i]:=sol[i]+word_st+a[i][j]; word_st:=''; end; end; writeln (sol[i]); end; end. Re: Whi WA. Please help ME. > if (a[i][j]<>' ')and(a[i][j]<>',')and(a[i][j]<>'!')and > (a[i][j]<>'?')and(a[i][j]<>'"')and(a[i][j]<>':')and > (a[i][j]<>'.')and(j<>b[i]) then There are much more different characters. Try that one: if ((a[i][j] < 'a') or (a[i][j] > 'z')) and ((a[i][j] < 'A') or (a[i][j] > 'Z')) then ... THENCK YOU. I WILL TRY IT. > > if (a[i][j]<>' ')and(a[i][j]<>',')and(a[i][j]<>'!')and > > (a[i][j]<>'?')and(a[i][j]<>'"')and(a[i][j]<>':')and > > (a[i][j]<>'.')and(j<>b[i]) then > > There are much more different characters. > Try that one: > if ((a[i][j] < 'a') or (a[i][j] > 'z')) and > ((a[i][j] < 'A') or (a[i][j] > 'Z')) then > ... |
|
|