Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char word[16];
- char mx[16], mn[16];
- bool flag = false;
- while(cin >> word){
- if(strlen(word) % 2 == 0){
- if(strlen(mx) < strlen(word)){
- strcpy(mx, word);
- }
- if(strlen(mn) > strlen(word) || flag == false){
- strcpy(mn, word);
- }
- flag = true;
- }
- }
- if(flag == true){
- cout << mn << " " << mx << endl;
- }else{
- cout << -1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment