Объяснение:
#include "pch.h"
#include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int num, k=0;
string str;
cout << "Введи многозначное число" << endl;
cin >> num;
while (num != 0)
k += 1;
num /= 10;
}
if(k==1)
cout << k << " цифра" << endl;
else if (k >= 2 && k <= 4) {
cout << k << " цифры" << endl;
else {
cout << k << " цифр" << endl;
system("pause");
return 0;
Объяснение:
#include "pch.h"
#include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int num, k=0;
string str;
cout << "Введи многозначное число" << endl;
cin >> num;
while (num != 0)
{
k += 1;
num /= 10;
}
if(k==1)
{
cout << k << " цифра" << endl;
}
else if (k >= 2 && k <= 4) {
cout << k << " цифры" << endl;
}
else {
cout << k << " цифр" << endl;
}
system("pause");
return 0;
}
Var i, n: Integer;
Begin
Randomize;
n := Random(10);
For i := 1 To n Do
WriteLn(Random, ' ');
End.
Program TaskB;
Var i: Integer;
Begin
Randomize;
For i := 1 To 10 Do
WriteLn(Random, ' ');
End.
Program TaskC;
Var i: Integer;
Begin
Randomize;
For i := 1 To 10 Do
WriteLn(Random(11), ' ');
End.
Program TaskD;
Var i: Integer;
Begin
Randomize;
For i := 1 To 10 Do
WriteLn(Random(10), ' ');
End.
Program TaskE;
Var i: Integer;
Begin
Randomize;
For i := 1 To 10 Do
WriteLn(Random(20 + 10 + 1) - 10, ' ');
End.
Program TaskF;
Var i: Integer;
Begin
Randomize;
For i := 1 To 10 Do
WriteLn(Random(122 + 97 + 1) - 97, ' ');
End.
Program TaskG;
Var i, sum: Integer;
BeginRandomize;
For i := 1 To 10 Do
sum := sum + Random(11);
WriteLn(sum);
End.