More actions
imported>Unknown No edit summary |
(Repair batch-0004 pages from live compare) |
||
| Line 42: | Line 42: | ||
x := 2. | x := 2. | ||
y := 1. | y := 1. | ||
8 timesRepeat: | 8 timesRepeat: [9 timesRepeat: [ Transcript show:x*y; cr. y := y + 1. ]. x := x + 1. y := 1 ]. | ||
* workspace | * workspace | ||
gugudan := Gugudan new. | gugudan := Gugudan new. | ||
| Line 63: | Line 63: | ||
---- | ---- | ||
[[구구단]], [[조재화]] | [[구구단]], [[조재화]] | ||
Latest revision as of 00:37, 27 March 2026
데블스캠프 첫쨋날 구구단 코드.
처음 짠 코드
#include<iostream>
using namespace std;
int main()
{
for(int i=1; i<10 ; i++)
{
for(int j=2; j<6; j++)
{
cout<<j<<"*"<<i<<"="<<j*i<<"\t";
}
cout<<endl;
;
}
cout<<endl;
for(int d=1; d<10 ; d++)
{
for(int k=6; k<10; k++)
{
cout<<k<<"*"<<d<<"="<<k*d<<"\t";
}
cout<<endl;
}
return 0;
}
데블스캠프 세째날
Squeak
- cho 클래스
Object subclass: #Gugudan instanceVariableNames: classVariableNames: poolDictionaries: category: 'cho'
- printGugudan 메소드
printGugudan | x y | x := 2. y := 1. 8 timesRepeat: [9 timesRepeat: [ Transcript show:x*y; cr. y := y + 1. ]. x := x + 1. y := 1 ].
- workspace
gugudan := Gugudan new. gugudan printGugudan.
- Scheme
(define (inter x y)
( when (< x 10)
(if (= y 10)
(begin (inter (+ x 1) 1) )
(begin (print x)(print *)(print y)(print =)(print (* x y))(newline) (inter x (+ y 1)) )
)
)
)
(inter 2 1)