Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int velke(char *p_pole, int j)
- {
- int i=0;
- if (toupper(*p_pole)!='A' && toupper(*p_pole)!='G' && toupper(*p_pole)!='C' && toupper(*p_pole)!='T' && toupper(*p_pole)!='*')
- {
- printf("Polozky nie su nacitane\n");
- return 1;
- }
- while(i<j && *(p_pole+i)!='\0')
- *(p_pole+i++)=toupper(*(p_pole+i));
- #ifdef LADENIE
- for(i=0; i<MAX; i++)
- {
- if (*(p_pole+i)=='\0')
- break;
- else
- putchar(*(p_pole+i));
- }
- putchar('\n');
- #endif
- return 0;
- }
- int pridanie(char pole[]){
- int i, pocet=0, j;
- char x;
- if (pole[0]!='A' && pole[0]!='G' && pole[0]!='C' && pole[0]!='T' && pole[0]!='*')
- {
- printf("Polozky nie su nacitane\n");
- return 1;
- }
- while(getchar()!='\n');
- x=getchar();
- for(i=0; i<MAX; i++)
- {
- if(toupper(pole[i])==toupper(x))
- pocet++;
- if(pole[i]=='\0')
- break;
- }
- if(i+pocet>=MAX)
- {
- printf("Do pola nie je mozne vlozit prvky\n");
- return 0;
- }
- i=0;
- while(i<MAX && pole[i]!='\0')
- {
- if(toupper(pole[i])==toupper(x))
- {
- for(j=MAX-1; j>i; j--)
- pole[j]=pole[j-1];
- pole[i]='*';
- i++;
- }
- i++;
- }
- #ifdef LADENIE
- for(i=0; i<MAX; i++)
- {
- if (pole[i]=='\0')
- break;
- else
- putchar(pole[i]);
- }
- putchar('\n');
- #endif
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement