hafez1
جمعه 05 آبان 1391, 21:26 عصر
یکی برام توضیح بده این کدو:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
void main()
{
string myText;
cin>>myText;
istringstream iss(myText);
string token;
string token2;
while(getline(iss, token, '+'))
{
istringstream iss2(token);
while(getline(iss2, token2, '-'))
{
if(token2!=token)
cout<<token2<<endl;
else
cout << token <<endl;
}
}}
به خصوص خط نهش.
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
void main()
{
string myText;
cin>>myText;
istringstream iss(myText);
string token;
string token2;
while(getline(iss, token, '+'))
{
istringstream iss2(token);
while(getline(iss2, token2, '-'))
{
if(token2!=token)
cout<<token2<<endl;
else
cout << token <<endl;
}
}}
به خصوص خط نهش.