Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Uri/Beecrowd problem no - 1151 solution in C

#include<stdio.h>
int main(){
    int N,i,n[100];
    scanf("%d", &N);
    
    n[0] = 0;
    n[1] = 1;
    
    for(i = 2; i < N; i++){
        n[i] = n[i-1] + n[i-2];
    }
    printf("0");
    for(i = 1; i < N; i++){
        printf(" %d", n[i]);
    }
    printf("
");
    return 0;
}
Source by www.beecrowd.com.br #
 
PREVIOUS NEXT
Tagged: #problem #solution #C
ADD COMMENT
Topic
Name
3+8 =