聖誕節快樂!!!

軟體工程師的浪漫呀~~
http://codepad.org/
貼上,選C++
#include <iostream>
using namespace std;
int main()
{
    const int hTree = 50;
    const int wTree = hTree/2;
    for (int ih = 0; ih < hTree; ++ih)
    {
        int shift = ih/8*3;
        for (int i = 0; i < hTree - ih + shift; ++i)
            cout << " ";
        for (int i = 0; i < ih+ih+1 - shift*2; ++i)
            cout << "*";
        cout << endl;
    }
    return 0;
}

沒有留言:

張貼留言

(什麼是留言欄訊息?)