fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. long long a, b, c;
  8. cin>>a>>b>>c;
  9. long long d[5];
  10. d[0]=a+b+c;
  11. d[1]=2*a+2*b;
  12. d[2]=2*a+2*c;
  13. d[3]=2*b+2*c;
  14. sort (d, d+4);
  15. cout<<d[0];
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 4176KB
stdin
1 1 5
stdout
4