谁能帮我把这个C++的程序译成C的程序?
#include <iostream>#include <deque>
using namespace std;
struct Node
{
double val;
int deep;
int order;
};
void print(Node p)
{
//printf("%d % d %f\n", p.deep, p.order-1, p.val);
cout << p.deep << "," << p.order-1 << "," << p.val << endl;
}
int main()
{
int s0,t;
deque<Node> deq;
double u;
scanf("%d%lf%d",&s0,&u,&t);
++t;
int *s = new int[t];
for( int i= 0; i < t; ++i )
s[i] = 0;
Node node;
node.val = s0;
node.deep = 0;
node.order = 1;
deq.push_back(node);
s[0] = 1;
while( !deq.empty() )
{
Node temp;
temp = deq.front();
deq.pop_front();
int dep = temp.deep+1;
if( dep == t + 1 )
break;
print(temp);
if( s[dep] == 0 )
{
Node p;
++s[dep];
p.val = temp.val * u;
p.deep = temp.deep + 1;
p.order = s[dep];
deq.push_back(p);
}
Node q;
++s[dep];
q.val = temp.val / u;
q.deep = temp.deep + 1;
q.order = s[dep];
deq.push_back(q);
}
cin >> s0;
}