|
|
back to boardmy solve-pascal Posted by gyz113 14 Feb 2008 18:07 easy problem,but you must make some changes Var k,i:longint; Begin readln(k); i:=3; while k mod i>0 do inc(i); writeln(i-1); End. Re: my solve-pascal Won't you get TLE? Re: my solve-pascal Posted by XXX 26 Jan 2009 03:14 Once upon a time people invented the game named Bashi. +1 for gyz113. It is realy very easy problem. my solve-C++: #include "iostream" using namespace std; int main() { int K, L = 0, i; cin >> K; for (i = 2; i <= K; i++) if ((K % (i+1)) == 0) { cout << i; return 0; } cout << "0"; return 0; } sorry for my English. |
|
|