C++
#ifndef PRO1_TEMPPARM_H
#define PRO1_TEMPPARM_H
class tempparm {
};
#endif //PRO1_TEMPPARM_H
#include "../stacktp.h"
#include <iostream>
using namespace std;
template <template <typename T> class Thing>
class Crab{
private:
Thing<int> s1;
Thing<double > s2;
public:
Crab(){};
bool push(int a, double x){ return s1.push(a) && s2.push(x);}
bool pop(int & a, double & x){ return s1.pop(a) && s2.pop(x);}
};
void test(){
Crab<Stack> nebula;
int ni;
double nb;
cout << "Enter int double pairs ,such as 4 3.5 (0 0 to be and): \n";
while (cin >> ni >> nb && ni > 0 && nb > 0) {
if (!nebula.push(ni, nb))
break;
}
while (nebula.pop(ni, nb)) {
cout << ni << ", " << nb << endl;
}
cout << "Done.\n";
}