JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Untitled Page | JustPaste.app
16 days ago2 views
👨‍💻Programming
#include<stdio.h>
#include<string.h>

int main() {
    char t[]="ABABDABACDABABCABAB";
    char p[]="ABAB";
    int n=strlen(t), m=strlen(p);

    for(int i=0;i<=n-m;i++) {
        int j;
        for(j=0;j<m && t[i+j]==p[j];j++);

        if(j==m)
            printf("Found at %d\n",i);
    }
}
← Back to timeline