Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int y,b,r,a[10],i,min=110,t;
- scanf("%d %d %d",&a[1],&a[2],&a[3]);
- for(i=1;i<=3;i++){
- if(a[i]<=min)
- min=a[i];
- }
- if(min==a[3]){
- r=a[3];
- b=r-1;
- y=b-1;
- }
- else if(min==a[2]){
- b=a[2];
- r=b+1;
- y=b-1;
- }
- else if(min==a[1]){
- y=a[1];
- b=y+1;
- r=b+1;
- if(a[1]==a[3]-1){
- y--;
- b--;
- r--;
- }
- }
- t=y+b+r;
- printf("%d\n",t);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement