Skip to content

Commit

Permalink
Works while other doesn't, odd but okay
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolinux5 committed Aug 3, 2014
1 parent bcb5c4f commit a930093
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
Binary file modified a.out
Binary file not shown.
31 changes: 17 additions & 14 deletions bdayGift.cpp
Expand Up @@ -4,20 +4,23 @@ using namespace std;

int main()
{
int numTimes;
cin >> numTimes;
double result = 0;
int testNum;
long long x,sum=0;
cin>>testNum;
while(testNum--)
{
cin>>x;
sum = sum + x;
}

while(numTimes--){
double newNum;
cin >> newNum;
result += (0.5 * newNum);
}
if(sum%2==0)
{
cout<<sum/2<<".0"<<endl;
}
else
{
cout<<sum/2<<".5"<<endl;
}

cout.precision(1);
cout << fixed;

cout << result << endl;

return 1;
return 0;
}

0 comments on commit a930093

Please sign in to comment.