CCF-2019-12-1

落花浮王杯 提交于 2020-02-01 14:19:47

#include <iostream>

using namespace std;

struct info {

       int per;

       int jmp;

} player[4];

int main() {

       int n;

       cin >> n;

       for(int i=0; i<4; ++i) {

              player[i].per=0;

              player[i].jmp=0;

       }

 

 

       for (int i=0,tem=1; i<n; ++i,++tem) {

              int x = tem;

              while(x) {

                     if(x%10==7) {

                            x=1;

                            break;

                     }

                     else x /= 10;

              }//判断数字中是否有数字x

              if((tem%7==0)||x) {

                     ++player[(tem-1)%4].jmp;

                     --i;

              } else {

                     player[(tem-1)%4].per = tem;

              }

       }

 

 

       for (int i=0; i<4; ++i)

              cout << player[i].jmp <<endl;

       return 0;

}

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!