python圣诞树代码详细介绍,圣诞模块代码

1,圣诞模块代码http://www.fzloh.com/fzl/flash/200903/12152.html
2,怎么用函数打出圣诞树void Print(int n,int N)//输出三角形 int al=1,sp=N,i;//每行字母数目,空格数目for(i=0; i<n; i++)//控制行数int j=0;for(; j<sp; j++)//输出空格循环printf(" ");for(;j<sp+al;j++)//输出字符循环printf("*");sp = sp-1;al = al+2;printf("\n");}}int main()int n,i;scanf("%d",&n);for(i=1;i<=n;i++)Print(i+1,n);return 0;}
3,Python用打印圣诞树图案要求树冠三角形部分为n5行中间树干部public static void main(string[] args) { string prestr = " "; string dischar = "#"; for (int i = 0; i < 7; i++) { stringbuffer temp = new stringbuffer(prestr); int rs = 11 - (11 / 2) - (i * 2); int length = ((int) (2 * (i + 1) - 1)) * 2; if (rs < 0) { rs = 11 - (11 / 2) - (0 * 2); length = 2; } for (int k = 0; k < length; k++) { temp = temp.replace(rs + k, rs + k, dischar); } system.out.println(temp); } }【python圣诞树代码详细介绍,圣诞模块代码】
4,js 写出一个圣诞树我想着应该就是一个三角形加矩形三角形写出其实你可以上网找一点css矩形三角形的代码,效率会高一点 。贴上去在用js调整一下即可public static void main(string[] args) { string prestr = " "; string dischar = "#"; for (int i = 0; i < 7; i++) { stringbuffer temp = new stringbuffer(prestr); int rs = 11 - (11 / 2) - (i * 2); int length = ((int) (2 * (i + 1) - 1)) * 2; if (rs < 0) { rs = 11 - (11 / 2) - (0 * 2); length = 2; } for (int k = 0; k < length; k++) { temp = temp.replace(rs + k, rs + k, dischar); } system.out.println(temp); } }5 , 怎么用拼一棵圣诞树出来呢VB高手进圣诞树的话 , 那就第一层放一个依次排成三角形,在下面在拍一个长方形就OK了 。Dim i As IntegerDim j As IntegerDim p As IntegerDim n As IntegerFor i = 1 To 3Print Tab(10 - i);For j = 1 To 2 * i - 1Print "*";Next jPrintNext iFor i = 2 To 6Print Tab(10 - i);For j = 1 To 2 * i - 1Print "*";Next jPrintNext iFor i = 2 To 8Print Tab(10 - i);For j = 1 To 2 * i - 1Print "*";Next jPrintNext iFor p = 1 To 2Print Tab(8 - 1);For n = 1 To 4Print "*";Next nPrintNext pPrint Tab(4); "圣诞节快乐!" 你用.net的?我用vb6调试过的~module module1 sub main() console.writeline(" *") console.writeline(" ***") console.writeline(" ***** ") console.writeline(" ******* ") console.writeline(" ***** ") console.writeline(" ******* ") console.writeline("************ ")console.writeline(" ** ") console.writeline(" ** ") end sub end module

    推荐阅读