
Практикум по программированию на языке С,
Вычислительная физика, Теория алгоритмов.
ФНБИК МФТИ
2015-2016 учебный год
1 #include<stdio.h>
2 void printd(int n);
3 int main(void){
4 int n =789012;
5 printd(n);
6 printf("\n");
7 return 0;
8 }
9 void printd(int n){
10 if(n < 0){
11 putchar('-');
12 n=-n;
13 }
14 if(n/10)
15 printd(n/10);
16 putchar(n%10 + '0');
17 }
==================================================================
1 #include<stdio.h>
2 void func(int n);
3
4 int main(void ){
5 func(5);
6 return 0;
7 }
8
9 void func(int n){
10 static int a[15];
11 int b[15];
12 static int c=1;
13 int d=1;
14 d++; c++;
15 printf("n= %-2d the addresses of a and b are %p %p\n", n, a, b);
16 printf(" the addresses of c and d are %p %p\n", &c, &d);
17 printf(" c %d d %d\n",c ,d);
18
19 if(n > 0) func(n-1);
20 }