Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int one [3] = { 'o', 'n', 'e' };
- int two = [3] = {'t', 'w', 'o'};
- int three = [5] = {'t', 'h', 'r', 'e', 'e'};
- int j = strlen(input);
- if(j > 4) {
- // é three, two e one não tem mais de 3 caracteres
- return true;
- }
- int oneChances = 0;
- int twoChances = 0;
- for(int i= 0; i != j; i++) {
- if(input[i] == one[i]) {
- oneChances ++;
- }
- else if(input[i] == two[i]) {
- twoChances ++;
- }
- }
- if( oneChances == twoChances ) {
- // impossivel determinar
- }
- else if( oneChances > twoChances ) {
- // mais similar a one
- }
- else {
- // mais similar a two
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement