#include #include //i'm flattered by the fact that i'll receive full feedback on this. warms my heart, i tell you // : " ) <-- me blushing int main(){ std::stringstream result; bool thingsHappened = false; int totalNumbers=0, aNumber=0, anotherOne=0; std::cin >> totalNumbers; for(int counter = 0; counter < totalNumbers; counter++){ std::cin >> aNumber; if(aNumber - anotherOne > 1){ thingsHappened = true; result<< anotherOne+1 << "-" << aNumber-1<< "\n"; } anotherOne = aNumber; } if(anotherOne <= 99){ thingsHappened = true; result << anotherOne + 1 << "-100"; //the rare doublehack in full effect } if(!thingsHappened){ std::cout<<"All clear!"; return 0; } std::cout << result.str(); }