#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Введите количество колес:" << endl;
cin >> n;
if(n % 2 != 0) --n;
int cars = 0;
int bicycles = n/2;
int f = bicycles;
for(int x = 0 ; bicycles > 0 ; x++){
cout << "Машыны:" << cars << " Велосипеды:" << bicycles << endl;
bicycles = bicycles - 2;
cars++;
}
return 0;
Объяснение:
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Введите количество колес:" << endl;
cin >> n;
if(n % 2 != 0) --n;
int cars = 0;
int bicycles = n/2;
int f = bicycles;
for(int x = 0 ; bicycles > 0 ; x++){
cout << "Машыны:" << cars << " Велосипеды:" << bicycles << endl;
bicycles = bicycles - 2;
cars++;
}
return 0;
Объяснение: