Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int length (char *s) {
- int d=0;
- while (*(s++)!='\0') d++;
- return d;
- }
- int JeLiSamoglasnik (char c) {
- if (tolower(c)=='a' || tolower(c)=='e' || tolower(c)=='i' || tolower(c)=='o' || tolower(c)=='u') return 1;
- return 0;
- }
- int JeLiVeliko (char c) {
- if (c>='A' && c<='Z') return 1;
- return 0;
- }
- int JeLiMalo (char c)
- {
- if (c>='a' && c<='z') return 1;
- return 0;
- }
- void Promjeni(char *s) {
- int i;
- for (i=0; i<length(s); i++)
- {
- if (JeLiSamoglasnik(s[i])) {
- if (JeLiVeliko(s[i])) s[i]+=32;
- else if (JeLiMalo(s[i])) s[i]-=32;
- }
- }
- }
- int main () {
- char s[]="Selma234 je bIlA 5678 ovdje 123.";
- Promjeni(s);
- printf("%s", s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement