Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n, a, b, c, i, maxS = 0, s = 0;
- int prv, vtor, tret;
- scanf("%d", &n);
- for(i = 0; i < n; i++)
- {
- scanf("%d%d%d", &a,&b,&c);
- if(a < 0)
- {
- a = a * (-1);
- }
- if(b < 0)
- {
- b = b * (-1);
- }
- if(c < 0)
- {
- c = c * (-1);
- }
- if(a - b < 0) {
- prv = (a-b) * (-1);
- }
- if(b - c < 0) {
- vtor = (a-b) * (-1);
- }
- if(a - c < 0) {
- tret = (a-c) * (-1);
- }
- s = prv + vtor + tret;
- if(maxS < s) {
- maxS = s;
- }
- }
- printf("Najgolema vrednost e %d:", maxS);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment