#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
#include <windows.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n, k, chastnoe, ostatok;
cout << "Введите делимое N = ";
cin >> n;
cout << "Введите делитель K = ";
cin >> k;
if (k != 0)
{
int tmp = n;
chastnoe = ostatok = 0;
while (tmp >= k)
{
tmp -= k;
chastnoe++;
}
ostatok = tmp;
}
cout << "Частное от деления: " << chastnoe << endl;
cout << "Остаток от деления: " << ostatok << endl;
return 0;
}
Объяснение:
Uses CRT;
Var : a,b,c, : integer;
P,s : réal;
Begin
Writeln (" введите значения а, b , c);
Redln (a,b,c);
p:=(a+b+c)/2;
writeln(p);
S:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln(S);
end.