Re: 10925 - Krakovia
Posted: Fri Feb 07, 2014 11:52 pm
Thanks DD, EDIT complet 

Don't forget to remove your code after getting accepted.After each test case, you should print a blank line.
Code: Select all
#include<stdio.h>
#include<math.h>
int main()
{
freopen("10925.txt", "r", stdin);
int i=1,j,n,f;
double v,s,p;
while(scanf("%d %d",&n,&f)==2)
{
if(n==0 && f==0)
break;
s=0;
for(j=1;j<=n;j++)
{
scanf("%lf",&v);
s+=v;
}
p=s/f;
printf("Bill #%d costs %.0lf: each friend should pay %.0lf\n\n",i,s,floor(p));
i++;
}
return 0;
}
Code: Select all
#include <iostream>
#include <cfloat>
using namespace std;
int main()
{
cout << "DBL_DIG = " << DBL_DIG << endl;
cout << "LDBL_DIG = " << LDBL_DIG << endl;
return 0;
}
Code: Select all
DBL_DIG = 15
LDBL_DIG = 18