|
|
вернуться в форумWhat is WRONG Послано Otaku 15 мар 2009 14:46 #include <iostream> using namespace std; int main() { int n,d; int group=0,ves=0; int *kamen = new int[1000]; cin>>n; for (int i=0;i<n;i++) { cin>>kamen [i]; group += kamen[i]; } ves = group/2; for (int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(ves>kamen[j]){ ves-=kamen[j]; } } }
d= ves*2; d+= group%2; cout<<d-1;
system ("pause"); return 0; } Edited by author 15.03.2009 14:52 Re: What is WRONG Послано SImon 15 мар 2009 14:54 YOU MUST DO LIKE THIS d= ves * 2 = group%2 I had problem like this in other programm Re: What is WRONG Послано Otaku 15 мар 2009 14:56 THANKS,YOU SAVED MY LIFE |
|
|