#include <iostream>
#include <windows.h>
#include <conio.h>
#include <ctime>
int main()
{
srand(time(NULL));
const int n = 20;
double r = 0;
int a[n];
system("cls");
for (int i = 0; i < n; i++)
a[i] = rand() % 50;
std::cout << a[i] << " ";
r += 1. / a[i];
}
std::cout << std::endl;
r = 1. / r;
std::cout << "R: " << r << std::endl;
getch();
return 0;
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <ctime>
int main()
{
srand(time(NULL));
const int n = 20;
double r = 0;
int a[n];
system("cls");
for (int i = 0; i < n; i++)
{
a[i] = rand() % 50;
std::cout << a[i] << " ";
r += 1. / a[i];
}
std::cout << std::endl;
r = 1. / r;
std::cout << "R: " << r << std::endl;
getch();
return 0;
}
int main(){
//1
char ch;
std::cin >> ch;
std::cout << int(ch) << std::endl;
//2
int c;
std::cin >> c;
std::cout << char(c) << std::endl;
//3
for (char ch = 'a'; ch <= 'z'; ch++)
std::cout << ch;
std::cout << std::endl;
for (char ch = 'Z'; ch >= 'A'; ch--)
std::cout << ch;
std::cout << std::endl;
//4
int v;
std::cin >> v;
for (char ch = 'a'; v > 0; v--){
if (ch > 'z') ch = 'a';
std::cout << ch++;
}
return 0;
}