//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream f("F1.txt");
size_t max_size;
string s, max_word, word;
while ( getline(f, s) ) {
istringstream is(s);
max_size = 0;
while (is >> word) {
if (max_size < word.size()) {
max_size = word.size();
max_word = word;
} else if (max_size == word.size()) {
max_word += " = ";
max_word += word;
}
}
cout << max_size << ' ' << max_word << endl;
}
}
_____________________________
Пример:
asfasfafs sdf sdg xcz
zxcvxcv sdggsd
asdgsdg
sgdgsd sdagsdg
gsd sdg sdg
sdggg sdg sh
Ответ:
9 asfasfafs
7 zxcvxcv
7 asdgsdg
7 sdagsdg
3 gsd = sdg = sdg
5 sdggg
Ответ:
a = int(input())
b = int(input())
if a==0 and b!=0: # если a=0 и b не равен 0 , то решения
#быть не может
print("no solution") # 0 умноженное на любое число даст 0
if a==0 and b==0: # в случае же когда a и b = 0 то x может
print("many solutions") #принимать любое значение
if a!=0 and b!=0:
print ("x будет равен :" , a//b) #вывод решения уравнения
Const
n = 3;
k = 3;
var
i,j,s1,s2:integer;
a:array[1..n,1..k] of integer;
begin
s1:=0;
s2:=0;
for i:=1 to n do
for j:=1 to k do
begin
Writeln('Введите a[',i,',',j,']:');
readln(a[i,j]);
if (a[i,j]>0) and (i<>j) then s1:=s1+a[i,j];
if (a[i,j]<0) and (i<>j) then s2:=s2+a[i,j];
end;
if s1>s2 then
for j:=1 to k do
begin
a[1,j]:=s1;
a[n,j]:=s1;
end;
if s2>=s1 then
for i:=1 to n do
begin
a[i,1]:=s2;
a[i,k]:=s2;
end;
writeln('Полученный массив:');
for i:=1 to n do
begin
for j:=1 to k do
write('a[':4,i,',',j,']=',a[i,j]);
writeln;
end;
end.
l = [int(num) for num in input().split()]
print(l)