Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main() {
- int n;
- const char old[] = "Nemo";
- scanf("%d", &n);
- char s[n][90];
- for (int i = 0; i < n; i++)
- {
- fflush(stdin);
- gets(s[i]);
- }
- for (int i = 0 ; i < n ; i++)
- {
- if (s[i][0] == old[0] && s[i][1] == old[1])
- {
- if (i == n - 1)
- {
- printf("%s and %s", s[i-1], s[0]);
- break;
- }
- else
- {
- printf("%s and %s", s[i-1], s[i+1]);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement