Maybe you can check the error message from the email sent by the judge.
![:wink:](./images/smilies/icon_wink.gif)
Moderator: Board moderators
Code: Select all
cout<<"The minimum number of moves is "<<result<<endl<<endl;
Code: Select all
cout<<"The minimum number of moves is "<<result<<"."<<endl<<endl;
Code: Select all
cout<<"The minimum number of moves is "<<s<<"."<<endl;
Code: Select all
cout<<"The minimum number of moves is "<<s<<"."<<endl<<endl;
Code: Select all
printf("set# %d\n",j);
Code: Select all
printf("Set #%d\n",j);
Output a blank line after each set.
Code: Select all
cin >> stackTotal;
// outer loop only entered if the stack total is not zero
...
cin >> stacks[i];
...
// process the stuff and do some calculations
// print out the result
cout << endl << "Set #" << count << endl;
cout << "The minimum number of moves is " << answer << "." << endl << endl;
Code: Select all
cin >> stackTotal;
// outer loop only entered if the stack total is not zero
...
cin >> stacks[i];
...
// process the stuff and do some calculations
// print out the result
cout << endl << "Set #" << count << endl;
cout << "The minimum number of moves is " << answer << "." << endl << endl;
Code: Select all
cout <<"Set #" << count << endl;
Code: Select all
#include <iostream>
int main()
{
int n,h=0,average=0,moves=0,set=1;
int* heights = new int [60];
a:
scanf("%d",&n);
if(n<1)
{
return 0;
}
else
{
while(h<n)
{
scanf("%d",&heights[h]);
average+=heights[h];
h++;
}
h=0;
average=average/n;
while(h<n)
{
if(heights[h]>average)
{
moves+=heights[h]-average;
}
h++;
}
printf("Set #%d\nThe minimum number of moves is %d.\n\n",set,moves);
moves=0;set++;
goto a;
}
}