Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Nizovi Stringova 2.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char prez[10][30];
- int i, s = 0, length = 0, br = 0, p = 0;
- for (i = 0; i < 5; i++)
- scanf("%s", prez[i]);
- printf("Prezimena koja se zavrsavaju sa 'ic' su: \n");
- for (i = 0; i < 5; i++)
- {
- length = strlen(prez[i]);
- s = length - 2;
- p = length - 1;
- if (prez[i][s] == 'i' && prez[i][p] == 'c' || prez[i][s] == 'I' && prez[i][p] == 'C')
- {
- printf("%s\n", prez[i]);
- br++;
- }
- }
- printf("i ima ih: \n%d", br);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement