ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] JavaScript ²Î­pµ{¦¡¬ÛÃö°ÝÃD?

[µo°Ý] JavaScript ²Î­pµ{¦¡¬ÛÃö°ÝÃD?

¥»©«³Ì«á¥Ñ a79011013 ©ó 2011-8-29 20:47 ½s¿è

§Ú·Q½Ð°Ý  ¡G

1. ·í­pºâ§¹±o¨ì¤@­Ó°Ï¶¡,¦p [3,6]
    ½Ð°Ý§Ú¸Ó«ç»ò±a¦^¥h§ä¨ì­ì¥»ªº­È  ?

2.µ{¦¡¤¤§Ú¦³µ¹¤Fa[0]~a[6]ªº°}¦C,¦pªG§Ú·Q­n¨ú500¦¸ªº¶Ã¼Æ¦b±a¦^­È½Ð°Ý¸Ó«ç»ò°µ?
·N«ä´N¬O¡AÁ`¦@¦³7µ§¸ê®Æ,©Ò¥H§Ú±N1~7¨ú500¦¸¶Ã¼Æ¡A²Ä¤@¦¸¨ú3 ´N±a¤Ja[2]ªº­È,¤U¤@¦¸¨ú7 ´N±a¤Ja[6]ªº­È ¡A¥H¦¹Ãþ±À!!

¥H¤U¬O§Ú¼gªº¶Ã¼Æµ{¦¡½X:
//§Q¥Î¶Ã¼Æ¨ú±o¦U¼Ë¥»¼Æ¼Æ¾Ú
//var a = new Array(total_var);
//var obj = new Array(totalcount);
//for (x=0;total_var>x;x++)
//{
// a[x] = Math.round(Math.random()*10)
//}

3.¦]¬°­n¿é¤Ja[0]¸Ì­±ªº¸ê®Æ¬Ò¬°§Q¥Î®É¶¡®tºâ¥X¨Óªº
·Q½Ð°Ý javascript¥i§_¼g¤@­Ó­pºâ®É¶¡ªºµ{¦¡?
­Y¶W¹L¤@¤Ñ¸Ó«ç»ò³B²z©O?  (¶W¹L¤@¤Ñ¥H8¤p®É­pºâ)
ex: 08/23 9:00 ¡÷¡@08/23 12:00  (³o¼Ë´N¬O3¤p®É)
     08:23 9:00 ¡÷¡@08/24 9:00     (³o¼Ë´N¬O20¤p®É)


4.½Ð°Ý javascript ¥i¥H§Q¥Î excel ©Îaccess ¥h·í¸ê®Æ®wŪ¨ú¸Ì­±ªº¸ê®Æ¦A°µ­pºâ¶Ü?

--------------------------------------------------
¤U­±¬O§Úµ{¦¡©Ò¼gªºµ{¦¡½X
(µù:µ{¦¡½X¥i¦s¦¨htmlÀÉ°õ¦æ)

<html>
<head><title></title></head>
<body>
</body>
<script type="text/javascript">
var i = 0;
var j = 6;
var total_var = 7;
var new_number = 0;
//­pºâÁ`¼Ë¥»¼Æ
var totalcount = 0;
for (tmp=1;total_var>tmp;tmp++)
{
totalcount += tmp
}



var a = new Array(total_var)
var obj = new Array(totalcount);
a[0]= 8
a[1]= 3
a[2]= 0
a[3]= 2
a[4]= 15
a[5]= 45
a[6]= 73
var k;
var summary = 0;
//¨BÆJ 2. ­pºâÁ`¼Æ
for (i;j>=i;i++)
{
k = i;
for (k;j>=k;k++)
{
obj[new_number] = a + a[k];
summary += (a + a[k])/ 2;
new_number += 1;
};
};
//¸õ¥X¥[Á`¼Æ¦r
alert(summary);
//¨BÆJ 3. ªwªj±Æ§Çªk..±N¼Ë¥»¥Ñ¤p¨ì¤j±Æ§Ç
var tmp;
for (i=0;totalcount>i;i++)
{
for (j=0;totalcount-1>=j;j++)
{
if (new Number(obj[j]) > new Number(obj[j+1]))
{
tmp = obj[j];
obj[j] = obj[j+1];
obj[j+1] = tmp;
};
};
};
var sortdata = "";
for (i=0;totalcount>i;i++)
{
sortdata += obj+"\n";
}
//¸õ¥X±Æ§Ç
alert(sortdata);
//¨BÆJ 4. ¨ú±o¤¤¦ì¼Æ START
var mid_number;
if (totalcount/2 != 0)
{
mid_number = obj[(1+totalcount)/2];
}
else
{
mid_number = (obj[(totalcount)/2]+obj[(totalcount)/2+1])/2;
}
alert(mid_number);
//¨ú±o¤¤¦ì¼Æ END
//¨BÆJ 5. «H¿à°Ï¶¡????
var a = totalcount - 0.5 - (1.96 * Math.sqrt(total_var*(total_var+1)*(2*total_var+1)/24))
a = Math.floor(a)
var xx1 = a+1
var xx2 = totalcount-a
alert("["+xx1+","+xx2+"]")
//¨BÆJ 5. «H¿à°Ï¶¡????
</script>
</html>

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD