데블스 캠프 첫번째 (c++)
~cpp #include <iostream> using namespace std; void main() { cout<<"\t구구단\n"; for(int i=1;i<=9;i++) { for(int j=2;j<=5;j++) { cout<<j<<" * "<<i<<" = "<<i*j<<"\t"; } cout<<endl; } cout<<endl<<endl; for(int k=1;k<=9;k++) { for(int m=6;m<=9;m++) cout<<m<<" * "<<k<<" = "<<k*m<<"\t"; cout<<endl; } }
셋째날 (scheme)
~cpp (define (mul x y) (begin (print x) (print * )(print y)(print = ) (print (* x y))(newline))) (define (num a b) (if (<= b 9)(begin (mul a b)(num a (+ b 1))) (when (< a 9) (begin (num (+ a 1) 1))))) (num 2 1)