Untitled
unknown
plain_text
3 years ago
408 B
11
Indexable
#include <iostream>
#include <math.h>
#include <string>
#include <fstream>
using namespace std;
int main()
{
int a, n1, n2;
string b[10000];
ifstream file1("sex2.txt");
file1 >> a;
n1 = b[0].length();
n2 = 0;
for (int i = 1; i < a; i++)
{
file1 >> b[i];
if (n1 > b[i].length()) n1 = n1;
if (n1 < b[i].length()) n1 = b[i].length(), n2=i;
}
cout << b[n2] << endl << n1;
}Editor is loading...