![]() |
Help please with Pascal
Hello, help me with pascal please. senks.
5. Исследовать область определения и построить график ф-ции у=х/(х+3х+1). Thank's for all. |
senks
|
хм... 8 разых программ... есть легкие есть над которыми думать надо...
Что в виде вознаграждения... может быть предложено>? |
А на С++ не надо?)
|
Цитата:
var sp,maxsp,i,n:integer; s:string; begin clrscr; write('N=');readln(n); write('S=');readln(s); maxsp:=0; sp:=0; for i:=1 to n do begin if s[i]=' ' then inc(sp) else sp:=0; if sp>maxsp then maxsp:=sp; end; writeln('Max spaces=',maxsp); readln; end. |
Цитата:
f:textfile; str,word:string; i,j,m,n:integer; arrstr:array of string; begin assignfile(f,'test.txt'); reset(f); n:=0; while not eof(f) do begin readln(f,str); m:=Length(str); i:=0; while i<=m do begin case str[i] of 'а'..'я','А'..'Я': begin word:=word+str[i]; inc(i); end; else begin if word<>'' then begin inc(n); SetLength(arrstr,n); word:=AnsiLowerCase(word); arrstr[n-1]:=word; word:=''; end; inc(i); end; end; end; end; for i:=0 to n-1 do begin if arrstr[i]='' then continue; m:=1; for j:=i+1 to n-1 do begin if arrstr[j]='' then continue; if arrstr[i]=arrstr[j] then begin inc(m); arrstr[j]:=''; end; end; writeln(arrstr[i]+' '+IntToStr(m)); arrstr[i]:=''; end; end; |
Цитата:
f:textfile; mainword,word,str:string; i,j,m,n:integer; arrword:array of string; fl_is:boolean; begin mainword:=''; assignfile(f,'test.txt'); reset(f); readln(f,str); m:=Length(str); i:=1; n:=0; while i<=m do begin case str[i] of 'а'..'я','А'..'Я': begin word:=word+str[i]; inc(i); end; else begin if word<>'' then begin word:=AnsiLowerCase(word); if mainword='' then begin mainword:=word; word:=''; inc(i); continue; end; inc(n); SetLength(arrword,n); arrword[n-1]:=word; word:=''; end; inc(i); end; end; end; if(word<>'')and(arrword[n-1]<>word)then begin inc(n); SetLength(arrword,n); arrword[n-1]:=word; end; // for i:=0 to n-1 do begin if Length(arrword[i])>Length(mainword) then continue; word:=mainword; fl_is:=true; for j:=1 to Length(arrword[i]) do begin if fl_is=false then break; fl_is:=false; for m:=1 to Length(word) do begin if arrword[i][j]=word[m] then begin fl_is:=true; word[m]:=' '; break; end; end; end; if fl_is=true then Writeln(arrword[i]+' in '+mainword); end; end; |
Цитата:
Код:
uses crt; |
Цитата:
Код:
uses crt; |
Цитата:
Код:
uses crt; |
| Время: 19:48 |