Solution technique of UVA problem 727 Equqtion

Problem description:

Write a program that changes an infix expression to a postfix expression according to the following specifications.

 Input condition:

  1.  The infix expression to be converted is in the input file in the format of one character per line, with a maximum of 50 lines in the file. For example, (3+2)*5 would be in the form: ( 3 + 2 ) * 5 
  2.  The input starts with an integer on a line by itself indicating the number of test cases. Several infix expressions follows, preceded by a blank line. 
  3.  The program will only be designed to handle the binary operators +, -, *, /. 
  4.  The operands will be one digit numerals. 
  5. The operators * and / have the highest priority. The operators + and - have the lowest priority. Operators at the same precedence level associate from left to right. Parentheses act as grouping symbols that over-ride the operator priorities. 
  6.  Each testcase will be an expression with valid syntax
image

UVA solution 727 Equation

Problem description:
source: https://uva.onlinejudge.org/external/7/727.html

Write a program that changes an infix expression to a postfix expression according to the following specifications.

 Input condition:

  1.  The infix expression to be converted is in the input file in the format of one character per line, with a maximum of 50 lines in the file. For example, (3+2)*5 would be in the form: ( 3 + 2 ) * 5 
  2.  The input starts with an integer on a line by itself indicating the number of test cases. Several infix expressions follows, preceded by a blank line. 
  3.  The program will only be designed to handle the binary operators +, -, *, /. 
  4.  The operands will be one digit numerals. 
  5. The operators * and / have the highest priority. The operators + and - have the lowest priority. Operators at the same precedence level associate from left to right. Parentheses act as grouping symbols that over-ride the operator priorities. 
  6.  Each testcase will be an expression with valid syntax
image

Solution of 10127 - Ones

Problem description:
source: https://uva.onlinejudge.org/external/101/10127.html


Given any integer 0 n 10000 not divisible by 2 or 5, some multiple of n is a number which in decimal notation is a sequence of 1’s. How many digits are in the smallest such a multiple of n?

Input

A fle of integers at one integer per line.

Output