- Integers in Python can be as big as the bytes in your machine's memory. There is no limit in size as there is: 231-1 (c++ int) or 263-1 (C++ long long int).
- As we know, the result of ab grows really fast with increasing b.
- Read four numbers, a, b, c, and d, and print the result of ab + cd.
- Integers a, b, c, and d are given on four separate lines, respectively.
- 1 <= a <= 1000
- 1 <= b <= 1000
- 1 <= c <= 1000
- 1 <= d <= 1000
Output Format:
- Print the result of ab + cd on one line.
9
29
7
27
4710194409608608369201743232 
Solution:
a,b,c,d = (int(input()) for _ in range(4))
print (pow(a,b)+pow(c,d))
No comments:
Post a Comment