我設置的是是這樣的一小部分問題和模板:分數和整數是分割的,可替代
Mark has 3 1/3 times as many apple as Jane. Jane has 42 apples. How many do they have altogether?
Template Possibility 1 - fraction first, then whole number
@[email protected] has #name#1 #name#2/#mul#1 times as many @[email protected] as @[email protected] @[email protected] has #name#3mul @[email protected] How many @[email protected] do they have altogether?
Template Possibility 2 - whole number first , then fraction
Jane has 42 apples. Mark has 3 1/3 times as many apple as Jane.How many do they have altogether?
@[email protected] has #name#1mul1 @[email protected] @[email protected] has #name#2 #name#3/#mul#1 times as many @[email protected] as @[email protected] How many @[email protected] do they have altogether?
Another possibility, there may be another pair : #name#2/#mul#1 #name#3mul1 #name#4/#mul#2 #name#5mul2
的一個以#是數字變量,而一個與@是文本變量。
對於文本變量和正常的整數變量,我可以隨機的值並將其分爲模板。
我有分數問題(#名稱#2 /#MUL#1)和整數,其中這兩個的方式都與該#MUL#1其爲(#名稱#3mul)分母必須能夠將整個數字(#名稱#3mul)除以餘數或小數。
我有一個方法,依次逐字檢查,如果找到第一個#mul#1,它將調用一個方法並返回2個東西,整個數字和mul值本身。
現在我有一個問題,讓這2個值在問題模板中替代,因爲整數可能會先來分數。
你們中的任何一個人都曾經歷過這種情況,並有更好的方法來生成可分割的分數和整數?
任何意見或提示,非常感謝。謝謝!
PS:我使用Java ...
這是一個數學問題,而不是編程問題。 –