|
|
вернуться в форумПоказать все сообщения Спрятать все сообщения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. 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. |
|
|