HDU2149-Public Sale:简单巴什博奕
见代码,思路清晰
#include<iostream> using namespace std; int main() { int m, n; vector<int>V; while( cin>>m>>n ) { if( n>=m ) { bool IsFirst = true; for( int i=m; i<=n; i++ ) if( IsFirst ){ cout<<i; IsFirst = false; } else cout<<" "<<i; cout<<endl; } else if( m%(n+1)!=0 ) cout<<m%(n+1)<<endl; else cout<<"none"<<endl; } return 0; }