Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #define max 17
  4.  
  5. int charToNum(char a){
  6. if (a == 'A' || a == 'a' || a == '4' || a == 'E' || a == 'e' || a == '3' || a == 'I' || a == 'i' || a == '1' || a == 'O' || a == 'o' || a == '0' || a == 'S' || a == 's' || a == '5')
  7. return 3;
  8. else if (isalpha(a))
  9. return 2;
  10.  
  11. return 1;
  12. }
  13.  
  14. int main() {
  15. int casos, i, j, resposta;
  16. char entrada[max];
  17. scanf("%d", &casos);
  18.  
  19. for (i = 0; i < casos; i++){
  20. scanf("%s", entrada);
  21. j = 0;
  22. resposta = 1;
  23. while(entrada[j] != '\0'){
  24. resposta *= charToNum(entrada[j]);
  25. j++;
  26. }
  27. printf("%d\n", resposta);
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement