#include<bits/stdc++.h> using namespace std; int main() { char c[1000], c2[5]; int i, index=0; while(gets(c)) { i=0; while(i+3<strlen(c)) { index=i; for(int j=0; j<4; j++) c2[j]=c[index++]; if(strcasecmp(c2,"salt")==0) { puts(c); break; } i++; } } } |
Double click to view unformatted code.