'commit'
This commit is contained in:
18
C++课程/待整理知识/啊哈算法/p29.cpp
Normal file
18
C++课程/待整理知识/啊哈算法/p29.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int q[102]={0,6,3,1,7,5,8,9,2,4},head,tail;
|
||||
head=1;
|
||||
tail=10;
|
||||
while(head<tail)
|
||||
{
|
||||
cout<<q[head]<<" ";
|
||||
head++;
|
||||
q[tail]=q[head];
|
||||
tail++;
|
||||
head++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user