ZJU1088

来源:互联网 发布:淘宝申请退款时限 编辑:程序博客网 时间:2024/06/05 08:52
// 1088.cpp : Defines the entry point for the console application./**************************************//**************joseph环问题************//**************************************/#include "stdafx.h"#include "iostream"using namespace std;int m,n;int search(int j){int i;int from=0;for(i=2;i<n;++i){from=(from+m)%i;}if(from==0) return 1;else return 0;}int main(int argc, char* argv[]){   m=1;cout<<"input your number:";while((cin>>n)&&(n>0)){while(!search(n)){++m;}cout<<"is :"<<m<<endl<<"input your number:";m=1;}printf("Hello World!\n");return 0;}

原创粉丝点击