Language: C++

#include<cstring>
#include<cstdio>
#include<map>
#include<string>
#include<set>
#include<algorithm>
using namespace std;
int o[8];
char st[111];
int p[3][8] = {
	{1, 2, 3, 0, 5, 6, 7, 4},
	{5, 6, 1, 0, 3, 4, 7, 2},
	{5, 0, 3, 4, 7, 6, 1, 2}
};
vector<int> permu(const vector<int> & v, int * p) {
	vector<int> res(v);
	for(int i(0); i < 8; i++) {
		res[i] = v[p[i]];
	}
	return res;
}
int main() {
	for(;;) {
		if(scanf("%s", st) == 1) {
			int cnt(0);
			vector<int> vec;
			map<string, int> mp;
			for(int i(0); i < 8; i++) {
				if(i > 0) {
					scanf("%s", st);
				}
				if(!mp.count(st)) {
					mp[st] = cnt++;
				}
				vec.push_back(mp[st]);
			}
			for(int i(0); i < 8; i++) {
				o[i] = i;
			}
			vector<int> vec1(vec);
			set<long long> st;
			int ans(0);
			do {
				bool flag(false);
				vector<int> vec1(permu(vec, o));
				for(int i(0); i < 4; i++) {
					vector<int> vec2(vec1);
					for(int j(0); j < 4; j++) {
						vector<int> vec3(vec2);
						for(int k(0); k < 4; k++) {
							long long tot(0);
							for(int _(0); _ < 8; _++) {
								tot = tot * 8 + vec3[_];
							}
							if(st.count(tot) == 0) {
								flag = true;
								st.insert(tot);
							}
							vec3 = permu(vec3, p[2]);
						}
						vec2 = permu(vec2, p[1]);
					}
					vec1 = permu(vec1, p[0]);
				}
				if(flag) {
					ans++;
				}
			} while(next_permutation(o, o + 8));
			printf("%d\n", ans);
		}else {
			break;
		}
	}
}

Compiler output:
a.cc:15:1: error: 'vector' does not name a type
   15 | vector<int> permu(const vector<int> & v, int * p) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:26:25: error: 'vector' was not declared in this scope
   26 |                         vector<int> vec;
      |                         ^~~~~~
a.cc:7:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    6 | #include<algorithm>
  +++ |+#include <vector>
    7 | using namespace std;
a.cc:26:32: error: expected primary-expression before 'int'
   26 |                         vector<int> vec;
      |                                ^~~
a.cc:35:33: error: 'vec' was not declared in this scope
   35 |                                 vec.push_back(mp[st]);
      |                                 ^~~
a.cc:40:32: error: expected primary-expression before 'int'
   40 |                         vector<int> vec1(vec);
      |                                ^~~
a.cc:45:40: error: expected primary-expression before 'int'
   45 |                                 vector<int> vec1(permu(vec, o));
      |                                        ^~~
a.cc:47:48: error: expected primary-expression before 'int'
   47 |                                         vector<int> vec2(vec1);
      |                                                ^~~
a.cc:49:56: error: expected primary-expression before 'int'
   49 |                                                 vector<int> vec3(vec2);
      |                                                        ^~~
a.cc:53:81: error: 'vec3' was not declared in this scope
   53 |                                                                 tot = tot * 8 + vec3[_];
      |                                                                                 ^~~~
a.cc:59:57: error: 'vec3' was not declared in this scope
   59 |                                                         vec3 = permu(vec3, p[2]);
      |                                                         ^~~~
a.cc:59:64: error: 'permu' was not declared in this scope
   59 |                                                         vec3 = permu(vec3, p[2]);
      |                                                                ^~~~~
a.cc:61:49: error: 'vec2' was not declared in this scope
   61 |                                                 vec2 = permu(vec2, p[1]);
      |                                                 ^~~~
a.cc:61:56: error: 'permu' was not declared in this scope
   61 |                                                 vec2 = permu(vec2, p[1]);
      |                                                        ^~~~~
a.cc:63:41: error: 'vec1' was not declared in this scope
   63 |                                         vec1 = permu(vec1, p[0]);
      |                                         ^~~~
a.cc:63:48: error: 'permu' was not declared in this scope
   63 |                                         vec1 = permu(vec1, p[0]);
      |                                                ^~~~~