For the labs task, I decided to, but the conclusion cannot be correctly arranged, please help
The output should be like this: [1; 1,4,4]
The number of output elements may change. This is my main problem.
uses crt; Var n: string; procedure confrac(n:string); Var a,b,c,col,err,zoz: integer; g, h: string; sPos:=1; begin sPos := PosEx('/',n,sPos); g:= Copy(n, 1, spos-1); h:= Copy(n, (sPos+1), length(n)); val(g,a,err); val(h,b,err); while a>1 do begin writeln(a div b); c:=a mod b; a:=b; b:=c; end; end; begin confrac('38/21'); end. At the moment I was able to conclude as follows:
one
one
one
four
writelnwithwriteand then print the characters you want (space, bracket, commas). - pavel;and then the commas go? - alexoander;this is a separator between array values. But the comma can be copied in two ways - both as a separator and as a fractional part (although the number with 3 commas is odd) - alexoander