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
Объяснение:
1 задача:
import math
a=int(input())
b=int(input())
if(math.fabs(a+b)>20):
print(math.pow(a,2))
else:
b=math.fabs(b)
print(math.sqrt(b))
2 задача:
a=int(input())
if a == 5:
print("Отлично")
elif a == 4:
print("Хорошо")
elif a == 3:
print("Удовлетворительно")
elif a == 2:
print("Плохо")
elif a == 1:
print("Отвратительно")
else:
print("Это не оценка")
3 задача:
x=int(input())
y=int(input())
a=int(input())
b=int(input())
a7 = a%x
b7 = b%y
if(a7>b7):
print("7A")
else:
print("7Б")
4 задача:
import math
print("Введите интервал")
a=int(input())
b=int(input())
while(a<=b):
if a<100:
r=13*math.pow(a,2)
print("X=" + str(a) + " y=" + str(r))
elif a>100:
r=math.pow(a,3)-100
print("X=" + str(a) + " y=" + str(r))
else:
r=30-(a/(a-5))
print("X=" + str(a) + " y=" + str(r))
a=a+1
5 задача:
import math
print("Введите интервал")
a=int(input())
b=int(input())
while(a<=b):
if a<4:
r=3*a-7
print("X=" + str(a) + " y=" + str(r))
else:
r=5*math.pow(a,2)
print("X=" + str(a) + " y=" + str(r))
a=a+1
Объяснение:
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cstring>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <climits>typedef unsigned long long ulol;
typedef long long lol;
typedef long int li;#define mp make_pair
#define F first
#define S second
#define sqr(a) ( (a) * (a) )
#define pb push_back
#define INF 999999999
#define ret(a) cout << endl; system("pause"); return(a)
//#define ret(a) return(a)using namespace std;int main()
{
lol n;
cin >> n;
vector<lol> ar(n);
for(int i = 0 ; i < n ; i ++)
cin >> ar[i];
for(int i = 0 ; i < n ; i += 3)
cout << i+1 << '-' << i+3 << ": " << ar[i]+ar[i+1]+ar[i+2] << endl;
ret(0);
}