Language: C++

#include<iostream>
#include<string>
int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:16: error: 'string' was not declared in this scope
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                ^~~~~~
a.cc:3:16: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:3:35: error: 'n' was not declared in this scope
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                                   ^
a.cc:3:45: error: expected ';' before 'r'
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                                             ^~
      |                                             ;
a.cc:3:103: error: 'r' was not declared in this scope
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                                                                                                       ^
a.cc:3:272: error: 'dice' was not declared in this scope
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                                                                                                                                                                                                                                                                                ^~~~
a.cc:3:281: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                                                                                                                                                                                                                                                                                         ^~~~
      |                                                                                                                                                                                                                                                                                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:3:290: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout<<s<<endl;}}
      |                                                                                                                                                                                                                                                                                                  ^~~~
      |                                                                                                                                                                                                                                                                                                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~