SHARE
TWEET

Untitled

a guest Jun 20th, 2019 61 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 intstr;
  10.     string function;
  11.     int arr[100] = {0};
  12.     int i = 0;
  13.     int para1;
  14.     int para2;
  15.     stringstream ss;
  16.     getline(cin, inputstr);
  17.  
  18.     ss << inputstr;
  19.     for(i=0;i<inputstr.length();i++){
  20.     if(isdigit(inputstr[i])){
  21.         ss >> arr[i];
  22.         cout<<"int: "<<arr[i]<<endl;
  23.     }
  24.  
  25.     else if(isalpha(inputstr[i])){
  26.  
  27.         function += inputstr[i];
  28.     }
  29.  
  30.  
  31. }
  32. ss>>para1;
  33. cout<<"parameter1: "<<para1<<endl;
  34. cout<<"function: "<<function<<endl;
  35. }
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