test HTML/JavaScript

Hello

https://tw.stock.yahoo.com/#:~:text=%E5%A4%A7%E7%9B%A4%E8%A1%8C%E6%83%85,35264.67

2021年12月29日 星期三

Maze

 m = [

[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],

[2,1,0,0,2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,2],

[2,0,0,0,2,0,0,0,2,0,2,2,2,2,2,2,2,2,2,2],

[2,2,2,0,2,2,2,2,2,0,0,0,0,0,2,0,0,0,0,2],

[2,0,0,0,2,0,0,0,2,0,0,2,0,0,2,0,0,0,0,2],

[2,0,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2],

[2,0,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2],

[2,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,2,0,0,2],

[2,0,0,0,2,0,0,0,2,0,0,2,0,0,2,0,0,0,0,2],

[2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2,0,2,2],

[2,0,0,0,2,0,0,0,2,0,0,2,0,0,0,0,2,0,0,2],

[2,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2],

[2,0,0,0,2,0,2,2,2,2,0,2,0,0,0,0,2,0,999,2],

[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]

]

for i in m:

    print(i)


for i in range(len(m)):

    for j in range(len(m[i])):

        if m[i][j] == 2: m[i][j] = 200


k = 1

while k<100:   

    for i in range(len(m)):

        for j in range(len(m[i])):

            # if m[i][j] == 999:break

            if m[i][j] == 0: 

                t = 0

                if  m[i][j-1]<200 and m[i][j-1]>t:t = m[i][j-1]

                if  m[i][j+1]<200 and m[i][j+1]>t:t = m[i][j+1]

                if  m[i-1][j]<200 and m[i-1][j]>t:t = m[i-1][j]

                if  m[i+1][j]<200 and m[i+1][j]>t:t = m[i+1][j]

                if t == k:m[i][j] = k+1

    k = k+1


for i in range(len(m)):

    for j in range(len(m[i])):

        if m[i][j] == 200: m[i][j] = '#'

    

for i in m:

    for j in i:

        print(j,end='\t')

    print()

            

2021年12月26日 星期日

c++ Sort

 #include <iostream>

#include <cmath>

using namespace std;

int main()

{

    string na[] = {"王一美","林二美","張三美","李四美","王五美"};

    int ch[]={95,80,70,60,50};

    int en[]={60,70,80,90,93};

    int ma[]={60,70,80,90,95};

    int tot[5];

    float avg[5];

    int ord[5]; 

    for (int i=0;i<5;i++)

    {

      tot[i] = ch[i]+en[i]+ma[i];

      avg[i] = (ch[i]*5.0+en[i]*4+ma[i]*3)/12;

      avg[i] = floor(avg[i]*10+0.5)/10;

    }

    for (int i=0;i<5;i++)

    {

        ord[i] = 1;

        for (int j=0;j<5;j++)

           if (tot[i]<tot[j])

              ord[i]++;

    }

    cout << "編號"<<" "<< "姓名"<<" "<< "國"<<" "<<"英"<<" "<<"數"<<" "<<"總分"<<" "<<"平均"<<" "<<"名次"<<endl;

    for (int i =0 ;i<5;i++)

        cout << i+1<<" "<< na[i]<<" "<< ch[i]<<" "<<en[i]<<" "<<ma[i]<<" "<<tot[i]<<" "<<avg[i]<<" "<<ord[i]<<endl;

}


2008年7月3日 星期四

test doc

test doc
test doc
test doctest doc
test doctest doc
test doctest doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doctest doc
test doc
test doc