#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int r = 0, k = 0, t = 0;
const int N = 50;
char array[N];
cin.getline(array, N);
for (int i = 0; array[i]; i++)
if (array[i] == 'r')
r++;
}
if (array[i] == 'k')
k++;
if (array[i] == 't')
t++;
cout << "r = " << r << endl;
cout << "k = " << k << endl;
cout << "t = " << t << endl;
return 0;
Современный PascalABC.NET
begin
var (a, b) := ReadInteger2('Введите a и b:');
if a > b then
Print(a, b)
else
Print(b, a)
end.
Старенький Free Pascal
var
a, b: integer;
Write('Введите a и b: ');
Readln(a, b);
Write(a, ' ', b)
Write(b, ' ', a)
Turbo Pascal для современников мамонтов
program ABC;
uses Crt;
ClrScr;
Write(b, ' ', a);
ReadKey;
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int r = 0, k = 0, t = 0;
const int N = 50;
char array[N];
cin.getline(array, N);
for (int i = 0; array[i]; i++)
{
if (array[i] == 'r')
{
r++;
}
if (array[i] == 'k')
{
k++;
}
if (array[i] == 't')
{
t++;
}
}
cout << "r = " << r << endl;
cout << "k = " << k << endl;
cout << "t = " << t << endl;
return 0;
}
Современный PascalABC.NET
begin
var (a, b) := ReadInteger2('Введите a и b:');
if a > b then
Print(a, b)
else
Print(b, a)
end.
Старенький Free Pascal
var
a, b: integer;
begin
Write('Введите a и b: ');
Readln(a, b);
if a > b then
Write(a, ' ', b)
else
Write(b, ' ', a)
end.
Turbo Pascal для современников мамонтов
program ABC;
uses Crt;
var
a, b: integer;
begin
ClrScr;
Write('Введите a и b: ');
Readln(a, b);
if a > b then
Write(a, ' ', b)
else
Write(b, ' ', a);
ReadKey;
end.