[ create a new paste ] login | about

Link: http://codepad.org/omT0gjIC    [ raw code | output | fork ]

C++, pasted on Feb 23:
//Assignment
#include <iostream>

using namespace std;

int main(){
    string S, P;
    cin >> S >> P;
    for (int i = 0; i < S.size() - P.size; i++){
        int count = 0;
        int k = i;
        for (int j = 0; j < P.size(); j++){
            if (P[j] = S[i+j] && P[j] = '*'){
              k++;
              count++;
              if(count == P.size())
                   cout << i;
                   break;
               }
        }
    }
}


Output:
1
2
3
In function 'int main()':
Line 9: error: invalid use of member (did you forget the '&' ?)
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: