SHARE
TWEET

Untitled

a guest Jun 20th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <sstream>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.     string inputstr;
  9.     string function;
  10.     int arr[100] = {0};
  11.     int i = 0;
  12.     int para1;
  13.     int para2;
  14.     stringstream ss;
  15.     getline(cin, inputstr);
  16.  
  17.     ss << inputstr;
  18.  
  19.  
  20.  
  21.     for(i=0;i<inputstr.length();i+= 2){
  22.     if(isdigit(inputstr[i])){
  23.         ss >> arr[i];
  24.         cout<<"int: "<<arr[i]<<endl;
  25.     }
  26.  
  27.     else if(isalpha(inputstr[i])){
  28.  
  29.         ss>>function;
  30.         break;
  31.     }
  32.  
  33.  
  34.  
  35. }
  36. ss>>para1;
  37. ss>>para2;
  38. cout<<"parameter1: "<<para1<<endl;
  39. cout<<"parameter2: "<<para2<<endl;
  40. cout<<"function: "<<function<<endl;
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top