Fibonacci again cannot be underestimated.

Source: Internet
Author: User
# Include <stdio. h> # include <stdlib. h> # include <string. h >__ int64 f [1000110]; int main () {int I, n; while (scanf ("% i64d", & N )! = EOF) {memset (F, 0, sizeof (f); F [0] = 7, F [1] = 11; for (I = 2; I <= N; I ++) f [I] = f [I-1] + F [I-2]; If (! (F [N] % 3) printf ("Yes \ n"); else printf ("NO \ n");} return 0 ;} if the value is too large, _ int64 cannot be used. The above is always wa...
Find the rule.
Values of item 2, 6, 10, 14 can be divisible by 3, and the rule can be assumed that when the N-2 can be divisible by 4, the value of item N can be divisible by 3 ..
#include<stdio.h>#include<stdlib.h>#include<string.h>int main( ){ int i,n; while(scanf("%d",&n)!=EOF) {   if((n+2)%4==0)   printf("yes\n");   else   printf("no\n"); } return 0;} 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.