![]()
|
Go to the first, previous, next, last section, table of contents.
°ú¿ôdef sum(N) { for ( I = 1, S = 0; I <= N; I++ ) S += I; return S; }
¤³¤ì¤Ï, 1 ¤«¤é def clear_vector(M) { /* M is expected to be a vector */ L = size(M)[0]; for ( I = 0; I < L; I++ ) M[I] = 0; } ¤³¤ÎÈ¡¿ô¤Ï, °ú¿ô¤Î¥Ù¥¯¥È¥ë¤ò 0 ¥Ù¥¯¥È¥ë¤Ë½é´ü²½¤¹¤ë¤¿¤á¤ÎÈ¡¿ô¤Ç¤¢¤ë. ¤Þ¤¿, ¥Ù¥¯¥È¥ë¤ò°ú¿ô¤ËÅϤ¹¤³¤È¤Ë¤è¤ê, Ê£¿ô¤Î·ë²Ì¤ò°ú¿ô¤Î¥Ù¥¯¥È¥ë¤Ë ¼ýǼ¤·¤ÆÊÖ¤¹¤³¤È¤¬¤Ç¤¤ë. ¼ÂºÝ¤Ë¤Ï, ¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï, ·ë²Ì¤ò¥ê¥¹¥È ¤Ë¤·¤ÆÊÖ¤¹¤³¤È¤â¤Ç¤¤ë. ¾õ¶·¤Ë±þ¤¸¤Æ»È¤¤¤ï¤±¤¹¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤. Go to the first, previous, next, last section, table of contents. |