I tried this input on my program (don't mind that the characters repeats):
7
C*(A+B)
(A+B+D*E)*C
C*B*A
D+A+F+((((G+C)*R*D)))
V
(A+A)*(B+B)*(C+C)*(D+D)*(E+E)*(F+F)*(G+G)*(H+H)*(I+I)*(J+J)*(K+K)*(L+L)*(M+M)*(N+N)
A*(B+C)*(D+E+F)*(G+H+I+J)*(K+L+M+N+O)*(P+Q+R+S+T+U)*(V+W+X+Y+Z)
It produces:
A*C+B*C
C*D*E+A*C+B*C
A*B*C
C*D*R+D*G*R+A+D+F
V
A*B*C*D*E*F*G*H*I*J*K*L*M*N+A*B*C*D*E*F*G*H*I*J*K*L*M*N+...
A*B*D*G*K*P*V+A*B*D*G*K*P*W+A*B*D*G*K*P*X+...
However, I get WA. I even tried to change the variables to numbers (A=1, B=2, ...) in the two long expressions and calculate the result and the input value matches output value. What am I missing?
created
last reply
- 2
replies
- 788
views
- 3
users