Archive for 六月 8th, 2008

SGU 179 — Brackets light

Posted on 六月 8th, 2008.

找到最靠后的一个满足它左边的’(’比’)’数量多的’(’,改成’)’,然后在后面补(…()…)和)…).好久以前就写过的题.刚才写错了一点,在最后填括号的时候先填(…()…),再填)…).
{ SGU 179; Brackets light - sqybi’s code}//for my winstyprogram sgu179_sqybi;  var    i, l, r, tr, t: longint;    s: ansistring;
  begin    readln(s);    l := length(s);    t := 0;    r := 0;    for i:=1 to l do begin      if (t > 0) and (s[i] = ‘(’) then begin        tr := t;        r := i;      end;      […]

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...