#include <iostream> // header input/output streams
#include <fstream> // header для работы с файлами
using std::ifstream; // для работы с файлом input.txt
using std::ofstream; // для работы с файлом output.txt
using std::cin; // для работы cin
using std::cout; // для работы cout
using std::endl; // для работы перевода на новую строку endl
int main(){
ifstream in_file; // input.txt
ofstream out_file; //output.txt
try{
in_file.open("input.txt");
out_file.open("output.txt");
}
catch(std::exception& e){
cout << e.what() << endl;
}
unsigned int a,b;
in_file >> a >> b;
unsigned int sum = a+b -1;
cout << sum;
out_file << sum - a << ' ' << sum-b << endl;
}
#include <iostream> // header input/output streams
#include <fstream> // header для работы с файлами
using std::ifstream; // для работы с файлом input.txt
using std::ofstream; // для работы с файлом output.txt
using std::cin; // для работы cin
using std::cout; // для работы cout
using std::endl; // для работы перевода на новую строку endl
int main(){
ifstream in_file;
ofstream out_file;
try{
in_file.open("input.txt");
out_file.open("output.txt");
}
catch(std::exception& e){
cout << e.what() << endl;
}
unsigned int a,b;
in_file >> a >> b;
unsigned int sum = a+b -1;
cout << sum;
out_file << sum - a << ' ' << sum-b << endl;
}
Поделитесь своими знаниями, ответьте на вопрос:
Ввести с клавиатуры координаты двух точек (а и в) на плоскости (вещественный числа вычислить длину отрезка ав. программу нужно написать в паскале
//Версия 3.3, сборка 1627
begin
write('координаты точки A: ');
var (x1,y1):=ReadReal2();
write('координаты точки B: ');
var (x2,y2):=ReadReal2();
write('|AB|=',sqrt(sqr(x2-x1)+sqr(y2-y1)));
end.