Programming Fundamental.
วันพฤหัสบดีที่ 4 กันยายน พ.ศ. 2557
Factorial
void setup() {
size (50, 30);
background (0, 0, 255);
text(fac(7), 10, 20);
}
int fac(int n) {
if (n==1) {
return 1;
}
else {
return n*fac(n-1);
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น
บทความใหม่กว่า
บทความที่เก่ากว่า
หน้าแรก
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น