Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
work04.js 368 Bytes
Copy Edit Raw Blame History
陌寒 authored 2018-04-06 08:58 . all
class PrintChar{
constructor(char,num){
this.char = char;
this.num = num;
}
for3(){
for (let i =0; i<this.num ;i++){
if (i%2==0) {
let result = "";
for(let j = this.num-1; j>i; j--){
result += this.char;
}
console.log(result);
}
}
}
}
var print = new PrintChar("C",11);
print.for3();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化