online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
n = int(input()) #次數 for i in range(n): coin1, coin2 = -1,-1 #硬幣種類數量 list1 = list(map(int, input().split())) #int輸入 if list1[2] > list1[1]: # 比硬幣大小 list1[1], list1[2] = list1[2], list1[1] for j in range(list1[0] // list1[1], -1, -1): if (list1[0] - list1[1] * j) % list1[2] == 0: # (總額 - 第一種幣 * 數量) 可以被 第二硬幣整除 coin1 = j coin2 = (list1[0] - list1[1] * j) // list1[2] break if coin1 >= 0 and coin2 >= 0: #兩種都有時 print(coin1 + coin2) else: print(-1)

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue