Відповідь:
#include <iostream>
#include <ctime>
using namespace std;
int main() {
const int N = 10;
int a[N];
int count = 0;
srand(time(0));
for (int i = 0; i < N; i++) {
a[i] = rand() % 100;
cout << a[i] << " ";
if (a[i] >= 10 && a[i] <= 99) {
count++;
}
cout << endl;
cout << "Number of two-digit elements in the array: " << count << endl;
return 0;
Пояснення:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Відповідь:
#include <iostream>
#include <ctime>
using namespace std;
int main() {
const int N = 10;
int a[N];
int count = 0;
srand(time(0));
for (int i = 0; i < N; i++) {
a[i] = rand() % 100;
cout << a[i] << " ";
if (a[i] >= 10 && a[i] <= 99) {
count++;
}
}
cout << endl;
cout << "Number of two-digit elements in the array: " << count << endl;
return 0;
}
Пояснення: