Hi.
In my code I used a list to simulate a circle and declared two iterators to traverse it.
while running,an exception appeared after eight elements was printed,stating that list iterator not decremental.
what caused this and how do i fix it?
here's my code:
#include<iostream>
#include<list>
using namespace std;
list<int> l;
int n,k,m;
int main(){
freopen("in.txt","r",stdin);
while(cin>>n>>k>>m&&n){
for(int i=1;i<=n;i++) l.push_back(i);
k%=n;
m%=n;
list<int>::iterator it1=l.begin();
list<int>::reverse_iterator it2=l.rbegin();