| f(n) | g(n) |
| 10n | |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
![]()
for
.







f (n, 10, 0); g (n, m, k); h (n, m, 1000000);
for (int i = 0; i < n; ++i)
f (n, m, k);for (int i = 0; i < e (n, 10, 100); ++i)
f (n, 10, 0);for (int i = 0; i < e (n, m, k); ++i)
f (n, 10, 0);for (int i = 0; i < n; ++i)
for (int j = i; j < n; ++j)
f (n, m, k);
class Example
{
static int f (int n)
{
int sum = 0;
for (int i = 1; i <= n; ++i)
sum = sum + i;
return sum;
}
// ...
}class Example
{
// ...
static int g (int n)
{
int sum = 0;
for (int i = 1; i <= n; ++i)
sum = sum + i + f (i);
return sum;
}
}class Example
{
// ...
int h (int n)
{ return f (n) + g (n); }
}