// TrackBar1->Position — скорость вращения. Не обращайте внимания. Можете поставить 1.
xx = xx * cos(M_PI / 31.05819323 * TrackBar1->Position) + yy * sin(M_PI / 31.05819323 * TrackBar1->Position);
yy = -xx * sin(M_PI / 31.05819323 * TrackBar1->Position) + yy * cos(M_PI / 31.05819323 * TrackBar1->Position);
Image1->Canvas->Pen->Color = clGray;
Image1->Canvas->Brush->Color = clGray;
Image1->Canvas->Ellipse(
width_window / 2 - earth_xx - xx - radius_moon,
height_window / 2 - earth_yy - yy - radius_moon,
width_window / 2 - earth_xx - xx + radius_moon,
height_window / 2 - earth_yy - yy + radius_moon
);
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
vector<int> generator(int n, int m) {
vector <int> v;
for(int i=0; i<pow((double)2,n)-1; i++ ) {
if(i<=m-1) v.push_back(1);
else v.push_back(0);
}
return v;
}
int main()
{
int n,m;
cout<<"N:";
cin>>n;
cout<<"M:";
cin>>m;
vector<int> v = generator(n,m);
sort(v.begin(), v.end());
do
{
for(int i=0; i<v.size(); i++)
cout <<v[i]<<" ";
cout<<endl;
}
while(next_permutation(v.begin(), v.end()));
return 0;
}
SET CHARACTER SET utf8
SET NAMES utf8
За место utf8 можете поставить подходящую вам кодировку.for (var element in myobj.mac.users) {
console.log(myobj.mac.users[element].name);
}
foreach ($myobj['mac']['users'] as $element) {
echo $element['name'];
}