📜  查找缺失的数字 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.271000             🧑  作者: Mango

代码示例2
numbers = input("Enter your numbers with ','separated form : ")
int_array = list(map(int,numbers.split(",")))
Sum = 0
for i in range(len(int_array)):
    Sum = Sum+int_array[i]
n = len(int_array) +1
missing = (((n+1) * (n))/2) -Sum 
print(missing)