Found a very interesting programming language, named [Wenyan], according to the grammar rules, write the simplest addition function. With the main function call, test 33+55. You can enjoy, write procedures in classical Chinese.

The multiplication formula that we’re familiar with

Let’s look at our familiar multiplication formula

code

Public static void main(String[] args) {// Define a value that takes an integer. Int num = 0; // Define the for loop. (Start at 9 and work your way down to 1.) for(int i=9; i>=1; I --) {// inner loop. (For the other number, it starts at 9 and ends at 1, and goes down step by step.) for(int j=9; j>=1; J --) {//nem is a number multiplied by a number. Num = I * j; // Print the result. (+ is used here as a concatenation.) System.out.println(i+"*"+j+"="+num+""); }}}Copy the code

The results of

9*9=81 9*8=72 9*7=63 9*6=54 9*5=45 9*4=36 9*3=27 9*2=18 9*1=9 8*9=72 8*8=64 8*7=56 8*6=48 8*5=40 8*4=32 8*3=24 8*2=16 7*1= 8 7*9=63 7*8=56 7*7=49 7*6=42 7*5=35 7*4=28 7*3= 14 7*1=7 6*9=54 6*8=48 6*7=42 6*6=36 6*5=30 6*4=24 6*3=18 6*2=12 6*1=6 5*9=45 5*8=40 5*7=35 5*6=30 5*4= 25 5*3=15 5*2=10 5*1=5 4*9=36 4*8=32 4*7=28 4*6=24 4*5=20 4*4=16 4 * 4 * 2 = 3 = 12 August 4 * 1 = 4 27 3 * 3 * 9 = 8 = 24 7 = 21 3 * 3 * 6 = 18 3 15 * 5 = 3 * 3 * 3 = 4 = 12 September 3 * 2 = 6 3 * 2 * 1 = 3 September 18 8 = 16 * 2 * 2 = 7 = 2 * 6 = 12 of 14 2 * 5 = 10 2 * 4 = 8 2 * 2 * 2 = 3 = 6 4 * 1 = 2 1 * 2 = 9 September 8 * 8 = 1 * 7 = 7 1 * 6 = 1 * 5 = 5 4 * 4 = 1 * 3 = 3 * 2 = 2 1 * 1 = 1Copy the code

99=81 98=72 97=63 96=54 95=45 93=27 92=18 91=9 89=72 88=64 87=56 86=48 85=40 84=32 83=24 82=16 81=8 79=63 78=56 77=49 76=42 75=35 74=28 73=21 72=14 71=7 69=54 68=48 67=42 66=36 65=30 64=24 63=18 62=12 61=6 59=45 58=40 57=35 56=30 55=25 54=20 53=15 52=10 51=5 49=36 48=32 47=28 46=24 45=20 44=16 43=12 42=8 41=4 39=27 38=24 37=21 35=15 34=12 33=9 32=6 31=3 29=18 28=16 27=14 26=12 25=10 24=8 23=6 22=4 21=2 19=9 17=7 16=6 15=5 13=3 12=2 1*1=1

Classical Chinese programming

Let’s take a look at classical Chinese programming

The original code

I have a technique called multiplication formula. Is art of yue. There is one known as "a". Is constant. If "A" is not less than ten, stop. There is one called "b". Add "A" with "b" name said "C". Is constant. So long as "b" is not less than "C". Multiply "a" with "b" name said "fruit". If the "result" is not less than ten, I have three words. He said "b", "A" and "fruit". If I had not said four things. The word "b" means "A" means "get" means "fruit". Add "b" to one. The "b" of the past is now. At such a time. Add "a" to one. The "a" of the past is now. At such a time. Is called "multiplication formula" skill also. Use the multiplication formula.Copy the code

Compiled code

Var multiplying formula = _ => {}; Var a = 1; var a = 1; While (true) {if (a >= 10) {break; }; Var b = 1; Const _ans1 = a + b; Var c = _ans1; While (true) {if (b >= c) {break; }; Const _ans2 = a * b; Var fruit = _ans2; If (if >= 10) {var _ans3 = 1; Var _ans4 = a; Var _ans5 = fruit; console.log(_ans3, _ans4, _ans5); } else {var _ans6 = b; Var _ans7 = a; Var _ans8 = ""; Var _ans9 = fruit; console.log(_ans6, _ans7, _ans8, _ans9); }; Const _ans10 = b + 1; B = _ans10; }; Const _ans11 = a + 1; A = _ans11; }; }; Const _ans12 = multiplication ();Copy the code

The results of

One one is one, one two is two, two is four, one three is three, two three is six, three three is nine, four is four, two is four, four is eight, three, four, four, sixteen, one five is five, twenty-five, twenty-five, twenty-five, one Six is six six six six six eighteen six twenty-four five thirty-six six six thirty-six thirty-six seven seven seven twenty-eight five seven thirty-five seven forty-two seven seven forty-nine eighteen is eight eight eight eight sixteen thirty-eight Twenty-four eight thirty-two fifty-eight forty-six eight forty-eight seven fifty-six eight eight sixty-four nine nine nine nine eighteen thirty-nine twenty-seven nine thirty-six fifty-nine forty-five six fifty-four seven nine sixty-three eight seventy-two nine nine eighty-oneCopy the code

The original address is ide.wy-lang.org

More see mp.weixin.qq.com/s/AxaCF9EnUShHomSUlEReYQ.

Please pay attention to the public number “programmer interview way” reply to “interview” to get a complete set of interview package!!