Missing Number
Limits
1s, 512 MB
Given the sum of four numbers and three of those numbers, find the missing number.
All four numbers are positive integers.
All four numbers are positive integers.
Input
The
input will contain one integer (the sum of the four numbers) in the
first line and 3 integers (three of those four numbers) in the second
line.
All numbers in this problem fit in 32-bit signed integers.
All numbers in this problem fit in 32-bit signed integers.
Output
Print the missing number.
Sample
Input | Output |
---|---|
10 1 2 3 |
4
#include<stdio.h>
int main()
{
int n,a,b,c;
scanf("%d", &n);
scanf("%d %d %d", &a , &b, &c);
printf("%d",n-a-b-c);
}