Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int czy_zdanie (char tekst[]) // Duże litery ASCII od 65 do 90
- {
- int i = 0;
- for(i=0 ; tekst[i] != 0 ; i++);
- if(*tekst < 65 || *tekst > 90 || tekst[i-1] != '.')
- return 0;
- return 1;
- }
- // SPRAWDZENIE
- char tekst[] = "Hello World";
- char tekst2[] = "hello World";
- char tekst3[] = "Hello World.";
- int main()
- {
- printf("%d\n" , czy_zdanie(tekst));
- printf("%d\n" , czy_zdanie(tekst2));
- printf("%d\n" , czy_zdanie(tekst3));
- return 0;
- }
Add Comment
Please, Sign In to add comment