|
|
вернуться в форумPlease help..What is wrong? test 2 Послано Emil 6 ноя 2007 20:22 #include <iostream> using namespace std; int main() {long int N=0,s=0; int a=0,p=0,kol=0,z=0; cin>>N; for (long int i=1;i<=N;i++) {s=s+i-1; if (s>N) break; else {if ((N-s)%i==0) {a=(N-s)/i;p=i;}}} cout<<a<<" "<<p; } |
|
|