View Code of Problem 84

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <stack>
#include <map>
#include <set>
#include <queue>
using namespace std;

string change(string a)
{
    int len=a.size();
    string temp="";
    for(int i=0;i<len;i++)
    {
        temp+=tolower(a[i]);
    }
    return temp;
}

int main()
{
    string str;
    while(getline(cin,str))
    {
        for(int i=0;i<str.size();i++)
        {
            string temp="";
            while((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z'))
            {
                temp+=str[i++];
            }
            string pare=change(temp);
            if(pare=="salt")
            {
                cout<<str<<endl;
                break;
            }
        }
    }
    return 0;



    return 0;
}

Double click to view unformatted code.


Back to problem 84