#include <iostream.h>
int i,a,b,nod,c,d,e;
noda(int a,int b,int &nod)
{
x : if (a==b)
{
nod=a;
return;
}
else
if (a<b)
{
int c1=a;
a=b;
b=c1; goto x1;
}
else {
x1 : a=a-b;
//cout<<"A="<<a<<" B="<<b<<"\n";
goto x;
}
}
void main ()
{
cout<<"Vavedete i=";
cin>>i;
for (d=1000000;d<=i;d++)
{
for (e=2;e<=100000;e++)
{
//cout<<"e="<<e;
noda(d,e,nod);
if (nod>1)
{
//cout<<"d="<<d<<" ";
//cout<<"ima delitel ="<<nod<<" ";
// cout<<e<<" ";
goto esk3;
}
}
if (nod==1) {cout<<"prosto 4islo xxx ="<<d<<"\n";}
esk3 : //cout<<"buu"<<"\n"
;
}
}
No comments:
Post a Comment