Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int max1, max2, max3;
- int i1, i2;
- int x;
- scanf("%d%d%d", &max1, &max2, &max3);
- i1 = max2; i2 = max3;
- while (scanf("%d", &x) == 1)
- {
- if (i1+i2+x > max1+max2+max3)
- {
- max1 = i1;
- rrior Project http://www.underwar.co.il
- -19-
- max2 = i2;
- max3 = x;
- }
- i1 = i2;
- i2 = x;
- }
- printf("maximum : %d %d %d\n", max1, max2, max3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement