|
|
вернуться в форумmy solve-pascal Послано gyz113 14 фев 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 Послано XXX 26 янв 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. |
|
|