Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int czyOk1(char haslo[])
- {
- int licznikDuzychLiter = 0;
- int licznikMalychLiter = 0;
- int licznikCyfr = 0;
- if(sizeof(haslo)==8)
- {
- printf("gitara");
- for(int i=0; i < sizeof(haslo); i++)
- {
- if(haslo[i] >= 'a' && haslo[i] <= 'z')
- {
- licznikMalychLiter++;
- }
- else if(haslo[i] >= 'A' && haslo[i] <= 'Z')
- {
- licznikDuzychLiter++;
- }
- else if(haslo[i] >= '0' && haslo[i] <= '9')
- {
- licznikCyfr++;
- }
- else
- {
- return 0;
- }
- }
- if(licznikMalychLiter > 0 && licznikCyfr > 0 && licznikDuzychLiter > 0)
- {
- printf("\nWszystko dobrze jest w porzadku");
- return 1;
- }
- }
- printf("\ndupa");
- return 0;
- }
- int czyOk2(char haslo[])
- {
- if(sizeof(haslo) >= 8 && sizeof(haslo) <= 10 && haslo[0] >= 'A' && haslo[0] <= 'Z')
- {
- for(int i = 1; i < sizeof(haslo); i++)
- {
- if(haslo[i] >= '0' && haslo[i] <= '9')
- {
- if(i!=sizeof(haslo)-2)
- {
- if(haslo[i] == haslo[i-1] || haslo[i] == haslo[i+1])
- {
- printf("\ndupa1");
- return 0;
- }
- }
- }
- else
- {
- printf("\ndupa2");
- return 0;
- }
- }
- printf("\ngitara");
- return 1;
- }
- else
- {
- printf("\ndupa3");
- return 0;
- }
- }
- int main()
- {
- char haslo[8]={'Z','1','5','2','6','3','1','2'};
- printf("Danio to jest gosc\n");
- czyOk1(haslo);
- czyOk2(haslo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement