zoukankan      html  css  js  c++  java
  • 杭电1021

    此题还是一道规律题,不能直接算!!!否则将超时!!呵呵!
    先观察计算出前30项如下:
    1 2 0 2 2 1 0 1    1 2 0 2 2 1 0 1.......规律出来了!哈!
    那还等什么,直接ac掉!!!
    #include<iostream>
    using namespace std;
    int main()
    {
     int n,i,a[]={1,2,0,2,2,1,0,1};
      while(cin>>n)
      {
       i=n%8;
            if(a[i]==0)
       cout<<"yes"<<endl;
      else
       cout<<"no"<<endl;
     
      }
      return 0;
    }

  • 相关阅读:
    从Python到Web开发
    源码安装缺少configure文件
    5
    4
    3
    2
    42
    1
    18
    41
  • 原文地址:https://www.cnblogs.com/xiohao/p/2755605.html
Copyright © 2011-2022 走看看