ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1582. Bookmakers

for c++ ones: >AC< ;)
Posted by alexutz_mircescu 31 Oct 2007 16:12
#include <stdio.h>
#include <math.h>

double k1, k2, k3;

int main() {
    scanf("%lf%lf%lf", &k1, &k2, &k3);
    printf("%.0lf", 1000/(k2/k3+k2/k1+1)*k2);
    return 0;
}
Re: for c++ ones: >AC< ;)
Posted by And IV 3 Feb 2008 04:35
WHY "CE" IN GCC(linux) it works.
#include <iostream>
#include <math.h>
double a,b,c,r;
using namespace std;
int main() {
    cin>>a>>b>>c;
    r=1000.0/(1.0/b+1.0/c+1.0/a);
    cout<<int(round(r));
    return 0;
}
Re: for c++ ones: >AC< ;)
Posted by dauren.ktl 19 Aug 2010 11:44
Because here's compiler don't know function round, you must write your own function, and you can use printf() it will round the number

Edited by author 19.08.2010 11:47
Re: for c++ ones: >AC< ;)
Posted by Nicolai_[Kovrov] 31 Oct 2010 16:21
#include <iostream>
using namespace std;
#include <cmath>
void main()
{
    double k1,k2,k3;
    cin>>k1>>k2>>k3;
    cout.setf(ios::fixed);
    cout.precision(0);
    cout<<1000.0*k1*k2*k3/(k1*k2+k1*k3+k2*k3);
}
Re: for c++ ones: >AC< ;)
Posted by ACSpeed 28 Nov 2011 17:22
#include <iomanip>

cout<<fixed<<setprecision(0)<<s;
Re: for c++ ones: >AC< ;)
Posted by staticor 3 Jul 2013 19:25
ruby


a1,a2,a3 = gets.chomp!.split(" ").map(&:to_f)
puts (1000*a2/(a2/a1+a2/a3+1)).round