1b1994897Sopenharmony_ci/* 2b1994897Sopenharmony_ci Copyright (c) 2023 Huawei Device Co., Ltd. 3b1994897Sopenharmony_ci Licensed under the Apache License, Version 2.0 (the "License"); 4b1994897Sopenharmony_ci you may not use this file except in compliance with the License. 5b1994897Sopenharmony_ci You may obtain a copy of the License at 6b1994897Sopenharmony_ci * 7b1994897Sopenharmony_ci http://www.apache.org/licenses/LICENSE-2.0 8b1994897Sopenharmony_ci * 9b1994897Sopenharmony_ci Unless required by applicable law or agreed to in writing, software 10b1994897Sopenharmony_ci distributed under the License is distributed on an "AS IS" BASIS, 11b1994897Sopenharmony_ci WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12b1994897Sopenharmony_ci See the License for the specific language governing permissions and 13b1994897Sopenharmony_ci limitations under the License. 14b1994897Sopenharmony_ci */ 15b1994897Sopenharmony_ci 16b1994897Sopenharmony_ci 17b1994897Sopenharmony_citry { 18b1994897Sopenharmony_ci try { 19b1994897Sopenharmony_ci a = 1; 20b1994897Sopenharmony_ci } catch (e) { 21b1994897Sopenharmony_ci a; 22b1994897Sopenharmony_ci } 23b1994897Sopenharmony_ci if (a == "") { 24b1994897Sopenharmony_ci throw "null"; 25b1994897Sopenharmony_ci } 26b1994897Sopenharmony_ci if (x > 100) { 27b1994897Sopenharmony_ci throw "max"; 28b1994897Sopenharmony_ci } else { 29b1994897Sopenharmony_ci throw "min"; 30b1994897Sopenharmony_ci } 31b1994897Sopenharmony_ci} 32b1994897Sopenharmony_cicatch (err) { 33b1994897Sopenharmony_ci func0(a, 10); 34b1994897Sopenharmony_ci} 35b1994897Sopenharmony_cifinally { 36b1994897Sopenharmony_ci console.log("error"); 37b1994897Sopenharmony_ci} 38b1994897Sopenharmony_ci 39b1994897Sopenharmony_civar car = ["B", "V", "p", "F", "A"]; 40b1994897Sopenharmony_civar text = ""; 41b1994897Sopenharmony_civar i; 42b1994897Sopenharmony_cifor (i = 0; i < 5; i++) { 43b1994897Sopenharmony_ci text += car[i] + x + y; 44b1994897Sopenharmony_ci} 45b1994897Sopenharmony_ci 46b1994897Sopenharmony_cifunction func0(x, y) { 47b1994897Sopenharmony_ci var a = x + y; 48b1994897Sopenharmony_ci return a; 49b1994897Sopenharmony_ci} 50b1994897Sopenharmony_cifunction func3(a, b, c, d, e) { 51b1994897Sopenharmony_ci return a + b + c + d + e; 52b1994897Sopenharmony_ci} 53b1994897Sopenharmony_ci 54b1994897Sopenharmony_cifunction func4(x, y) { 55b1994897Sopenharmony_ci var a = x + y; 56b1994897Sopenharmony_ci var b = x - y; 57b1994897Sopenharmony_ci var c = x * y; 58b1994897Sopenharmony_ci var d = x / y; 59b1994897Sopenharmony_ci var e = x % y; 60b1994897Sopenharmony_ci return func3(e, d, c, b, a); 61b1994897Sopenharmony_ci} 62b1994897Sopenharmony_ci 63b1994897Sopenharmony_cifunction func5(i, j, l) { 64b1994897Sopenharmony_ci for (var i = 0; i <= 4; i++) { 65b1994897Sopenharmony_ci for (var j = 0; j <= 4; j++) { 66b1994897Sopenharmony_ci for (var k = 1; k <= 2; k++) { 67b1994897Sopenharmony_ci System.out.printf(Loadstring); 68b1994897Sopenharmony_ci } 69b1994897Sopenharmony_ci } 70b1994897Sopenharmony_ci func4(x, y); 71b1994897Sopenharmony_ci } 72b1994897Sopenharmony_ci} 73b1994897Sopenharmony_ci 74b1994897Sopenharmony_cifunction func6(a, b, c) { 75b1994897Sopenharmony_ci var car = ["B", "V", "p", "F", "A"]; 76b1994897Sopenharmony_ci var text = ""; 77b1994897Sopenharmony_ci var i; 78b1994897Sopenharmony_ci for (i = 0; i < 5; i++) { 79b1994897Sopenharmony_ci text += car[i] + x + y; 80b1994897Sopenharmony_ci } 81b1994897Sopenharmony_ci for (i = 0; i < 5; i++) { 82b1994897Sopenharmony_ci text += car[i] + x + y; 83b1994897Sopenharmony_ci } 84b1994897Sopenharmony_ci for (i = 0; i < 5; i++) { 85b1994897Sopenharmony_ci text += car[i] + x + y; 86b1994897Sopenharmony_ci } 87b1994897Sopenharmony_ci} 88