Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int IzbaciPodniz (int *p1, int *p2, const int *q1, const int *q2)
- {
- int broj_el2 = q2-q1;
- int brojac_podnizova=0;
- int *pom1=p1;
- const int *pom2=q1;
- int *za_izbacivanje;
- while(pom1<p2) {
- if(*pom1==*q1) {
- za_izbacivanje=pom1;
- while(pom2<q2) {
- if(*pom1==*pom2) {
- pom1++;
- pom2++;
- }else if(*pom1 != *pom2 && q2-pom2 != 0) {
- pom2=q1;
- pom1--;
- break;
- }
- }
- if(q2-pom2==0) {
- brojac_podnizova++;
- while(pom1 < p2) {
- *za_izbacivanje=*pom1;
- za_izbacivanje++;
- pom1++;
- }
- pom1=p1-1;
- pom2=q1;
- p2 = p2-broj_el2;
- }
- }
- pom1++;
- }
- return brojac_podnizova*broj_el2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement