0% found this document useful (0 votes)
12 views1 page

Kuunnu

The document contains code to take in two strings as input, extract any numeric values from the strings, convert them to integers, sum them and output the result. The code uses loops and conditionals to parse the strings, streams to convert to integers and perform arithmetic, and output the final sum.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Kuunnu

The document contains code to take in two strings as input, extract any numeric values from the strings, convert them to integers, sum them and output the result. The code uses loops and conditionals to parse the strings, streams to convert to integers and perform arithmetic, and output the final sum.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP,
Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS,
JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <iostream>
#include <sstream>
#include<vector>

using namespace std;

int main()
{
string s,s1;

cout<<"please enter a string"<<endl;


getline(cin,s);

cout<<"please enter a string two"<<endl;


getline(cin,s1);

int i=0;
string num, num1;

while(i<s.size()||i<s1.size())
{ int f=s[i];
if(f==48||f==49||f==50||f==51||f==52||f==53||f==54||f==55||f==56||f==57)
{
num.push_back(s[i]);
}
f=s1[i];
if(f==48||f==49||f==50||f==51||f==52||f==53||f==54||f==55||f==56||f==57)
{
num1.push_back(s1[i]);
}
i++;
}
int sum;
stringstream sso;

sso<<num;
sso>>sum;

sso.clear();
int a;

sso<<num1;
sso>>a;

cout<<a+sum;

return 0;
}

You might also like