每一步都说的什么,#include using namespace std; const int people = 17
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/09 02:56:50
每一步都说的什么,
#include
using namespace std;
const int people = 17;
struct outt
{
outt *next;
bool go;
int num;
};
int main( )
{
outt *p,*head;
int i,n = 0,t = 0;
head = new outt;
head->go = true;
head->num = 1;
p = head;
for ( i = 1; i < people; i++ )
{
outt *s = new outt;
p->next = s;
s->go = true;
s->num = i + 1;
p = s;
}
p->next = head;
p = head;
while ( n = people - 1 )
{
t++;
if ( t % 3 == 0 )
{
if ( p->go )
{
n++;
p->go = false;
}
else
t--;
}
p = p->next;
}
p = head;
while ( p->go )
{
p = p->next;
}
cout num;
return 0;
}
#include
using namespace std;
const int people = 17;
struct outt
{
outt *next;
bool go;
int num;
};
int main( )
{
outt *p,*head;
int i,n = 0,t = 0;
head = new outt;
head->go = true;
head->num = 1;
p = head;
for ( i = 1; i < people; i++ )
{
outt *s = new outt;
p->next = s;
s->go = true;
s->num = i + 1;
p = s;
}
p->next = head;
p = head;
while ( n = people - 1 )
{
t++;
if ( t % 3 == 0 )
{
if ( p->go )
{
n++;
p->go = false;
}
else
t--;
}
p = p->next;
}
p = head;
while ( p->go )
{
p = p->next;
}
cout num;
return 0;
}
#include
using namespace std;
const int people = 17;
struct outt //定义一个结构
{
outt *next; //定义一个数据成员(指针)
bool go; //逻辑型变量
int num; //整型变量
};
int main( )
{
outt *p,*head;
int i,n = 0,t = 0;
head = new outt;//申请动态空间
head->go = true; //第一个节点为真
head->num = 1; //...
p = head; //在表头插如结点
for ( i = 1; i < people; i++ ) //循环
{
outt *s = new outt; //申请动态空间
p->next = s;
s->go = true;
s->num = i + 1;
p = s;
}
p->next = head;
p = head;
while ( n != people - 1 )
{
t++;
if ( t % 3 == 0 )
{
if ( p->go )
{
n++;
p->go = false;
}
else
t--;
}
p = p->next;
}
p = head;
while ( !p->go )
{
p = p->next;
}
cout num;
return 0;
}
太多了.
using namespace std;
const int people = 17;
struct outt //定义一个结构
{
outt *next; //定义一个数据成员(指针)
bool go; //逻辑型变量
int num; //整型变量
};
int main( )
{
outt *p,*head;
int i,n = 0,t = 0;
head = new outt;//申请动态空间
head->go = true; //第一个节点为真
head->num = 1; //...
p = head; //在表头插如结点
for ( i = 1; i < people; i++ ) //循环
{
outt *s = new outt; //申请动态空间
p->next = s;
s->go = true;
s->num = i + 1;
p = s;
}
p->next = head;
p = head;
while ( n != people - 1 )
{
t++;
if ( t % 3 == 0 )
{
if ( p->go )
{
n++;
p->go = false;
}
else
t--;
}
p = p->next;
}
p = head;
while ( !p->go )
{
p = p->next;
}
cout num;
return 0;
}
太多了.
每一步都说的什么,#include using namespace std; const int people = 17
#include using namespace std; int main() { cout
#include using namespace std;void huiwen(int n);int main(){\
求1到10的阶乘之和#include using namespace std;int main(){int a,b=1,
#include int main() { using namespace std; int a=3,b=7,c; c=
#include using namespace std; int main() { int a,b,c,d; a=c=
#include using namespace std; int main(){ int sum[5]={0};
#include using namespace std; int main() { int a,b,c; a=3; i
#include using namespace std; class myclass { int a,b; stati
#include using namespace std; class blah{ public:static int
C++圆的面积求法#include#define PI 3.14using namespace std;int main
c++的杨辉三角行#include using namespace std;main(){int n;cout