Guest User

Untitled

a guest
Jun 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int czy_zdanie (char tekst[]) // Duże litery ASCII od 65 do 90
  5. {
  6. int i = 0;
  7. for(i=0 ; tekst[i] != 0 ; i++);
  8. if(*tekst < 65 || *tekst > 90 || tekst[i-1] != '.')
  9. return 0;
  10. return 1;
  11. }
  12.  
  13. // SPRAWDZENIE
  14.  
  15. char tekst[] = "Hello World";
  16. char tekst2[] = "hello World";
  17. char tekst3[] = "Hello World.";
  18.  
  19. int main()
  20. {
  21. printf("%d\n" , czy_zdanie(tekst));
  22. printf("%d\n" , czy_zdanie(tekst2));
  23. printf("%d\n" , czy_zdanie(tekst3));
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment