Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char chr[] = " .,-;:'""()?!", ss[2000]="", s[1000];
- ifstream fin(input_file_name);
- while(fin.get(s, 256))
- {
- int n = strlen(s);
- for(int i = 0; i<(int)strlen(s); i++)
- {
- while(i<n && strchr(chr, s[i]))
- {
- for(unsigned int j = i; j<strlen(s); j++)
- s[j] = s[j+1];
- n--;
- }
- }
- strcat(ss, s);
- fin.get();
- }
- if((int)strlen(ss) < N)
- N = strlen(ss);
- char s1[N], aux[N];
- unsigned int poz = -1;
- strncpy(aux, ss, N);
- strncpy(s1, ss, N);
- for(int i = 0; i<N; i++)
- {
- char c[1];
- c[0] = s1[0];
- for(int j = 0; j<N-1; j++)
- s1[j] = s1[j+1];
- s1[N-1] = c[0];
- //cout << s1 << endl;
- if(strcmp(aux, s1) > 0)
- {
- strncpy(aux, s1, N);
- poz = i + 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement