mark = int(input())
count = 0
if mark == 5:
count += 1
while (mark<=5 and mark>0):
print(count)
1
5
-1
#include <iostream>
#include <cmath>
int main()
{
float x1, y1, x2, y2;
std::cout << "x1 :" << std::endl;
std::cin >> x1;
std::cout << "y1 :" << std::endl;
std::cin >> y1 ;
std::cout << "x2 :" << std::endl;
std::cin >> x2;
std::cout << "y2 :" << std::endl;
std::cin >> y2;
float result = std::sqrt((std::pow(std::abs(x1-x2), 2) + std::pow(std::abs(y1-y2), 2)));
std::cout << result << std::endl;
char * temp = new char[0]();
std::cin >> temp;
return 0;
}
mark = int(input())
count = 0
if mark == 5:
count += 1
while (mark<=5 and mark>0):
mark = int(input())
if mark == 5:
count += 1
print(count)
Ввод/Вывод:1
1
5
5
5
5
5
-1
5
#include <iostream>
#include <cmath>
int main()
{
float x1, y1, x2, y2;
std::cout << "x1 :" << std::endl;
std::cin >> x1;
std::cout << "y1 :" << std::endl;
std::cin >> y1 ;
std::cout << "x2 :" << std::endl;
std::cin >> x2;
std::cout << "y2 :" << std::endl;
std::cin >> y2;
float result = std::sqrt((std::pow(std::abs(x1-x2), 2) + std::pow(std::abs(y1-y2), 2)));
std::cout << result << std::endl;
char * temp = new char[0]();
std::cin >> temp;
return 0;
}