Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- string a[256],b;
- int k = 0, d = 1;
- cin >> a[0];
- b = a[0];
- for(int i = 1; i < 256; ++i){
- cin >> a[i];
- if(a[i]=="\0")break;
- ++d;
- if(a[i].size() > b.size()){
- k = i;
- b = a[i];
- }
- }
- //cout << k << endl << d << endl;
- for(int i = 0; i < d; ++i)cout << a[i] << endl;
- for(int i = 0; i < d; ++i){
- if(i!=k){cout << a[i];
- if(i+1<d)cout << ' ';}
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement