Advertisement
erfanul007

CF Good Bye 2018 A

Dec 30th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. int y,b,r,a[10],i,min=110,t;
  6. scanf("%d %d %d",&a[1],&a[2],&a[3]);
  7. for(i=1;i<=3;i++){
  8. if(a[i]<=min)
  9. min=a[i];
  10. }
  11. if(min==a[3]){
  12. r=a[3];
  13. b=r-1;
  14. y=b-1;
  15. }
  16. else if(min==a[2]){
  17. b=a[2];
  18. r=b+1;
  19. y=b-1;
  20. }
  21. else if(min==a[1]){
  22. y=a[1];
  23. b=y+1;
  24. r=b+1;
  25. if(a[1]==a[3]-1){
  26. y--;
  27. b--;
  28. r--;
  29. }
  30. }
  31. t=y+b+r;
  32. printf("%d\n",t);
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement