Untitled
unknown
plain_text
3 years ago
359 B
8
Indexable
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int main() {
ifstream in("func.txt");
ofstream out("result.txt");
string h;
int c;
in >> c;
string j; int k = 0;
for (int i = 0; i < c; i++){
in >> h;
if (h.size() > k) {
k = h.size();
j = h;
}
}
out << k << "\n" << h;
}Editor is loading...