Submission

Status:
PPPPP-----

Score: 50

User: Cmoss9

Problemset: อนุกรม

Language: c

Time: 0.001 second

Submitted On: 2024-10-08 19:56:47

#include <stdio.h>
int main () {
    int n,output;
    scanf("%d", &n);
    int arr[100];
    arr[0] = 1,arr[1] = 1;
    for (int x = 2; x <= n; x++) {
        arr[x] = arr[x-1] + arr[x-2];
    }
    printf("%d",arr[n-1]);
}