School canteen#1286

School canteen (Editorial)

Algorithm Analysis

Dimi should buy all the pies that are available. Their number equals a + b + c.

Algorithm Implementation

Read the input data.

scanf("%d %d %d", &a, &b, &c);

Calculate the sum a + b + c and print it.

res = a + b + c;
printf("%d\n", res);

Java implementation

import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner con = new Scanner(System.in);
        int a = con.nextInt();
        int b = con.nextInt();
        int c = con.nextInt();
        int res = a + b + c;
        System.out.println(res);
    }
}

Python implementation

a, b, c = map(int, input().split())
res = a + b + c
print(res)