遇到測資很大,data type 使用(unsugned) long long,print char 為 %llu
[code]
#include <stdio.h>
unsigned long long int f(int a){
if(a==1||a==0)
return 1;
else return a+f(a-1);
}
unsigned long long int g(int b){
if(b==1||b==0)
return 1;
else return f(b)+g(b-1);
}
int main(){
int n,i;
while(scanf("%d",&n)!=EOF){
printf("%llu %llu\n",f(n),g(n));
}
return 0;
}