学校的作业,要你算运行了多少次程序,n是输入数字的位数,比如287有三位数字n就等于3.然后不告诉你其中有几个2,有2就加一个次数(有点迷).最后让你算java操作了几次?比如read number算一个操作,set count to 0算一个操作,if算一个操作,while比较算一个操作.endif和endwhile不算操作数.

Lucky Twos determines and displays the number of digits that are 2s in a whole number. For example, the number of 2s in 3487 is 0, while the number of 2s in 272521 is 3. Note: whole numbers are non-negative integers starting at zero 0, 1, 2, 3, 4.Assume that the fractional part is discarded in the division:10 / 4 = 28 / 5 = 120 / 3 = 6
Let n be the number of digits of the whole number. What is the number of operations that are executed in the code in terms of n?

Lucky Twos determines and displays the number of digits that are 2s in a whole number. For example, the number of 2s in 3487 is 0, while the number of 2s in 272521 is 3. Note: whole numbers are non-negative integers starting at zero 0, 1, 2, 3, 4.Assume that the fractional part is discarded in the division:10 / 4 = 28 / 5 = 120 / 3 = 6
Let n be the number of digits of the whole number. What is the number of operations that are executed in the code in terms of n?