• 検索結果がありません。

陷讎奇スクー陷スヲ騾?關br/>

N/A
N/A
Protected

Academic year: 2021

シェア "陷讎奇スクー陷スヲ騾?關br/>"

Copied!
2
0
0

読み込み中.... (全文を見る)

全文

(1)

1

再帰処理の例

1.1

Σ

n 1

から

n

までの和

/* recsum.c 再帰で和を求める C言語演習 白石修二/小林錦子 森北出版 118頁 CTL + c で終了 */ #include <stdio.h> int s(int n); int main() { int n; for(;;){ printf("n = ");

if(scanf("%d", &n) == EOF) break; printf("S(%d) = %d\n", n, s(n)); } return 0; } int s(int n) { if(n == 1) return 1; else return n + s(n - 1); } 1

(2)

1.2

簡単な再帰

/* 簡単な再帰 accum.c */ #include <stdio.h> int add(int i) { if(i > 10){ return i; }else{ printf("%d\n", i); i++; add(i); return 0; } } int main() { int i; i = 0; add(i); return 0; } 2

参照

関連したドキュメント

Here, instead of considering an instance I and trying to directly develop a feasible solution for the P, G ∗ |prec; c ij dπ k , π l 1; p i 1|C max problem, we consider a

There is a bijection between left cosets of S n in the affine group and certain types of partitions (see Bjorner and Brenti (1996) and Eriksson and Eriksson (1998)).. In B-B,

We establish sharp Br´ezis-Gallou¨et-Wainger type inequalities in Besov and Triebel-Lizorkin spaces as well as fractional Sobolev spaces on a bounded domain Ω ⊂ R n.. We treat

(The Elliott-Halberstam conjecture does allow one to take B = 2 in (1.39), and therefore leads to small improve- ments in Huxley’s results, which for r ≥ 2 are weaker than the result

[r]

“Breuil-M´ezard conjecture and modularity lifting for potentially semistable deformations after

lines. Notice that Theorem 4 can be reformulated so as to give the mean harmonic stability of the configuration rather than that of the separate foliations. To this end it is

S., Oxford Advanced Learner's Dictionary of Current English, Oxford University Press, Oxford