Вот так пока получается, вроде переделал функцию из паскалевской без изменений, там работала, а тут чот ни фига
Код
# include <iostream.h>
# include <stdio.h>
# include <math.h>
# include <conio.h>
# include <alloc.h>
int main()
{//----------------------------------------------------------------
clrscr();
int w,i,j,n,s,g;
int * yk;
cout<<"n="; cin>>n;
yk=new int[n];
cout<<"El-ma \n";
for (i=0; i<n; i++)
{ cin>>* (yk);
s=*(yk);
cout<<"\n s="<<s;
//----------------------------------------------------------------
if (s==1 || s==2) { cout<<"\n s - Prostoe 4islo"; g=*(yk);
cout<<"\n g="<<g;}
if (s%2==0) cout<<"\n s - Sostavnoe 4islo";
else
{
w=3;
while (s&w!=0)
{ w=w+2;
if (s<=w) { cout<<"\n s - Prostoe 4islo"; g=*(yk);
cout<<"\n g="<<g; }
else cout<<"\n s - Sostavnoe 4islo";
}
}
}
//-----------------------------------------------------------------
delete yk;
getch();
}
# include <stdio.h>
# include <math.h>
# include <conio.h>
# include <alloc.h>
int main()
{//----------------------------------------------------------------
clrscr();
int w,i,j,n,s,g;
int * yk;
cout<<"n="; cin>>n;
yk=new int[n];
cout<<"El-ma \n";
for (i=0; i<n; i++)
{ cin>>* (yk);
s=*(yk);
cout<<"\n s="<<s;
//----------------------------------------------------------------
if (s==1 || s==2) { cout<<"\n s - Prostoe 4islo"; g=*(yk);
cout<<"\n g="<<g;}
if (s%2==0) cout<<"\n s - Sostavnoe 4islo";
else
{
w=3;
while (s&w!=0)
{ w=w+2;
if (s<=w) { cout<<"\n s - Prostoe 4islo"; g=*(yk);
cout<<"\n g="<<g; }
else cout<<"\n s - Sostavnoe 4islo";
}
}
}
//-----------------------------------------------------------------
delete yk;
getch();
}