Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sstream>
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- string inputstr;
- string function;
- int arr[100] = {0};
- int i = 0;
- int para1;
- int para2;
- stringstream ss;
- getline(cin, inputstr);
- ss << inputstr;
- for(i=0;i<inputstr.length();i+= 2){
- if(isdigit(inputstr[i])){
- ss >> arr[i];
- cout<<"int: "<<arr[i]<<endl;
- }
- else if(isalpha(inputstr[i])){
- ss>>function;
- break;
- }
- }
- ss>>para1;
- ss>>para2;
- cout<<"parameter1: "<<para1<<endl;
- cout<<"parameter2: "<<para2<<endl;
- cout<<"function: "<<function<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement