a = int(input())
for i in range(a):
b = input()
c = 0
d = True
e = 0
f = False
g = False
h = '\''
for j in b:
if j == '#' and not f:
g = True
break
elif j != ' ':
if d:
print(' ' * c, end='')
elif c > 0:
print(' ', end='')
c = 0
print(j, end='')
if(j == '\"' or j == '\'') and e % 2 == 0:
if f and j == h:
f = False
else:
f = True
h = j
if f:
d = True
else:
d = False
if j == '\\':
e += 1
else:
e = 0
else:
c += 1
r = j == ' '
if g and c > 1:
print(' ', end='')
if i < a - 1:
print()
1
Объяснение:
#include <iostream>
using namespace std;
void max(float a[])
{
for(int i2 = 0; i2<3; ++i2) // сортируем массив
{
for(int i = 0; i<2; ++i)
{
if(a[i]>a[i+1])
{
int temp1, temp2;
temp2=a[i];
temp1=a[i+1];
a[i]=temp1;
a[i+1]=temp2;
}
}
}
cout << "Max: " << a[2]; // выводим последний и наибольший элемент
}
int main()
{
cout << "Enter three numbers. ";
float a[3]; // float для поддержки дробных чисел
for(int i = 0; i<3; ++i)
{
cout << endl << "Number #" << i << ": ";
cin >> a[i];
}
max(a);
}