|
|
вернуться в форумWhat's the hell wrong with this code???Many Thanks,Thanks,Thanks!!!! Program ex; Const Infile = 'ural1138.in'; Outfile = 'ural1138.out'; Var n, m, i, j, Max, Max1, Ans: Integer; Temp: Real; Data: Array [1..10000] Of Integer; Begin ReadLn(n, m); If (n < m) Then Begin WriteLn(0); Halt; End; Data[m] := 1; Ans := -1; For i:=m+1 To n Do Begin Max := -1; For j:=m To i-1 Do Begin Temp := Frac((i * 100) / j - 100); If (Temp = 0) Then Begin Max1 := Data[j] + 1; If (Max1 > Max) Then Max := Max1; End; End; Data[i] := Max; If (Data[i] > Ans) Then Ans := Data[i]; End; WriteLn(Ans); End. |
|
|