SGU 105 — Div 3

Posted on 五月 8th, 2008.

见程序…
随便列一下就出规律了…或者直接按照那个算除以三的余数的方法…
P.S.这个方法的证明有兴趣去看<什么是数学>…

{
SGU 105; Div 3
- sqybi’s code
}
//for my winsty
program sgu105;
  var
    n: longint;

  begin
    readln(n);
    writeln(n div 3 * 2 + ord(n mod 3 = 2));
  end.

阅读(41 次)

Make a Comment

Make A Comment: ( None so far )

blockquote and a tags work here.

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