Program HelloWorld;var x1,y1,x2,y2:double;begin readln(x1); readln(y1); readln(x2); readln(y2); x1:=sqrt(x1*x1+y1*y1); x2:=sqrt(x2*x2+y2*y2); if(x1>x2) then writeln(x2:0:2) else if(x2>x1) then writeln(x1:0:2) else writeln('Одинаково близко',x1:0:2);end.
Using System;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.Write("введите число: ");
int value = int.Parse(Console.ReadLine());
int sum = 0;
for(int i = 1; i < value; i++)
if (value % i == 0) sum += i;
if (value == sum) Console.WriteLine("Число совершенное");
else Console.WriteLine("Число не совершенное");
Console.ReadLine();
}
}
}
A = N^i
N = 2 (А,Б - две буквы)
i = 11
A = 2^11 = 2048
#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;
}