Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Esercizio N6 - Novizio
- Inserita una frase, voglio che tutte le vocali vengano sostituite con la lettera X e poi che la nuova frase venga
- stampata su schermo.
- Piccolo consiglio: qui si parla di stringhe.*/
- #define STRINGALEN 50
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int vocali_Mod (int c);
- int main ()
- {
- char s[80];
- int i;
- gets(s);
- for (i=0; i<STRINGALEN; i++)
- {
- if (isalpha(s[80]) && vocali_Mod(s[80]))
- {
- s[80] = 'X';
- }
- }
- puts(s);
- }
- int vocali_Mod (int c)
- {
- switch(c)
- {
- case 'A' : ;
- case 'a' : ;
- case 'E' : ;
- case 'e' : ;
- case 'I' : ;
- case 'i' : ;
- case 'O' : ;
- case 'o' : ;
- case 'U' : ;
- case 'u' : return 1;
- default : return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement