so input would be
Q1,2,3-5
output would be
do problems 1,2,3,4,5 of Q
#include <iostream>
#include <cstdlib>
#include <sstream>
#include <string>
using namespace std;
int main()
{
cout <<"enter the problemset and number""\n";
//problems represents name and numbers
string problems;
char quote;
char num;
string number;
//gather name
if(cin.peek()=='"' || cin.peek() == '\'')
{
cin >>quote;
getline(cin,problems,quote);
}
else
{
while (!isdigit(cin.peek()) && !isspace(cin.peek()))
{
(char)cin.peek();
problems += cin.get();
}
}
//gather problem numbers
//cin >> num;
int lastdigit=0;
while(num != '\n'){
cin.get(num);
cout<<"very beginning\n"<<num;
if(num==',')
{
if(isdigit(cin.peek()))
{
cin.get(num);
cout<<"from comma\n"<<number<<"\n";
}
}
else if(num=='-')
{
if(isdigit(cin.peek()))
{
cin.get(num);
cout<<"the value of # is\n"<<num;
for(int a=lastdigit; a<num; a++)
{
}
}
}
number=number+num;
}
cout<<"the final number is"<<number<<"\n";
// print them all out
return 0;
}