06/12/11 20:53:00
>>20
#include<stdio.h>
#include<stdlib.h>
#define N 10
int func(int n);
int main(void){
printf("%d\n", func(N));
return EXIT_SUCCESS;
}
int func(int n){
if(n== 1 || n== 2)return 1;
return func(n-1) + func(n-2);
}
#include<stdio.h>
#include<stdlib.h>
#define MIN 0.0
#define MAX 10.0
#define SPAN 0.1
int main(void){
double cnt;
for(cnt=MIN; cnt<MAX; cnt+=SPAN){
double ans;
ans = cnt*cnt+cnt+1.0;
printf("x = %f y = %f\n",cnt, ans);
}
return EXIT_SUCCESS;
}