#include <iostream>
using namespace std;
void F(int n)
{
if (n < 1)
return;
else
cout << n << " ";
F(n - 1);
}
int main()
int n;
cout << "Enter a quantity of numbers:\n";
cout << "n = ";
cin >> n;
cout << "Target sequence:\n";
F(n);
cout << "\n";
system("pause");
return 0;
int a1, a2, a3, a4, a5, a6,a7,a8;
a1=1;
a2=a1+2;
a3=a2++;
a4=a3+2;
a5=a4++;
a6=a5++;
a7=a6++;
a8=a7++;
cout << a1 << " " << a2 << " " << a3 << " " << a4 << " " << a5 << " " << a6 << " " << a7 << " " << a8;
Объяснение:
#include <iostream>
using namespace std;
void F(int n)
{
if (n < 1)
return;
else
cout << n << " ";
F(n - 1);
}
int main()
{
int n;
cout << "Enter a quantity of numbers:\n";
cout << "n = ";
cin >> n;
cout << "Target sequence:\n";
F(n);
cout << "\n";
system("pause");
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a1, a2, a3, a4, a5, a6,a7,a8;
a1=1;
a2=a1+2;
a3=a2++;
a4=a3+2;
a5=a4++;
a6=a5++;
a7=a6++;
a8=a7++;
cout << a1 << " " << a2 << " " << a3 << " " << a4 << " " << a5 << " " << a6 << " " << a7 << " " << a8;
return 0;
}
Объяснение: