poj2244 Eeny Meeny Moo

Source Code

Problem: 2244  User: billforum 
Memory: 252K  Time: 32MS 
Language: C++  Result: Accepted 

Source Code 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;



int main()
{
    int n,m;
    while(cin>>n)
    {
        if(n==0) break;

        for(m=1;;m++)
        {
        int ans=0;
        for(int i=2;i<=n-1;i++)
        ans=(ans+m)%i;
        if(ans==0) break;
        }

      cout<

 

转载于:https://www.cnblogs.com/wuzhibin/archive/2012/02/17/2356090.html

你可能感兴趣的:(poj2244 Eeny Meeny Moo)