hdu 1210 简单数学模拟

来源:互联网 发布:edu域名如何注册 编辑:程序博客网 时间:2024/06/04 19:20

     不需要多说啥了吧

#include<iostream>using namespace std;#include<cstdio>int main(){    int n;    while(cin>>n)    {        int ans=1,t=2;        while(t!=1)        {            if(t<=n)                t*=2;            else                t=(t-n)*2-1;            ans++;        }        cout<<ans<<endl;    }    return 0;}


 

原创粉丝点击