Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://vk.com/evgenykravchenko0
- ___ ___ ___
- / /\ ___ / /\ / /\
- / /:/_ /__/\ / /:/_ / /:/_
- / /:/ /\ \ \:\ / /:/ /\ / /:/ /\
- / /:/ /:/_ \ \:\ / /:/_/::\ / /:/ /:/_
- /__/:/ /:/ /\ ___ \__\:\ /__/:/__\/\:\ /__/:/ /:/ /\
- \ \:\/:/ /:/ /__/\ | |:| \ \:\ /~~/:/ \ \:\/:/ /:/
- \ \::/ /:/ \ \:\| |:| \ \:\ /:/ \ \::/ /:/
- \ \:\/:/ \ \:\__|:| \ \:\/:/ \ \:\/:/
- \ \::/ \__\::::/ \ \::/ \ \::/
- \__\/ ~~~~ \__\/ \__\/
- ___
- /__/\ ___ ___
- \ \:\ / /\ / /\
- \ \:\ / /:/ / /:/
- _____\__\:\ /__/::\ /__/::\
- /__/::::::::\ \__\/\:\__ \__\/\:\__
- \ \:\~~\~~\/ \ \:\/\ \ \:\/\
- \ \:\ ~~~ \__\::/ \__\::/
- \ \:\ /__/:/ /__/:/
- \ \:\ \__\/ \__\/
- \__\/
- #include <stdio.h>
- int position_words (char firstword[], char secondword[])
- {
- int i;
- int l = 5;
- int count = 0;
- for (i = 0; i < l; i++)
- if (firstword[i] != secondword[i] && firstword[i] >= 'A' && firstword[i] <= 'z' && secondword[i] >= 'A' && secondword[i] <= 'z')
- count++;
- return count;
- }
- int main()
- {
- char* sentence[] = {"hello", "world"};
- int l = 2;
- int maxpos = 0;
- int curent;
- int next;
- for (curent = 0; curent < l; curent++)
- for (next = 0; next < l; next++)
- if (position_words(sentence[curent], sentence[next]) > maxpos)
- maxpos = position_words(sentence[curent], sentence[next]);
- printf("Отлично позиций : %d ", maxpos);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement