submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s996498248
p00424
C++
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; //#define int long long #define DBG 1 #define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;} #define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;} #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define each(it,c) for(auto it=(c).begin();it!=(c).end();it++) #define all(c) c.begin(),c.end() const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9 + 7); int dfs(int n, int max, int s) {
a.cc: In function 'int dfs(int, int, int)': a.cc:15:33: error: expected '}' at end of input 15 | int dfs(int n, int max, int s) { | ~^ a.cc:15:33: warning: no return statement in function returning non-void [-Wreturn-type]
s041746908
p00424
C++
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; //#define int long long #define DBG 1 #define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;} #define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;} #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define each(it,c) for(auto it=(c).begin();it!=(c).end();it++) #define all(c) c.begin(),c.end() const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9 + 7); int dfs(int n, int max, int s) {
a.cc: In function 'int dfs(int, int, int)': a.cc:15:33: error: expected '}' at end of input 15 | int dfs(int n, int max, int s) { | ~^ a.cc:15:33: warning: no return statement in function returning non-void [-Wreturn-type]
s723931337
p00424
C++
int main(){ map<char,char> a2b; char a,b,c; int n; for( ; ; ){ cin>> n; if(n==0)break; for(int i=0;i<n;i++){ cin>>a>>b; a2b[a]=b; } cin>>n; for(int i=0;i<n;i++){ cin>>c; if(a2b.count(c)==0) cout<<c; else cout<<a2b[c]; } cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:3:3: error: 'map' was not declared in this scope 3 | map<char,char> a2b; | ^~~ a.cc:3:7: error: expected primary-expression before 'char' 3 | map<char,char> a2b; | ^~~~ a.cc:11:3: error: 'cin' was not declared in this scope 11 | cin>> n; | ^~~ a.cc:19:6: error: 'a2b' was not declared in this scope 19 | a2b[a]=b; | ^~~ a.cc:25:9: error: 'a2b' was not declared in this scope 25 | if(a2b.count(c)==0) | ^~~ a.cc:26:8: error: 'cout' was not declared in this scope 26 | cout<<c; | ^~~~ a.cc:27:11: error: 'cout' was not declared in this scope 27 | else cout<<a2b[c]; | ^~~~ a.cc:29:4: error: 'cout' was not declared in this scope 29 | cout<<endl; | ^~~~ a.cc:29:10: error: 'endl' was not declared in this scope 29 | cout<<endl; | ^~~~
s816218406
p00424
C++
#include<iostream> #include<cstdio> #include<map> using namespace std ; int main(){ map<char,char> a2b; int n,; char a,b; for(;;){ cin>>n; if(n==0)break; for(int i=0;i<n;i++){ cin >> a >> b; a2b[a]=b; } cin>>n; for(int i=0;i<n;i++){ cin>>a; if(a2b.count(a)==0){ cout<<a; } else cout<<a2b[a]; } cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: expected unqualified-id before ';' token 7 | int n,; | ^
s322601128
p00424
C++
#include<iostream> #include<vector> using namespace std; int main() { vector<char> v; vector<char> v2; vector<char> v3; int n = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> v.push_back() >> v2.push_back(); } int m = 0; cin >> m; for (int j = 0; j < m; j++) { cin >> v3.push_back(); for (int k = 0; k < n; k++) { if (v[k] == v3[i]) { v3[i] = v2[k]; } } } cout << v3 << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:35: error: no matching function for call to 'std::vector<char>::push_back()' 11 | cin >> v.push_back() >> v2.push_back(); | ~~~~~~~~~~~^~ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate expects 1 argument, 0 provided a.cc:11:53: error: no matching function for call to 'std::vector<char>::push_back()' 11 | cin >> v.push_back() >> v2.push_back(); | ~~~~~~~~~~~~^~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate expects 1 argument, 0 provided a.cc:16:36: error: no matching function for call to 'std::vector<char>::push_back()' 16 | cin >> v3.push_back(); | ~~~~~~~~~~~~^~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate expects 1 argument, 0 provided a.cc:18:40: error: 'i' was not declared in this scope 18 | if (v[k] == v3[i]) { | ^ a.cc:23:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>') 23 | cout << v3 << endl; | ~~~~ ^~ ~~ | | | | | std::vector<char> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long
s971323379
p00424
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) throws IOException { String strCount = ""; int cmd = 0; BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); while((cmd = Integer.parseInt(bufferedReader.readLine())) != 0) { strCount = String.valueOf(cmd); ArrayList<String[]> alConvertCharAt = new ArrayList<String[]>(); ArrayList<Boolean> alConvertFlg = new ArrayList<Boolean>(); //Count for(int i = 0; i < Integer.parseInt(strCount); i++) { alConvertCharAt.add(bufferedReader.readLine().split(" ")); alConvertFlg.add(true); } strCount = bufferedReader.readLine(); StringBuffer strBuffConverted = new StringBuffer(Integer.parseInt(strCount)); for(int i = 0; i < Integer.parseInt(strCount); i++) { String befConvCharAt = bufferedReader.readLine(); int arrConvCharAtCounter = 0; boolean isNoConvert = true; for(String[] arrConvChart: alConvertCharAt) { if(arrConvChart[0].equals(befConvCharAt)){ if(alConvertFlg.get(arrConvCharAtCounter)) { strBuffConverted.append(arrConvChart[1]); alConvertFlg.set(arrConvCharAtCounter, false); } else { strBuffConverted.append(arrConvChart[0]); } isNoConvert = false; break; } } if(isNoConvert) strBuffConverted.append(alConvertCharAt.get(i)[0]); } System.out.println(strBuffConverted.toString()); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStreamReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.util.ArrayList; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: expected unqualified-id before 'public' 6 | public class Main { | ^~~~~~
s366051790
p00424
C++
#include <bits/stdc++.h> using namespace std; int main() { while(1) { int K; cin >> K; if(K == 0) break; string before[K],after[K]; for(int a = 0; a < k; ++a) { cin >> before[a] >> after[a]; } int n; cin >> n; string ans[n]; for(int b = 0; b < n; ++b){ cin >> ans[b]; } for(int c = 0; c < n; ++c) { for(int d = 0; d < k; ++d) { if(before[d] == ans[c]) { ans[c] = after[d]; break; } } } for(int an = 0; an < n; ++an) { cout >> ans[an]; } cout >> endl; } }
a.cc: In function 'int main()': a.cc:10:24: error: 'k' was not declared in this scope 10 | for(int a = 0; a < k; ++a) { | ^ a.cc:20:26: error: 'k' was not declared in this scope 20 | for(int d = 0; d < k; ++d) { | ^ a.cc:28:12: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 28 | cout >> ans[an]; | ~~~~ ^~ ~~~~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:28:7: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 28 | cout >> ans[an]; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:28:21: required from here 28 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:28:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operat
s606917776
p00424
C++
#include <bits/stdc++.h> using namespace std; int main() { while(1) { int K; cin >> K; if(K == 0) break; string before[K] stirng after[K]; for(int a = 0; a < k; ++a) { cin >> before[a] >> after[a]; } int n; cin >> n; string ans[n]; for(int b = 0; b < n; ++b){ cin >> ans[b]; } for(int c = 0; c < n; ++c) { for(int d = 0; d < k; ++d) { if(before[d] == ans[c]) { ans[c] = after[d]; break; } } } for(int an = 0; an < n; ++an) { cout >> ans[an]; } cout >> endl; } }
a.cc: In function 'int main()': a.cc:10:5: error: expected initializer before 'stirng' 10 | stirng after[K]; | ^~~~~~ a.cc:11:24: error: 'k' was not declared in this scope 11 | for(int a = 0; a < k; ++a) { | ^ a.cc:12:14: error: 'before' was not declared in this scope 12 | cin >> before[a] >> after[a]; | ^~~~~~ a.cc:12:27: error: 'after' was not declared in this scope 12 | cin >> before[a] >> after[a]; | ^~~~~ a.cc:21:26: error: 'k' was not declared in this scope 21 | for(int d = 0; d < k; ++d) { | ^ a.cc:22:12: error: 'before' was not declared in this scope 22 | if(before[d] == ans[c]) { | ^~~~~~ a.cc:23:20: error: 'after' was not declared in this scope 23 | ans[c] = after[d]; | ^~~~~ a.cc:29:12: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 29 | cout >> ans[an]; | ~~~~ ^~ ~~~~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:29:7: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 29 | cout >> ans[an]; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:29:21: required from here 29 | cout >> ans[an]; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:29:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> ans[an]; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Trai
s262105827
p00424
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <functional> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <valarray> #include <algorithm> #include <time.h> #include <cstdlib> #include <iomanip> #include <stdlib.h> using namespace std; int main (void) { long m,n; long char a[100],b[100],c[100]; for (int i = 0; i < 100; i++) { cin >> n; if (n == 0) { break; } if (n == 'T') { cout << "Too" << " " << "Large"; break; } for (int j = 0; j < n; j++) { cin >> a[j] >> b[j]; } cin >> m; for (int k = 0; k < m; k++) { cin >> c[k]; for (int j = 0; j < n; j++) { if (c[k] == a[j]) { c[k] = b[j]; } else { } } cout << c[k]; } cout << endl; } }
a.cc: In function 'int main()': a.cc:21:9: error: 'long' specified with 'char' 21 | long char a[100],b[100],c[100]; | ^~~~ a.cc:21:9: error: 'long' specified with 'char' a.cc:21:9: error: 'long' specified with 'char'
s901536432
p00424
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <functional> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <valarray> #include <algorithm> #include <time.h> #include <cstdlib> #include <iomanip> #include <stdlib.h> using namespace std; int main (void) { long m,n; long char a[100],b[100],c[100]; for (int i = 0; i < 100; i++) { cin >> n; if (n == 0) { break; } for (int j = 0; j < n; j++) { cin >> a[j] >> b[j]; } cin >> m; for (int k = 0; k < m; k++) { cin >> c[k]; for (int j = 0; j < n; j++) { if (c[k] == a[j]) { c[k] = b[j]; } else { } } cout << c[k]; } cout << endl; } }
a.cc: In function 'int main()': a.cc:21:9: error: 'long' specified with 'char' 21 | long char a[100],b[100],c[100]; | ^~~~ a.cc:21:9: error: 'long' specified with 'char' a.cc:21:9: error: 'long' specified with 'char'
s839905543
p00424
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <functional> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <valarray> #include <algorithm> #include <time.h> #include <cstdlib> #include <iomanip> #include <stdlib.h> using namespace std; int main (void) { long m,n; long char a[100000],b[100000],c[100000]; for (int i = 0; i < 100; i++) { cin >> n; if (n == 0) { break; } for (int j = 0; j < n; j++) { cin >> a[j] >> b[j]; } cin >> m; for (int k = 0; k < m; k++) { cin >> c[k]; for (int j = 0; j < n; j++) { if (c[k] == a[j]) { c[k] = b[j]; } else { } } cout << c[k]; } cout << endl; } }
a.cc: In function 'int main()': a.cc:21:9: error: 'long' specified with 'char' 21 | long char a[100000],b[100000],c[100000]; | ^~~~ a.cc:21:9: error: 'long' specified with 'char' a.cc:21:9: error: 'long' specified with 'char'
s424648268
p00424
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <functional> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <valarray> #include <algorithm> #include <time.h> #include <cstdlib> #include <iomanip> #include <stdlib.h> using namespace std; int main (void) { long m,n; long char a[100000],b[100000],c[100000]; for (int i = 0; i < 100; i++) { cin >> n; if (n == 0) { break; } for (int j = 0; j < n; j++) { cin >> a[j] >> b[j]; } cin >> m; for (int k = 0; k < m; k++) { cin >> c[k]; for (int j = 0; j < n; j++) { if (c[k] == a[j]) { c[k] = b[j]; } else { } } cout << c[k]; } cout << endl; } }
a.cc: In function 'int main()': a.cc:21:9: error: 'long' specified with 'char' 21 | long char a[100000],b[100000],c[100000]; | ^~~~ a.cc:21:9: error: 'long' specified with 'char' a.cc:21:9: error: 'long' specified with 'char'
s922053897
p00424
C++
#include "../bits/stdc++.h" #define X first #define Y second #define pb push_back #define eb emplace_back #define mp make_pair #define rep(i, a, b) for (unsigned i = (a); i <= (b); ++i) #define per(i, a, b) for (unsigned i = (a); i >= (b); --i) using namespace std; using I = int; using L = long; using F = float; using S = string; using C = char; using LL = long long; using VI = vector<int>; using VL = vector<long>; using VF = vector<float>; using VS = vector<string>; using PLL = pair<long, long>; using PLF = pair<long, float>; using PLS = pair<long, string>; using PSL = pair<string, long>; using PSF = pair<string, float>; using PSS = pair<string, string>; using MLL = map<long, long>; using MLF = map<long, float>; using MLS = map<long, string>; using MSL = map<string, long>; using MSF = map<string, float>; using MSS = map<string, string>; const long kMax2 = 109; const long kMax3 = 1009; const long kMax4 = 10009; const long kMax5 = 100009; const long kMax6 = 1000009; const long kInfI = 0x3F3F3F3F; const float kInfF = 1e15; int main(int argc, char const *argv[]) { while (1) { L n, m; L ans1 = 0; L ans2 = 0; scanf("%ld", &n); getchar(); if (n == 0) { break; } map<char, char> mp; for (unsigned i = 0; i < n; i++) { C a = getchar(); getchar(); C b = getchar(); getchar(); mp.emplace(a, b); } scanf("%ld\n", &m); for (unsigned i = 0; i < m; i++) { C c = getchar(); getchar(); if (mp.find(c) == mp.end()) { putchar(c); } else { putchar(mp[c]); } } printf("\n"); } return 0; }
a.cc:1:10: fatal error: ../bits/stdc++.h: No such file or directory 1 | #include "../bits/stdc++.h" | ^~~~~~~~~~~~~~~~~~ compilation terminated.
s327239741
p00424
C++
d = dict() s = set() while True: N = int(input()) if N == 0: break res = '' for i in range(N): line = input() d[line[0]] = line[-1] M = int(input()) for i in range(M): line = input() if line in d and line not in s: res += d[line] s.add(d[line]) else: res += line print(res)
a.cc:9:11: error: empty character constant 9 | res = '' | ^~ a.cc:1:1: error: 'd' does not name a type 1 | d = dict() | ^
s689505909
p00424
C++
#include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <string.h> #include <algorithm> #include <cmath> #include <limits> #include <sstream> using namespace std; int main (void) { for (int k = 0; k < 5; k++) { long n,m; long char a[10000],b[10000],x[10000]; cin >> n; if (n == 0) { break; } for (long i = 0; i < n; i++) { cin >> a[i] >> b[i]; } cin >> m; for (long j = 0; j < m; j++) { cin >> x[j]; } for (long j = 0; j < m; j++) { for (long i = 0; i < n; i++) { if (a[i] == x[j]) { x[j] = b[i]; } } } for (long j = 0; j < m; j++) { cout << x[j]; if (j == m - 1) { cout << endl; } } } }
a.cc: In function 'int main()': a.cc:19:9: error: 'long' specified with 'char' 19 | long char a[10000],b[10000],x[10000]; | ^~~~ a.cc:19:9: error: 'long' specified with 'char' a.cc:19:9: error: 'long' specified with 'char'
s048524033
p00424
C++
<?php for($loop_cnt = 0; $loop_cnt < 5; $loop_cnt++) { $data_set = array(); $data = array(); // 変換表数設定 $input_n = trim(fgets(STDIN)); if( 0 == $input_n) { break; } // 変換表設定 for($loop_n = 0; $loop_n < $input_n; $loop_n++) { $input_conv = explode( " " , trim(fgets(STDIN)) ); $data_set = $data_set + array( $input_conv[0] => $input_conv[1]) ; } // データ数設定 $input_m = trim(fgets(STDIN)); // データ設定 for($loop_m = 0; $loop_m < $input_m; $loop_m++) { $input_data = trim(fgets(STDIN)); $data[$loop_m] = $input_data; } // 変換後出力 $work = []; for($loop_m = 0; $loop_m < $input_m; $loop_m++) { if( isset( $data_set[$data[$loop_m]] ) ) { $work[] = $data_set[ $data[$loop_m] ]; } else { $work[] = $data[$loop_m]; } } echo implode('' , $work); echo "\n"; }; ?>
a.cc:47:30: error: empty character constant 47 | echo implode('' , $work); | ^~ a.cc:1:1: error: expected unqualified-id before '<' token 1 | <?php | ^ a.cc:2:28: error: '$loop_cnt' does not name a type 2 | for($loop_cnt = 0; $loop_cnt < 5; $loop_cnt++) | ^~~~~~~~~ a.cc:2:43: error: '$loop_cnt' does not name a type 2 | for($loop_cnt = 0; $loop_cnt < 5; $loop_cnt++) | ^~~~~~~~~ a.cc:50:1: error: expected unqualified-id before '?' token 50 | ?> | ^
s210703848
p00424
C++
#include <iostream> using namespace std; int main() { int n,m; int henkan[256]; while(cin>>n,n){ memset(henkan,0,sizeof(henkan)); while(n--){ char a,b; cin>>a>>b; henkan[(int)a] = b; } cin>>m; while(m--){ char a; cin>>a; printf("%c",henkan[(int)a]?:a); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: 'memset' was not declared in this scope 8 | memset(henkan,0,sizeof(henkan)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s566747912
p00424
C++
#include <iostream> #include <cstdio> #include <map> using namespace std; int main() { int N, M; while (scanf("%d ", &N) == 1) { if (N == 0) { break; } map<char, char> m; char d, s; for (int i = 0; i < N; i++) { scanf("%c %c ", &s, &d); map[s] = d; } scanf("%d ", &M); char c; for (int i = 0; i < M; i++) { c = getchar(); if (m.count(c) == 1) { c = m[c]; } putchar(c); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:17:16: error: class template argument deduction failed: 17 | map[s] = d; | ^ a.cc:17:16: error: no matching function for call to 'map(char&)' In file included from /usr/include/c++/14/map:63, from a.cc:3: /usr/include/c++/14/bits/stl_map.h:1473:5: note: candidate: 'template<class _InputIterator, class _Compare, class _Allocator, class, class, class> std::map(_InputIterator, _InputIterator, _Compare, _Allocator)-> map<typename remove_const<typename iterator_traits< <template-parameter-1-1> >::value_type::first_type>::type, typename iterator_traits< <template-parameter-1-1> >::value_type::second_type, _Compare, _Allocator>' 1473 | map(_InputIterator, _InputIterator, | ^~~ /usr/include/c++/14/bits/stl_map.h:1473:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:1482:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Allocator, class, class> std::map(initializer_list<pair<_T1, _T2> >, _Compare, _Allocator)-> map<_Key, _Tp, _Compare, _Allocator>' 1482 | map(initializer_list<pair<_Key, _Tp>>, | ^~~ /usr/include/c++/14/bits/stl_map.h:1482:5: note: template argument deduction/substitution failed: a.cc:17:16: note: mismatched types 'std::initializer_list<std::pair<_T1, _T2> >' and 'char' 17 | map[s] = d; | ^ /usr/include/c++/14/bits/stl_map.h:1489:5: note: candidate: 'template<class _InputIterator, class _Allocator, class, class> std::map(_InputIterator, _InputIterator, _Allocator)-> map<typename remove_const<typename iterator_traits< <template-parameter-1-1> >::value_type::first_type>::type, typename iterator_traits< <template-parameter-1-1> >::value_type::second_type, less<typename remove_const<typename iterator_traits< <template-parameter-1-1> >::value_type::first_type>::type>, _Allocator>' 1489 | map(_InputIterator, _InputIterator, _Allocator) | ^~~ /usr/include/c++/14/bits/stl_map.h:1489:5: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:1495:5: note: candidate: 'template<class _Key, class _Tp, class _Allocator, class> std::map(initializer_list<pair<_T1, _T2> >, _Allocator)-> map<_Key, _Tp, less<_Key>, _Allocator>' 1495 | map(initializer_list<pair<_Key, _Tp>>, _Allocator) | ^~~ /usr/include/c++/14/bits/stl_map.h:1495:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:102:11: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::map<_Key, _Tp, _Compare, _Alloc>)-> std::map<_Key, _Tp, _Compare, _Alloc>' 102 | class map | ^~~ /usr/include/c++/14/bits/stl_map.h:102:11: note: template argument deduction/substitution failed: a.cc:17:16: note: mismatched types 'std::map<_Key, _Tp, _Compare, _Alloc>' and 'char' 17 | map[s] = d; | ^ /usr/include/c++/14/bits/stl_map.h:197:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map()-> std::map<_Key, _Tp, _Compare, _Alloc>' 197 | map() = default; | ^~~ /usr/include/c++/14/bits/stl_map.h:197:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:219:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(const std::map<_Key, _Tp, _Compare, _Allocator>&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 219 | map(const map&) = default; | ^~~ /usr/include/c++/14/bits/stl_map.h:219:7: note: template argument deduction/substitution failed: a.cc:17:16: note: mismatched types 'const std::map<_Key, _Tp, _Compare, _Allocator>' and 'char' 17 | map[s] = d; | ^ /usr/include/c++/14/bits/stl_map.h:227:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::map<_Key, _Tp, _Compare, _Allocator>&&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 227 | map(map&&) = default; | ^~~ /usr/include/c++/14/bits/stl_map.h:227:7: note: template argument deduction/substitution failed: a.cc:17:16: note: mismatched types 'std::map<_Key, _Tp, _Compare, _Allocator>' and 'char' 17 | map[s] = d; | ^ /usr/include/c++/14/bits/stl_map.h:240:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 240 | map(initializer_list<value_type> __l, | ^~~ /usr/include/c++/14/bits/stl_map.h:240:7: note: template argument deduction/substitution failed: a.cc:17:16: note: mismatched types 'std::initializer_list<std::pair<const _Key, _Tp> >' and 'char' 17 | map[s] = d; | ^ /usr/include/c++/14/bits/stl_map.h:252:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(const std::map<_Key, _Tp, _Compare, _Allocator>&, std::__type_identity_t<_Alloc>&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 252 | map(const map& __m, const __type_identity_t<allocator_type>& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:252:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:256:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::map<_Key, _Tp, _Compare, _Allocator>&&, std::__type_identity_t<_Alloc>&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 256 | map(map&& __m, const __type_identity_t<allocator_type>& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:256:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:262:7: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 262 | map(initializer_list<value_type> __l, const allocator_type& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:262:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:268:9: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc, class _InputIterator> map(_InputIterator, _InputIterator, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 268 | map(_InputIterator __first, _InputIterator __last, | ^~~ /usr/include/c++/14/bits/stl_map.h:268:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:285:9: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc, class _InputIterator> map(_InputIterator, _InputIterator)-> std::map<_Key, _Tp, _Compare, _Alloc>' 285 | map(_InputIterator __first, _InputIterator __last) | ^~~ /usr/include/c++/14/bits/stl_map.h:285:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_map.h:302:9: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc, class _InputIterator> map(_InputIterator, _InputIterator, const _Compare&, const _Alloc&)-> std::map<_Key, _Tp, _Compare, _Alloc>' 302 | map(_InputIterator __first, _InputIterator __last, | ^~~ /usr/include/c++/14/bits/stl_map.h:302:9: note: candidate expects 3 arguments, 1 provided a.cc:17:16: note: explicit deduction guides not considered for copy-initialization 17 | map[s] = d; | ^
s749024596
p00424
C++
#include <stdio.h> #include <string.h> int main(void) { char change[26 + 26 + 9]; int n, m; while (1){ memset(change, 0, sizeof(change)); scanf("%d", &n); if (n == 0){ break; } for (int i = 0; i < n; i++){ char base[2], ca[2]; scanf("%s%s", base, ca); change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; } scanf("%d", &m); for (int i = 0; i < m; i++){ char c[2]; scanf("%s", c); if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]); } else { printf("%c", c); } } puts(""); } return (0); }
a.cc: In function 'int main()': a.cc:24:32: error: 'isdigit' was not declared in this scope 24 | change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; | ^~~~~~~ a.cc:24:74: error: 'isupper' was not declared in this scope 24 | change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; | ^~~~~~~ a.cc:34:36: error: 'isdigit' was not declared in this scope 34 | if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ | ^~~~~~~ a.cc:34:72: error: 'isupper' was not declared in this scope 34 | if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ | ^~~~~~~ a.cc:35:61: error: 'base' was not declared in this scope 35 | printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]); | ^~~~
s542869969
p00424
C++
#include <stdio.h> #include <string.h> int main(void) { char change[26 + 26 + 9]; int n, m; while (1){ memset(change, 0, sizeof(change)); scanf("%d", &n); if (n == 0){ break; } for (int i = 0; i < n; i++){ char base[2], ca[2]; scanf("%s%s", base, ca); change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; } scanf("%d", &m); for (int i = 0; i < m; i++){ char c[2]; scanf("%s", c); if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]); } else { printf("%c", c); } } puts(""); } return (0); }
a.cc: In function 'int main()': a.cc:24:32: error: 'isdigit' was not declared in this scope 24 | change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; | ^~~~~~~ a.cc:24:74: error: 'isupper' was not declared in this scope 24 | change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; | ^~~~~~~ a.cc:34:36: error: 'isdigit' was not declared in this scope 34 | if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ | ^~~~~~~ a.cc:34:72: error: 'isupper' was not declared in this scope 34 | if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ | ^~~~~~~ a.cc:35:61: error: 'base' was not declared in this scope 35 | printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]); | ^~~~
s884720430
p00424
C++
#include <stdio.h> #include <string.h> #include <ctype.h> int main(void) { char change[26 + 26 + 9]; int n, m; while (1){ memset(change, 0, sizeof(change)); scanf("%d", &n); if (n == 0){ break; } for (int i = 0; i < n; i++){ char base[2], ca[2]; scanf("%s%s", base, ca); change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0]; } scanf("%d", &m); for (int i = 0; i < m; i++){ char c[2]; scanf("%s", c); if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){ printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]); } else { printf("%c", c); } } puts(""); } return (0); }
a.cc: In function 'int main()': a.cc:36:61: error: 'base' was not declared in this scope 36 | printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]); | ^~~~
s142649562
p00424
C++
#include<stdio.h> int main(){ int a,b; char aa[100],bb[100],d; scanf("%d",&a); for(int i=0;i<a;i++) scanf(" %c %c",&aa[i],&bb[i]); scanf("%d",&b); for(int i=0;i<b;i++) { scanf(" %c",&d); for(int j=0;j<a;j++){ if(d==aa[j]) {d=bb[j]; printf("%c\n",d); break; } } printf("%c",d); } printf("\n"); } return 0; }
a.cc:23:1: error: expected unqualified-id before 'return' 23 | return 0; | ^~~~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s509308299
p00424
C++
#include<stdio.h> int main(){ while(1){ int a,b; char aa[100],bb[100],d,dd[100000000]; scanf("%d",&a); if(a==0) break; for(int i=0;i<a;i++) scanf(" %c %c",&aa[i],&bb[i]); scanf("%d",&b); for(int i=0;i<b;i++) { scanf(" %c",&dd[i]); for(int j=0;j<a;j++){ if(dd[i]==aa[j]) {printf("%c",bb[j]); break; } ツ ツ ツ ツ ツ ツ if(j==a) printf("%c",dd[i]); } printf("%c",dd[i]); } printf("\n"); } return 0; }
a.cc:19:1: error: extended character   is not valid in an identifier 19 | ツ ツ ツ ツ ツ ツ if(j==a) printf("%c",dd[i]); | ^ a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:19:1: error: '\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000if' was not declared in this scope 19 | ツ ツ ツ ツ ツ ツ if(j==a) printf("%c",dd[i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
s715122483
p00424
C++
#include<stdio.h> int main(){ while(1){ int a,b; char aa[100],bb[100],d,dd[100000000]; scanf("%d",&a); if(a==0) break; for(int i=0;i<a;i++) scanf(" %c %c",&aa[i],&bb[i]); scanf("%d",&b); for(int i=0;i<b;i++) { scanf(" %c",&dd[i]); for(int j=0;j<a;j++){ if(dd[i]==aa[j]) {printf("%c",bb[j]); break; } ツ ツ ツ ツ ツ ツ if(j==a) printf("%c",dd[i]); } } printf("\n"); } return 0; }
a.cc:19:1: error: extended character   is not valid in an identifier 19 | ツ ツ ツ ツ ツ ツ if(j==a) printf("%c",dd[i]); | ^ a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:19:1: error: '\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000if' was not declared in this scope 19 | ツ ツ ツ ツ ツ ツ if(j==a) printf("%c",dd[i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
s092813045
p00424
C++
#include <iostream> #include <map> map<char, char> conv; main() { int n, m; while((cin >> n) && n) { conv,clear(); for(int i = 0; i < n; ++i) { char a, b; cin >> a >> b; conv[a] = b; } cin >> m; for(int i = 0; i < m; ++i) { char c; cin >> c; if(conv[c] == 0) cout << c; else cout << conv[c]; } cout << endl; } }
a.cc:4:1: error: 'map' does not name a type 4 | map<char, char> conv; | ^~~ a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:8:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | while((cin >> n) && n) { | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:9:5: error: 'conv' was not declared in this scope; did you mean 'lconv'? 9 | conv,clear(); | ^~~~ | lconv a.cc:9:10: error: 'clear' was not declared in this scope 9 | conv,clear(); | ^~~~~ a.cc:19:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 19 | if(conv[c] == 0) cout << c; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:20:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 20 | else cout << conv[c]; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 22 | cout << 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:22:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 22 | cout << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s786646817
p00424
C++
#include<stdio.h> #include<stdlib.h> int main() { char *before=NULL; char *after=NULL; char *str=NULL; char buf[11]; char ch; int m,n,i,j,conv; while(1) { fgets(buf,11,stdin); n=atoi(buf); if(n==0)break; before=realloc(before,n*sizeof(char)); after=realloc(after,n*sizeof(char)); for(i=0;i<n;i++) { fgets(buf,5,stdin); *(before+i)=*buf; *(after+i)=*(buf+2); } fgets(buf,11,stdin); m=atoi(buf); str=realloc(str,(m+1)*sizeof(char)); for(j=0;j<m;j++) { fgets(buf,3,stdin); ch=*buf; conv=0; for(i=0;i<n;i++) { if(ch==*(before+i)) { *(str+j)=*(after+i); conv=1; } } if(conv==0){*(str+j)=ch;} } *(str+m)='\0'; puts(str); } free(str); free(before); free(after); return 0; }
a.cc: In function 'int main()': a.cc:18:31: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 18 | before=realloc(before,n*sizeof(char)); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:19:30: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 19 | after=realloc(after,n*sizeof(char)); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:31:28: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 31 | str=realloc(str,(m+1)*sizeof(char)); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ | | | void*
s867167524
p00424
C++
#include <iostream> #include <string> using namespace std; char s[100000000]; int main() { int n, m, i, j, k; char a[80], b[80], c; bool f = false; while (cin >> n && n) { for (i = 0; i < n; i++) { cin >> a[i] >> b[i]; } cin >> m; strcpy(s, ""); for (i = k = 0; i < m; i++) { cin >> c; for (j = f = 0; j < n && !f; j++) { if (c == a[j]) { s[i] = b[j]; f = true; } } if (!f) s[i] = c; } s[m-1] = '\0'; cout << s << endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'strcpy' was not declared in this scope 17 | strcpy(s, ""); | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | #include <string>
s530567868
p00424
C++
#include<iostream> #include<map> #include<vector> using namespace std; int main() { int n; while(cin>>n){ if(n==0) break; vector<char> ans; map<char,char> M; for(int i=0;i<n;i++){ char in,out; cin>>in>>out; M[in]=out; } int k; cin>>k; for(int i=0;i<k;i++){ char s; cin>>s; if(!M.count(s)){ ans.push_back(s); } else ans.push_back(M[s]); } for(int i=0;i<ans.size();i++) cout<<ans[i]; cout<<endl; } return 0; }
a.cc:1:1: error: extended character  is not valid in an identifier 1 | #include<iostream> | ^ a.cc:1:1: error: extended character  is not valid in an identifier a.cc:1:3: error: stray '#' in program 1 | #include<iostream> | ^ a.cc:1:1: error: '\302\201\302\217' does not name a type 1 | #include<iostream> | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/
s494233885
p00424
C++
3 A a 0 5 5 4 10 A B C 0 1 4 5 a b A 3 A a 0 5 5 4 10 A B C 0 1 4 5 a b A 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 | ^
s506734902
p00424
C++
#include <iostream> #include <vector> using namespace std; int main(void) { for (int n = 0; (cin >> n) && n != 0;) { vector<pair<char, char>> conversion; for (int i = 0; i < n; i++) { char preLetter = 0, afterLetter = 0; cin >> preLetter >> afterLetter; conversion.push_back(make_pair<char,char>(preLetter, afterLetter)); } int m = 0; cin >> m; vector<char> letters; for (int i = 0; i < m; i++) { char letter = 0; cin >> letter; letters.push_back(letter); } for (int i = 0; i < m; i++) { for (int j = 0; j < conversion.size(); j++) { if (conversion[j].first == letters[i]) { letters[i] = conversion[j].second; break; } } cout << letters[i]; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:67: error: cannot bind rvalue reference of type 'char&&' to lvalue of type 'char' 12 | conversion.push_back(make_pair<char,char>(preLetter, afterLetter)); | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51, 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, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:1132:21: note: initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = char; _T2 = char; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = char; typename decay<_Tp>::type = char; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = char; typename decay<_Tp2>::type = char]' 1132 | make_pair(_T1&& __x, _T2&& __y) | ~~~~~~^~~
s638843295
p00424
C++
using namespace std; int main(){ int a,b,c; int i,j,k; char arr[100000000][2]; char arr2[100000000]; while(1){ cin >> a; if(a == 0 ) break; for(i=0 ; i < a ; i++){ cin >> arr[i][0] >> arr[i][1] ; // cout << a ; } // cout << "b"; // cout << "bの入力"<<endl; cin >> b; // cout << "bの値は" << b << endl; for(i=0 ; i<b ; i++){ // cout << i << "周目" << endl; cin >> arr2[i]; for(j=0 ; j < a ; j++){ if(arr2[i] == arr[j][0] ){ arr2[i] = arr[j][1]; break; } } } cout << arr2 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:9: error: 'cin' was not declared in this scope 16 | cin >> a; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:51:9: error: 'cout' was not declared in this scope 51 | cout << arr2 << endl; | ^~~~ a.cc:51:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:51:25: error: 'endl' was not declared in this scope 51 | cout << arr2 << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s254217050
p00424
C++
#include <iostream> #include <cstdio> void Convert(std::string *target, std::string search, std::string to); int main(){ int n,m,i = 0; std::string table[10000][2]; std::string String = "", q; while(1){ scanf("%d", &n); if(n == 0)return 0; for(i = 0; i < n; ++i)std::cin >> table[i][0] >> table[i][1]; scanf("%d", &m); for(i = 0; i < m; ++i){ std::cin >> q; String += q; } for(i = 0; i < n; ++i){ Convert(&String, table[i][0], table[i][1]); } std::cout << String << "\n"; }
a.cc: In function 'int main()': a.cc:23:10: error: expected '}' at end of input 23 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s301079204
p00424
C++
#include <iostream> #include <cstdio> void Convert(std::string *target, std::string search, std::string to); int main(){ int n,m,i = 0; std::string table[10000][2]; std::string String = "", q; while(1){ scanf("%d", &n); if(n == 0)return 0; for(i = 0; i < n; ++i)std::cin >> table[i][0] >> table[i][1]; scanf("%d", &m); for(i = 0; i < m; ++i){ std::cin >> q; String += q; } for(i = 0; i < n; ++i){ Convert(&String, table[i][0], table[i][1]); } std::cout << String << "\n"; } }
/usr/bin/ld: /tmp/ccj7VWxd.o: in function `main': a.cc:(.text+0x222): undefined reference to `Convert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' collect2: error: ld returned 1 exit status
s974354320
p00424
C++
#include <iostream> #include <string> using namespace std; int main(){ int n: string a[n]; string b[n]; int c; string d; int m; int e; int f; while(cin >> n){ if(n!=0){ c=0; while(c<n){ cin >>a[c]; cin >>b[c]; c=c+1;} cin >> m; c=0; while(c<m){ cin >>d; e=0; f=0; while(e<n){ if(d==a[e]){cout<<b[e]; f=1;} e=e+1; } if(f==0){cout <<d;} c=c+1;} } } }
a.cc: In function 'int main()': a.cc:5:6: error: found ':' in nested-name-specifier, expected '::' 5 | int n: | ^ | :: a.cc:5:5: error: 'n' has not been declared 5 | int n: | ^ a.cc:6:8: error: qualified-id in declaration before 'a' 6 | string a[n]; | ^ a.cc:7:10: error: 'n' was not declared in this scope 7 | string b[n]; | ^ a.cc:18:7: error: 'a' was not declared in this scope 18 | cin >>a[c]; | ^ a.cc:19:7: error: 'b' was not declared in this scope 19 | cin >>b[c]; | ^ a.cc:31:7: error: 'a' was not declared in this scope 31 | if(d==a[e]){cout<<b[e]; f=1;} | ^ a.cc:31:19: error: 'b' was not declared in this scope 31 | if(d==a[e]){cout<<b[e]; f=1;} | ^
s814844932
p00424
C++
3 A a 0 5 5 4 10 A B C 0 1 4 5 a b A
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 | ^
s992353502
p00424
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; do{ char a[256],b[256]; for(int i=0; i<n; i++){ cin >> a[i] >> b[i]; } int num; cin >> num; char s[256]; for(int i=0; i<num; i++){ cin >> s[i]; for(j=0; j<n; j++){ if(s[i]==a[j]){ s[i]=b[j]; } } } s[num]='\0'; cin >> n; }while(n!=0); }
a.cc: In function 'int main()': a.cc:18:29: error: 'j' was not declared in this scope 18 | for(j=0; j<n; j++){ | ^
s204952895
p00424
C++
#include <iostream> #define VARIABLE(x) cerr << #x << "=" << x << endl #define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define REP(i,m,n) for (int i=m;i<(int)(n);i++) #define if_range(x, y, w, h) if (0<=x && x<w && 0<=y && y<h) const int INF = 10000000; int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1}; using namespace std; typedef pair<int, int> P; /** Problem0501 : Data Conversion **/ int main() { map<char, char> list; int n; while (cin>>n, n) { rep(k, n) { char from, to; cin>>from>>to; list[from]=to; } int m; cin>>m; rep(k, m) { char c; cin>>c; if (list.find(c) != list.end()) { cout<<list[c]; } else { cout << c; } } cout << endl; } }
a.cc: In function 'int main()': a.cc:17:9: error: 'map' was not declared in this scope 17 | map<char, char> list; | ^~~ a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 1 | #include <iostream> +++ |+#include <map> 2 | a.cc:17:13: error: expected primary-expression before 'char' 17 | map<char, char> list; | ^~~~ a.cc:23:25: error: 'list' was not declared in this scope 23 | list[from]=to; | ^~~~ a.cc:2:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>' 1 | #include <iostream> +++ |+#include <list> 2 | a.cc:30:29: error: 'list' was not declared in this scope 30 | if (list.find(c) != list.end()) { | ^~~~ a.cc:30:29: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
s174606157
p00425
Java
import java.io.IOException; public class P0502 { /** * * 標準入力から1行読み込む。 * <p> * 指定された長さまで、1行分文字列を読み込む。 * 行末の判断は EOF(-1) または 改行('\n')を用いる。 * </p> * @param maxLength * @return 1行分読み込んだ文字列 */ private static String ReadLn(int maxLength) { byte line[] = new byte[maxLength]; int length = 0; int character = -1; try { while (length < maxLength) { character = System.in.read(); if ((character < 0) || (character == '\n')) break; line[length++] += character; } } catch (IOException e) { return null; } if ((character < 0) && (length == 0)) return null; // eof return (new String(line, 0, length - 1)); } public static void main(String args[]) { P0502 myWork = new P0502(); // create a dinamic instance myWork.Begin(); // the true entry point } private static final int NOT_TURN = 0; private static final int RIGHT = 1; private static final int LEFT = 2; private static final int NORTH = 1; private static final int EAST = 2; private static final int SOUTH = 3; private static final int WEST = 4; // 合計値 private int sum = 1; // 向き private int[] dice = { 1, 5, 3, 2, 4 }; private int isTurn(String value) { if ("Right".equals(value)) { return RIGHT; } else if ("Left".equals(value)) { return LEFT; } return NOT_TURN; } private int whichDirection(String value) { if ("North".equals(value)) { return NORTH; } else if ("East".equals(value)) { return EAST; } else if ("South".equals(value)) { return SOUTH; } return WEST; } public void Begin() { String input = null; while ((input = P0502.ReadLn(255)) != null) { if ("0".equals(input)) { break; } System.out.println(input); int loop = Integer.parseInt(input); for (int i = 0; i < loop; i++) { String command = P0502.ReadLn(255); int turn = isTurn(command); int tmp = 0; switch (turn) { case RIGHT: tmp = dice[4]; for (int j = 1; j < 4; j++) { dice[j + 1] = dice[j]; } dice[1] = tmp; break; case LEFT: tmp = dice[0]; for (int j = 3; j >= 1; j--) { dice[j] = dice[j + 1]; } dice[4] = tmp; break; default: int direction = whichDirection(command); switch (direction) { case NORTH: dice[NORTH] = dice[0]; dice[0] = dice[SOUTH]; dice[SOUTH] = 7 - dice[NORTH]; break; case EAST: dice[EAST] = dice[0]; dice[0] = dice[WEST]; dice[WEST] = 7 - dice[EAST]; break; case SOUTH: dice[SOUTH] = dice[0]; dice[0] = dice[NORTH]; dice[NORTH] = 7 - dice[SOUTH]; break; default: dice[WEST] = dice[0]; dice[0] = dice[EAST]; dice[EAST] = 7 - dice[WEST]; break; } break; } sum += dice[0]; } System.out.println(sum); } } }
Main.java:3: error: class P0502 is public, should be declared in a file named P0502.java public class P0502 { ^ 1 error
s763594106
p00425
Java
import java.io.*; // namespace... class 0502 { public static void main() { System.out.printf("%d%n", solve()); return; } private int solve() { InputStreamReader isr = new InputStreamReader(System.in); BufferdReader br = new BufferedReader(isr); int ret = 1; String buf; int dtop=1, dforward=2, dside=3; while((buf = br.readLine()) != null) { int tmp; switch(buf) { case "North": tmp = dtop; dtop = dforward; dforward = 7-tmp; break; case "South": tmp = dtop; dtop = 7-dforward; dforward = tmp; break; case "West": tmp = dtop; dtop = dside; dside = 7-tmp; break; case "East": tmp = dtop; dtop = 7-dside; dside = tmp; break; case "Right": tmp = dforward; dforward = dside; dside = 7-tmp; break; case "Left": tmp = dforward; dforward = 7-dside; dside = tmp; } ret += dtop; } return ret; } }
Main.java:3: error: <identifier> expected class 0502 { ^ 1 error
s717103091
p00425
Java
import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class Dice { int top, bottom, north, south, west, east; public Dice(){ this.top = 1; this.bottom = 6; this.north = 5; this.south = 2; this.west = 4; this.east = 3; } public void initial(){ this.top = 1; this.bottom = 6; this.north = 5; this.south = 2; this.west = 4; this.east = 3; } } public class Operation { public Dice before = new Dice(); public Dice after = new Dice(); public void read(){ try { //ファイルを読み込む FileReader fr = new FileReader("test.txt"); BufferedReader br = new BufferedReader(fr); //読み込んだファイルを1行ずつ画面出力する while(true){ String line, st; int sum = 1; line = br.readLine(); //System.out.println(line); if(Integer.parseInt(line) == 0) break; for(int i=0; i<Integer.parseInt(line); i++){ st = br.readLine(); if(st.equals("North")){ after.north = before.top; after.top = before.south; after.south = before.bottom; after.bottom = before.north; } else if(st.equals("South")){ after.north = before.bottom; after.top = before.north; after.south = before.top; after.bottom = before.south; } else if(st.equals("East")){ after.west = before.bottom; after.top = before.west; after.east = before.top; after.bottom = before.east; } else if(st.equals("West")){ after.west = before.top; after.top = before.east; after.east = before.bottom; after.bottom = before.west; } else if(st.equals("Right")){ after.north = before.west; after.west = before.south; after.south = before.east; after.east = before.north; } else if(st.equals("Left")){ after.north = before.east; after.west = before.north; after.south = before.west; after.east = before.south; } sum += after.top; //更新 before.north = after.north; before.south = after.south; before.west = after.west; before.east = after.east; before.top = after.top; before.bottom = after.bottom; } System.out.println(sum); before.initial(); after.initial(); } //終了処理 br.close(); fr.close(); } catch (IOException ex) { //例外発生時処理 ex.printStackTrace(); } } public static void main(String[] args){ Operation op = new Operation(); op.read(); } }
Main.java:5: error: class Dice is public, should be declared in a file named Dice.java public class Dice { ^ Main.java:28: error: class Operation is public, should be declared in a file named Operation.java public class Operation { ^ 2 errors
s292138018
p00425
Java
import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class Dice { int top, bottom, north, south, west, east; public Dice(){ this.top = 1; this.bottom = 6; this.north = 5; this.south = 2; this.west = 4; this.east = 3; } public void initial(){ this.top = 1; this.bottom = 6; this.north = 5; this.south = 2; this.west = 4; this.east = 3; } } public class Operation { public Dice before = new Dice(); public Dice after = new Dice(); public void read(){ try { //ファイルを読み込む FileReader fr = new FileReader("test.txt"); BufferedReader br = new BufferedReader(fr); //読み込んだファイルを1行ずつ画面出力する while(true){ String line, st; int sum = 1; line = br.readLine(); //System.out.println(line); if(Integer.parseInt(line) == 0) break; for(int i=0; i<Integer.parseInt(line); i++){ st = br.readLine(); if(st.equals("North")){ after.north = before.top; after.top = before.south; after.south = before.bottom; after.bottom = before.north; } else if(st.equals("South")){ after.north = before.bottom; after.top = before.north; after.south = before.top; after.bottom = before.south; } else if(st.equals("East")){ after.west = before.bottom; after.top = before.west; after.east = before.top; after.bottom = before.east; } else if(st.equals("West")){ after.west = before.top; after.top = before.east; after.east = before.bottom; after.bottom = before.west; } else if(st.equals("Right")){ after.north = before.west; after.west = before.south; after.south = before.east; after.east = before.north; } else if(st.equals("Left")){ after.north = before.east; after.west = before.north; after.south = before.west; after.east = before.south; } sum += after.top; //更新 before.north = after.north; before.south = after.south; before.west = after.west; before.east = after.east; before.top = after.top; before.bottom = after.bottom; } System.out.println(sum); before.initial(); after.initial(); } //終了処理 br.close(); fr.close(); } catch (IOException ex) { //例外発生時処理 ex.printStackTrace(); } } public static void main(String[] args){ Operation op = new Operation(); op.read(); } }
Main.java:5: error: class Dice is public, should be declared in a file named Dice.java public class Dice { ^ Main.java:28: error: class Operation is public, should be declared in a file named Operation.java public class Operation { ^ 2 errors
s253503113
p00425
Java
import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class Operation { int before_north, before_south, before_west, before_east, before_top, before_bottom; int after_north, after_south, after_west, after_east, after_top, after_bottom; public void read(){ try { //ファイルを読み込む FileReader fr = new FileReader("test.txt"); BufferedReader br = new BufferedReader(fr); //読み込んだファイルを1行ずつ画面出力する while(true){ initial(); String line, st; int sum = 1; line = br.readLine(); //System.out.println(line); if(Integer.parseInt(line) == 0) break; for(int i=0; i<Integer.parseInt(line); i++){ st = br.readLine(); if(st.equals("North")){ after_north = before_top; after_top = before_south; after_south = before_bottom; after_bottom = before_north; } else if(st.equals("South")){ after_north = before_bottom; after_top = before_north; after_south = before_top; after_bottom = before_south; } else if(st.equals("East")){ after_west = before_bottom; after_top = before_west; after_east = before_top; after_bottom = before_east; } else if(st.equals("West")){ after_west = before_top; after_top = before_east; after_east = before_bottom; after_bottom = before_west; } else if(st.equals("Right")){ after_north = before_west; after_west = before_south; after_south = before_east; after_east = before_north; } else if(st.equals("Left")){ after_north = before_east; after_west = before_north; after_south = before_west; after_east = before_south; } sum += after_top; //更新 before_north = after_north; before_south = after_south; before_west = after_west; before_east = after_east; before_top = after_top; before_bottom = after_bottom; } System.out.println(sum); } //終了処理 br.close(); fr.close(); } catch (IOException ex) { //例外発生時処理 ex.printStackTrace(); } } public void initial(){ before_top = 1; before_bottom = 6; before_north = 5; before_south = 2; before_west = 4; before_east = 3; after_top = 1; after_bottom = 6; after_north = 5; after_south = 2; after_west = 4; after_east = 3; } public static void main(String[] args){ Operation op = new Operation(); op.read(); } }
Main.java:6: error: class Operation is public, should be declared in a file named Operation.java public class Operation { ^ 1 error
s153040826
p00425
Java
import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class Main { int before_north, before_south, before_west, before_east, before_top, before_bottom; int after_north, after_south, after_west, after_east, after_top, after_bottom; public void read(){ try { //ファイルを読み込む FileReader fr = new FileReader("test.txt"); BufferedReader br = new BufferedReader(fr); //読み込んだファイルを1行ずつ画面出力する while(true){ initial(); String line, st; int sum = 1; line = br.readLine(); //System.out.println(line); if(Integer.parseInt(line) == 0) break; for(int i=0; i<Integer.parseInt(line); i++){ st = br.readLine(); if(st.equals("North")){ after_north = before_top; after_top = before_south; after_south = before_bottom; after_bottom = before_north; } else if(st.equals("South")){ after_north = before_bottom; after_top = before_north; after_south = before_top; after_bottom = before_south; } else if(st.equals("East")){ after_west = before_bottom; after_top = before_west; after_east = before_top; after_bottom = before_east; } else if(st.equals("West")){ after_west = before_top; after_top = before_east; after_east = before_bottom; after_bottom = before_west; } else if(st.equals("Right")){ after_north = before_west; after_west = before_south; after_south = before_east; after_east = before_north; } else if(st.equals("Left")){ after_north = before_east; after_west = before_north; after_south = before_west; after_east = before_south; } sum += after_top; //更新 before_north = after_north; before_south = after_south; before_west = after_west; before_east = after_east; before_top = after_top; before_bottom = after_bottom; } System.out.println(sum); } //終了処理 br.close(); fr.close(); } catch (IOException ex) { //例外発生時処理 ex.printStackTrace(); } } public void initial(){ before_top = 1; before_bottom = 6; before_north = 5; before_south = 2; before_west = 4; before_east = 3; after_top = 1; after_bottom = 6; after_north = 5; after_south = 2; after_west = 4; after_east = 3; } public static void main(String[] args){ Main op = new Operation(); op.read(); } }
Main.java:105: error: cannot find symbol Main op = new Operation(); ^ symbol: class Operation location: class Main 1 error
s696916611
p00425
Java
import java.util.Scanner; public class Main { public static Scanner sc; public static void main(String[] args){ sc=new Scanner(System.in); while(true){ int n=sc.nextInt(); if(n==0)break; Dice dice=new Dice(); int ans=0; for(int i=0;i<n;i++){ dice.roll(sc.next()); ans+=dice.get(1); } System.out.println(ans); } } } class Dice { int d[]={1,2,3,4,5,6}; void roll(String s){ int temp=d[0]; int temp2=d[1]; switch(s) { case "North": d[0]=d[1]; d[1]=d[5]; d[5]=d[4]; d[4]=temp; break; case "South": d[0]=d[4]; d[4]=d[5]; d[5]=d[1]; d[1]=temp; break; case "East": d[0]=d[3]; d[3]=d[5]; d[5]=d[2]; d[2]=temp; break; case "West": d[0]=d[2]; d[2]=d[5]; d[5]=d[3]; d[3]=temp; break; case "Right": d[1]=d[2]; d[2]=d[4]; d[4]=d[3]; d[3]=temp2; case "Left": d[1]=d[3]; d[3]=d[4]; d[4]=d[2]; d[2]=temp2; } } int get(int i){ return d[i-1]; }
Main.java:66: error: reached end of file while parsing } ^ 1 error
s987085592
p00425
Java
import java.util.*; import java.lang.*; import java.io.*; public class answer{ public static void main (String[] args) throws java.lang.Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); while(line!=null&&!"0".equals(line)){ int cnt = Integer.parseInt(line); Dice dice = new Dice(); for(int i=0;i<cnt;i++){ line = br.readLine(); dice.move(line); } System.out.println(dice.getAns()); line = br.readLine(); } } public static class Dice{ int top,south,east,west,north,down; int topSum=1; Dice(){ top=1; south=2; east=3; west=4; north=5; down=6; } public int getAns(){ return topSum; } void move(String move){ int tmp; if("North".equals(move)){ tmp = top; top = south; south = down; down = north; north = tmp; }else if("East".equals(move)){ tmp = top; top = west; west = down; down = east; east = tmp; }else if("West".equals(move)){ tmp = top; top = east; east = down; down = west; west = tmp; }else if("South".equals(move)){ tmp = top; top = north; north = down; down = south; south = tmp; }else if("Right".equals(move)){ tmp = south; south = east; east = north; north = west; west = tmp; }else if("Left".equals(move)){ tmp = south; south = west; west = north; north = east; east = tmp; } topSum+=top; } } }
Main.java:5: error: class answer is public, should be declared in a file named answer.java public class answer{ ^ 1 error
s577282885
p00425
Java
public class Main { public static void main(String args[] ) throws Exception { Scanner sc = new Scanner(System.in); int[] dice = {1, 2, 3, 4, 5, 6}; List<Integer> resultList = new ArrayList<Integer>(); while (true) { int n = sc.nextInt(); if (n == 0) break; int result = 0; for (int i = 0; i < n; i++) { String dist = sc.next(); int tmp = 0; switch (dist) { case "North" : tmp = dice[0]; dice[0] = dice[1]; dice[1] = dice[5]; dice[5] = dice[3]; dice[3] = tmp; break; case "South" : tmp = dice[0]; dice[0] = dice[3]; dice[3] = dice[5]; dice[5] = dice[1]; dice[1] = tmp; break; case "East" : tmp = dice[0]; dice[0] = dice[4]; dice[4] = dice[5]; dice[5] = dice[2]; dice[2] = tmp; break; case "West" : tmp = dice[0]; dice[0] = dice[2]; dice[2] = dice[5]; dice[5] = dice[4]; dice[4] = tmp; break; case "Left" : tmp = dice[1]; dice[1] = dice[4]; dice[4] = dice[3]; dice[3] = dice[2]; dice[2] = tmp; break; case "Right" : tmp = dice[1]; dice[1] = dice[2]; dice[2] = dice[3]; dice[3] = dice[4]; dice[4] = tmp; break; default : break; } result += dice[0]; System.out.println(result); } resultList.add(result); } for (int num : resultList) { System.out.println(num); } } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol List<Integer> resultList = new ArrayList<Integer>(); ^ symbol: class List location: class Main Main.java:6: error: cannot find symbol List<Integer> resultList = new ArrayList<Integer>(); ^ symbol: class ArrayList location: class Main 4 errors
s288927734
p00425
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; public class Dice { public static void main(String[] args) throws Exception, IOException { BufferedReader br = new BufferedReader( new InputStreamReader(System.in)); int cycle = Integer.parseInt(br .readLine()); int currentNumber = 1; int frontNumber = 2; int[] currentFront = new int[2]; currentFront[0] = currentNumber; currentFront[1] = frontNumber; int total = 1; Map<String, Integer> map = new HashMap<>(); for (int i = 0; i < cycle; i++) { judge(br.readLine(), currentFront); total += currentFront[0]; } System.out.println(total); } private static void judge(String string, int[] currentFront) { if (Dicer.North.name().equals(string)) { int current = currentFront[0]; currentFront[0] = currentFront[1]; currentFront[1] = 7 - current; return; } if (Dicer.South.name().equals(string)) { int current = currentFront[0]; currentFront[0] = 7 - currentFront[1]; currentFront[1] = current; return; } if (Dicer.West.name().equals(string)) { currentFront[0] = rightSideNumberIs( currentFront[0], currentFront[1]); return; } if (Dicer.East.name().equals(string)) { currentFront[0] = 7 - rightSideNumberIs( currentFront[0], currentFront[1]); } if (Dicer.Left.name().equals(string)) { currentFront[1] = 7 - rightSideNumberIs( currentFront[0], currentFront[1]); } if (Dicer.Right.name().equals(string)) { currentFront[1] = rightSideNumberIs( currentFront[0], currentFront[1]); } } private static int rightSideNumberIs( int currentNumber, int frontNumber) { int returnNumber = 0; if (currentNumber == 1) { switch (frontNumber) { case 2: returnNumber = 3; break; case 3: returnNumber = 5; break; case 4: returnNumber = 2; break; case 5: returnNumber = 4; break; } } if (currentNumber == 2) { switch (frontNumber) { case 1: returnNumber = 4; break; case 3: returnNumber = 1; break; case 6: returnNumber = 3; break; case 4: returnNumber = 6; break; } } if (currentNumber == 3) { switch (frontNumber) { case 2: returnNumber = 6; break; case 1: returnNumber = 2; break; case 5: returnNumber = 1; break; case 6: returnNumber = 5; break; } } if (currentNumber == 4) { switch (frontNumber) { case 1: returnNumber = 5; break; case 5: returnNumber = 6; break; case 6: returnNumber = 2; break; case 2: returnNumber = 1; break; } } if (currentNumber == 5) { switch (frontNumber) { case 1: returnNumber = 3; break; case 3: returnNumber = 6; break; case 6: returnNumber = 4; break; case 4: returnNumber = 1; break; } } if (currentNumber == 6) { switch (frontNumber) { case 2: returnNumber = 4; break; case 4: returnNumber = 5; break; case 5: returnNumber = 3; break; case 3: returnNumber = 2; break; } } return returnNumber; } enum Dicer { North, South, West, East, Left, Right } }
Main.java:7: error: class Dice is public, should be declared in a file named Dice.java public class Dice { ^ 1 error
s246183993
p00425
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Dice { public static void main(String[] args) throws Exception { // TODO ????????????????????????????????????????????? boolean[] arg = null; int length=0,out=0; int i=0,rou=0,store=1; boolean first=true; List<Integer> score=new ArrayList<Integer>(); int[] dice=new int[3]; boolean[] rui=new boolean[3]; try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { String line; while ((line = br.readLine()) != null ) { if(line.equals("0")){ break; } if(first){ length=Integer.parseInt(line); for(int k=0;k<3;k++){ dice[k]=k+1; } first=false; }else{ if(line.equals("North")){ int w=dice[0]; dice[0]=dice[1]; dice[1]=7-w; }else if(line.equals("East")){ int w=dice[2]; dice[2]=dice[0]; dice[0]=7-w; }else if(line.equals("West")){ int w=dice[0]; dice[0]=dice[2]; dice[2]=7-w; }else if(line.equals("South")){ int w=dice[1]; dice[1]=dice[0]; dice[0]=7-w; }else if(line.equals("Left")){ int w=dice[2]; dice[2]=dice[1]; dice[1]=7-w; }else if(line.equals("Right")){ int w=dice[1]; dice[1]=dice[2]; dice[2]=7-w; } store+=dice[0]; i++; } if(length==i){ i=0; rou++; score.add(store); store=1; first=true; } } for(int k=0;k<score.size();k++){ System.out.println(score.get(k)); } } } }
Main.java:6: error: class Dice is public, should be declared in a file named Dice.java public class Dice { ^ 1 error
s204200889
p00425
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(true){ int count=0; int N = cin.nextInt(); if(N==0){ break; } Dice di = new Dice(1, 2); count += di.dice[0]; for(int i = 0; i < N; i++){ String str = cin.next(); int dir = 0; if(str.equals("North")){ dir = 3; } else if(str.equals("East")){ dir = 2; } else if(str.equals("West")){ dir = 4; } else if(str.equals("South")){ dir = 1; } else if(str.equals("Right")){ dir = 6; } else if(str.equals("Left")){ dir =5 ; } di.dice = di.roll(dir); count += di.dice[0]; } System.out.println(count); } } } class Dice { static int[] dice; static int[][] dice_table= { { 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 3, 5, 2, 4, 0}, { 0, 4, 0, 1, 6, 0, 3}, { 0, 2, 6, 0, 0, 1, 5}, { 0, 5, 1, 0, 0, 6, 2}, { 0, 3, 0, 6, 1, 0, 4}, { 0, 0, 4, 2, 5, 3, 0} }; Dice(int x, int y){ dice = new int[6]; dice[0] = x; dice[1] = y; dice[2] = dice_table[x][y]; dice[3] = 7-y; dice[4] = dice_table[y][x]; dice[5] = 7-x; } static int[] turn(int dir){ int[] b = new int[6]; // Right if(dir == 5){ b[0]=dice[0]; b[1]=dice[4]; b[2]=dice[1]; b[3]=dice[2]; b[4]=dice[3]; b[5]=dice[5]; } else{ b[0]=dice[0]; b[1]=dice[2]; b[2]=dice[3]; b[3]=dice[4]; b[4]=dice[1]; b[5]=dice[5]; } return b; } static int[] roll(int dir){ int[] b = new int[6]; if(dir==1){ b[0]=dice[3]; b[1]=dice[0]; b[2]=dice[2]; b[3]=dice[5]; b[4]=dice[4]; b[5]=dice[1]; } else if(dir==2){ b[0]=dice[4]; b[1]=dice[1]; b[2]=dice[0]; b[3]=dice[3]; b[4]=dice[5]; b[5]=dice[2]; } else if(dir==3){ b[0]=dice[1]; b[1]=dice[5]; b[2]=dice[2]; b[3]=dice[0]; b[4]=dice[4]; b[5]=dice[3]; } else if(dir==4){ b[0]=dice[2]; b[1]=dice[1]; b[2]=dice[5]; b[3]=dice[3]; b[4]=dice[0]; b[5]=dice[4]; } else if(dir == 5){ b[0]=dice[0]; b[1]=dice[4]; b[2]=dice[1]; b[3]=dice[2]; b[4]=dice[3]; b[5]=dice[5]; } else{ b[0]=dice[0]; b[1]=dice[2]; b[2]=dice[3]; b[3]=dice[4]; b[4]=dice[1]; b[5]=dice[5]; } return b; }
Main.java:139: error: reached end of file while parsing } ^ 1 error
s325894329
p00425
C
#include "stdio.h" #include "string.h" #define DICE 4 int zorome[4][4]={{1,2,6,5},{1,4,6,3},{1,5,6,2},{1,3,6,4}}; int copy[4]; int sum=0; void north(void){ int tmp[2],i,m; tmp[0]=zorome[0][0]; tmp[1]=zorome[2][3]; for(i=1;i<DICE;i++){ zorome[0][i-1]=zorome[0][i]; zorome[2][DICE-i]=zorome[2][DICE-i-1]; } zorome[0][3]=tmp[0]; zorome[2][0]= zorome[1][0]=zorome[3][0]=tmp[1]; zorome[1][2]=zorome[3][2]=zorome[0][2]; sum+=zorome[0][0]; } void east(void){ int tmp[2],i,m; tmp[0]=zorome[1][0]; tmp[1]=zorome[3][3]; for(i=1;i<DICE;i++){ zorome[1][i-1]=zorome[1][i]; zorome[3][DICE-i]=zorome[3][DICE-i-1]; } zorome[1][3]=tmp[0]; zorome[0][0]= zorome[2][0]=zorome[3][0]=tmp[1]; zorome[0][2]=zorome[2][2]=zorome[1][2]; sum+=zorome[1][0]; } void south(void){ int tmp[2],i,m; tmp[0]=zorome[2][0]; tmp[1]=zorome[0][3]; for(i=1;i<DICE;i++){ zorome[2][i-1]=zorome[2][i]; zorome[0][DICE-i]=zorome[0][DICE-i-1]; } zorome[2][3]=tmp[0]; zorome[0][0]= zorome[1][0]=zorome[3][0]=tmp[1]; zorome[1][2]=zorome[3][2]=zorome[2][2]; sum+=zorome[2][0]; } void west(void){ int tmp[2],i,m; tmp[0]=zorome[3][0]; tmp[1]=zorome[1][3]; for(i=1;i<DICE;i++){ zorome[3][i-1]=zorome[3][i]; zorome[1][DICE-i]=zorome[1][DICE-i-1]; } zorome[3][3]=tmp[0]; zorome[0][0]= zorome[2][0]=zorome[1][0]=tmp[1];  zorome[0][2]=zorome[2][2]=zorome[3][2]; sum+=zorome[3][0]; } void right(void){ int i,m; for(i=0;i<DICE;i++){ copy[i]=zorome[3][i]; } for(m=0;m<DICE;m++){ for(i=0;i<DICE;i++){ zorome[DICE-m-1][i]=zorome[DICE-m-2][i]; } } for(i=0;i<DICE;i++){ zorome[0][i]= copy[i]; } sum+=zorome[3][0]; } void left(void){ int i,m; for(i=0;i<DICE;i++){ copy[i]=zorome[0][i]; } for(m=0;m<DICE;m++){ for(i=0;i<DICE;i++){ zorome[m][i]=zorome[m+1][i]; } for(i=0;i<DICE;i++){ zorome[3][i]= copy[i]; } sum+=zorome[3][0]; } void debugg(void){ int i,n; for(i=0;i<DICE;i++){ for(n=0;n<DICE;n++){ printf("zorome[%d][%d] = %d \n",i,n,zorome[i][n]) ; } puts(""); } } int main(void){ int i,n; char ch[100]; do{ scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",ch); if(strcmp(ch,"North")==0){ north(); }else if(strcmp(ch,"East")==0){ east(); }else if(strcmp(ch,"Left")==0){ left(); }else if(strcmp(ch,"South")==0){ south(); }else if(strcmp(ch,"West")==0){ west(); }else if(strcmp(ch,"Right")==0){ right(); }else{ i--; } } printf("%d\n",sum+1); }while(n); return 0; }
main.c: In function 'west': main.c:56:1: error: stray '\343' in program 56 | <U+3000>zorome[0][2]=zorome[2][2]=zorome[3][2]; | ^~~~~~~~ main.c: In function 'left': main.c:123:2: error: expected declaration or statement at end of input 123 | } | ^
s860941572
p00425
C
#include "stdio.h" #include "string.h" #define DICE 4 const int shokiti[4][4]={{1,2,6,5},{1,4,6,3},{1,5,6,2},{1,3,6,4}}; int zorome[4][4]; int cp[4]; unsigned long sum; void direction(constint de){ int tmp[2],i,m,j; m=(de>=2)?de-2:de+2; j=(m+de)/2%2; tmp[0]=zorome[de][0]; tmp[1]=zorome[m][3]; for(i=1;i<DICE;i++){ zorome[de][i-1]=zorome[de][i]; zorome[m][DICE-i]=zorome[m][DICE-i-1]; } zorome[de][3]=tmp[0]; zorome[m][0]= zorome[j][0]=zorome[j+2][0]=tmp[1]; zorome[j][2]=zorome[j+2][2]=zorome[de][2]; sum+=(unsigned long)zorome[m][0]; } void rotation(const int de){ int i,m; for(i=0;i<DICE;i++){ cp[i]=zorome[de][i]; } for(m=0;m<DICE;m++){ for(i=0;i<DICE;i++){ zorome[(de)?DICE-m-1:m][i]=zorome[(de)?DICE-m- 2:m+1][i]; } } for(i=0;i<DICE;i++){ zorome[(de)?0:3][i]= cp[i]; } sum+=(unsigned long)zorome[de][0]; } int main(void){ int i,n; char ch[100]; do{ for(i=0;i<DICE;i++){ for(n=0;n<DICE;n++){ zorome[i][n]=shokiti[i][n]; } } sum=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",ch); if(strcmp(ch,"North")==0){ direction(0); }else if(strcmp(ch,"East")==0){ direction(1); }else if(strcmp(ch,"South")==0){ direction(2); }else if(strcmp(ch,"West")==0){ direction(3); }else if(strcmp(ch,"Right")==0){ rotation(3); }else if(strcmp(ch,"Left")==0){ rotation(0); } } if(n) printf("%lu\n",sum+1); }while(n); return 0; }
main.c:8:18: error: unknown type name 'constint' 8 | void direction(constint de){ | ^~~~~~~~ main.c: In function 'main': main.c:53:15: error: implicit declaration of function 'direction' [-Wimplicit-function-declaration] 53 | direction(0); | ^~~~~~~~~
s328543423
p00425
C
#include<stdio.h> #include<string.h> int main(void){ int n, b = 1, z1 = 2, z2 = 3, n1, n2, g = 1; char muki[10]; scanf_s("%d", &n); for (int i = 0; i<n; i++){ scanf_s("%s", muki,10); if (strcmp(muki , "North")==0){ n1 = z1; z1 = 7 - b; b = n1; } if (strcmp(muki, "East") == 0){ n1 = 7 - z2; z2 = b; b = n1; } if (strcmp(muki, "West") == 0){ n1 = z2; z2 = 7 - b; b = n1; } if (strcmp(muki, "South") == 0){ n1 = 7 - z1; z1 = b; b = n1; } if (strcmp(muki, "Right") == 0){ n2 = 7 - z1; z1 = z2; z2 = n2; } if (strcmp(muki, "Left") == 0){ n2 = z1; z1 = 7 - z2; z2 = n2; } g += b; } printf("%d", g); scanf_s("%d", &n1); return 0; }
main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s368727292
p00425
C
#include<stdio.h> #include<string.h> int main(void){ int i,n, b = 1, z1 = 2, z2 = 3, n1, n2, g = 1; char muki[10]; scanf_s("%d", &n); for (i = 0; i<n; i++){ scanf_s("%s", muki,10); if (strcmp(muki , "North")==0){ n1 = z1; z1 = 7 - b; b = n1; } if (strcmp(muki, "East") == 0){ n1 = 7 - z2; z2 = b; b = n1; } if (strcmp(muki, "West") == 0){ n1 = z2; z2 = 7 - b; b = n1; } if (strcmp(muki, "South") == 0){ n1 = 7 - z1; z1 = b; b = n1; } if (strcmp(muki, "Right") == 0){ n2 = 7 - z1; z1 = z2; z2 = n2; } if (strcmp(muki, "Left") == 0){ n2 = z1; z1 = 7 - z2; z2 = n2; } g += b; } printf("%d", g); scanf_s("%d", &n1); return 0; }
main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s905943612
p00425
C
#include <stdio.h> #include <string.h> int n, i; char mozi[6]; int me; int main(){ int sum, saikkoro1, ssaikoro2, saikoro3; while(1){ scanf("%d", &n); if(n==0){ break; } saikoro1 = 1; saikoro2 = 2; saikoro3 = 3; sum = saikoro1; for(i=0; i<n; i++){ scanf("%s",mozi); if(strcmp('North', mozi) == 0){ me = 7 -saikoro1; saikoro1 = saikoro2; saikoro2 = me; } if(strcmp('East', mozi) == 0){ me = 7 -saikoro1 saikoro3 = saikoro1; saikoro1 = me; } if(strcmp('West',mozi) == 0){ me = 7 - saikoro1; saikoro1 = saikoro3; saikoro3 = me; } if(strcmp('South',mozi) == 0){ me = 7 - saikoro2 saikoro2 = saikoro1; saikoro1 = me; } if(strcmp('Right',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro3; saikoro3 = me; } if(strcmp('Left', mozi) == 0){ me = 7 -saikoro3; saikoro3 = saikoro2; saikoro2 = me; } sum += siakoro1; } printf("%d\n", sum); } return 0; }
main.c: In function 'main': main.c:16:17: error: 'saikoro1' undeclared (first use in this function); did you mean 'saikoro3'? 16 | saikoro1 = 1; | ^~~~~~~~ | saikoro3 main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in main.c:17:17: error: 'saikoro2' undeclared (first use in this function); did you mean 'saikoro3'? 17 | saikoro2 = 2; | ^~~~~~~~ | saikoro3 main.c:22:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ main.c:22:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ | | | int In file included from main.c:2: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:27:35: warning: multi-character character constant [-Wmultichar] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ main.c:27:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:28:49: error: expected ';' before 'saikoro3' 28 | me = 7 -saikoro1 | ^ | ; 29 | saikoro3 = saikoro1; | ~~~~~~~~ main.c:32:35: warning: multi-character character constant [-Wmultichar] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ main.c:32:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:37:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ main.c:37:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:38:50: error: expected ';' before 'saikoro2' 38 | me = 7 - saikoro2 | ^ | ; 39 | saikoro2 = saikoro1; | ~~~~~~~~ main.c:42:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ main.c:42:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:47:35: warning: multi-character character constant [-Wmultichar] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ main.c:47:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:52:32: error: 'siakoro1' undeclared (first use in this function); did you mean 'saikoro3'? 52 | sum += siakoro1; | ^~~~~~~~ | saikoro3
s327452785
p00425
C
#include <stdio.h> #include <string.h> int n, i; char mozi[6]; int me; int main(){ int sum, saikkoro1, ssaikoro2, saikoro3; while(1){ scanf("%d", &n); if(n==0){ break; } saikoro1 = 1; saikoro2 = 2; saikoro3 = 3; sum = saikoro1; for(i=0; i<n; i++){ scanf("%s",mozi); if(strcmp('North', mozi) == 0){ me = 7 -saikoro1; saikoro1 = saikoro2; saikoro2 = me; } if(strcmp('East', mozi) == 0){ me = 7 -saikoro1; saikoro3 = saikoro1; saikoro1 = me; } if(strcmp('West',mozi) == 0){ me = 7 - saikoro1; saikoro1 = saikoro3; saikoro3 = me; } if(strcmp('South',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro1; saikoro1 = me; } if(strcmp('Right',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro3; saikoro3 = me; } if(strcmp('Left', mozi) == 0){ me = 7 -saikoro3; saikoro3 = saikoro2; saikoro2 = me; } sum += siakoro1; } printf("%d\n", sum); } return 0; }
main.c: In function 'main': main.c:16:17: error: 'saikoro1' undeclared (first use in this function); did you mean 'saikoro3'? 16 | saikoro1 = 1; | ^~~~~~~~ | saikoro3 main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in main.c:17:17: error: 'saikoro2' undeclared (first use in this function); did you mean 'saikoro3'? 17 | saikoro2 = 2; | ^~~~~~~~ | saikoro3 main.c:22:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ main.c:22:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ | | | int In file included from main.c:2: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:27:35: warning: multi-character character constant [-Wmultichar] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ main.c:27:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:32:35: warning: multi-character character constant [-Wmultichar] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ main.c:32:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:37:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ main.c:37:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:42:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ main.c:42:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:47:35: warning: multi-character character constant [-Wmultichar] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ main.c:47:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:52:32: error: 'siakoro1' undeclared (first use in this function); did you mean 'saikoro3'? 52 | sum += siakoro1; | ^~~~~~~~ | saikoro3
s686203747
p00425
C
#include <stdio.h> #include <string.h> int n, i; char mozi[6]; int me; int main(){ int sum, saikkoro1, saikoro2, saikoro3; while(1){ scanf("%d", &n); if(n==0){ break; } saikoro1 = 1; saikoro2 = 2; saikoro3 = 3; sum = saikoro1; for(i=0; i<n; i++){ scanf("%s",mozi); if(strcmp('North', mozi) == 0){ me = 7 -saikoro1; saikoro1 = saikoro2; saikoro2 = me; } if(strcmp('East', mozi) == 0){ me = 7 -saikoro1; saikoro3 = saikoro1; saikoro1 = me; } if(strcmp('West',mozi) == 0){ me = 7 - saikoro1; saikoro1 = saikoro3; saikoro3 = me; } if(strcmp('South',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro1; saikoro1 = me; } if(strcmp('Right',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro3; saikoro3 = me; } if(strcmp('Left', mozi) == 0){ me = 7 -saikoro3; saikoro3 = saikoro2; saikoro2 = me; } sum += siakoro1; } printf("%d\n", sum); } return 0; }
main.c: In function 'main': main.c:16:17: error: 'saikoro1' undeclared (first use in this function); did you mean 'saikoro3'? 16 | saikoro1 = 1; | ^~~~~~~~ | saikoro3 main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in main.c:22:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ main.c:22:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ | | | int In file included from main.c:2: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:27:35: warning: multi-character character constant [-Wmultichar] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ main.c:27:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:32:35: warning: multi-character character constant [-Wmultichar] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ main.c:32:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:37:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ main.c:37:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:42:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ main.c:42:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:47:35: warning: multi-character character constant [-Wmultichar] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ main.c:47:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:52:32: error: 'siakoro1' undeclared (first use in this function); did you mean 'saikoro3'? 52 | sum += siakoro1; | ^~~~~~~~ | saikoro3
s676256682
p00425
C
#include <stdio.h> #include <string.h> int n, i; char mozi[6]; int me; int main(){ int sum, saikoro1, saikoro2, saikoro3; while(1){ scanf("%d", &n); if(n==0){ break; } saikoro1 = 1; saikoro2 = 2; saikoro3 = 3; sum = saikoro1; for(i=0; i<n; i++){ scanf("%s",mozi); if(strcmp('North', mozi) == 0){ me = 7 -saikoro1; saikoro1 = saikoro2; saikoro2 = me; } if(strcmp('East', mozi) == 0){ me = 7 -saikoro1; saikoro3 = saikoro1; saikoro1 = me; } if(strcmp('West',mozi) == 0){ me = 7 - saikoro1; saikoro1 = saikoro3; saikoro3 = me; } if(strcmp('South',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro1; saikoro1 = me; } if(strcmp('Right',mozi) == 0){ me = 7 - saikoro2; saikoro2 = saikoro3; saikoro3 = me; } if(strcmp('Left', mozi) == 0){ me = 7 -saikoro3; saikoro3 = saikoro2; saikoro2 = me; } sum += siakoro1; } printf("%d\n", sum); } return 0; }
main.c: In function 'main': main.c:22:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ main.c:22:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp('North', mozi) == 0){ | ^~~~~~~ | | | int In file included from main.c:2: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:27:35: warning: multi-character character constant [-Wmultichar] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ main.c:27:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 27 | if(strcmp('East', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:32:35: warning: multi-character character constant [-Wmultichar] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ main.c:32:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 32 | if(strcmp('West',mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:37:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ main.c:37:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 37 | if(strcmp('South',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:42:35: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ main.c:42:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 42 | if(strcmp('Right',mozi) == 0){ | ^~~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:47:35: warning: multi-character character constant [-Wmultichar] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ main.c:47:35: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 47 | if(strcmp('Left', mozi) == 0){ | ^~~~~~ | | | int /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:52:32: error: 'siakoro1' undeclared (first use in this function); did you mean 'saikoro1'? 52 | sum += siakoro1; | ^~~~~~~~ | saikoro1 main.c:52:32: note: each undeclared identifier is reported only once for each function it appears in
s803644089
p00425
C
#include<stdio.h> int t,r; char s[6]; void f(n){ int d[5]={1,3,4,2,5}; int i; for(i=0;i<n;i++){ scanf("%s",s); switch(s[0]){ case 'N':d[0]=d[3];d[3]=7-d[0];d[4]=7-d[3];break; case 'S':d[3]=d[0];d[0]=d[4];d[4]=7-d[3];break; case 'E':d[1]=d[0];d[0]=d[2];d[2]=7-d[1];break; ????????????????case 'W':d[2]=d[0];d[0]=d[1];d[1]=7-d[2];break; ????????????????case 'R':t=d[3];d[3]=d[1];d[1]=d[4];d[4]=d[2];d[2]=t;break; ????????????????case 'L':t=d[4];d[4]=d[1];d[1]=d[3];d[3]=d[2];d[2]=t;break; } } printf("%d\n",d[0]); } int main(){ int n; scanf("%d,&n"); f(n); return 0; }
main.c: In function 'f': main.c:4:6: error: type of 'n' defaults to 'int' [-Wimplicit-int] 4 | void f(n){ | ^ main.c:13:1: error: expected expression before '?' token 13 | ????????????????case 'W':d[2]=d[0];d[0]=d[1];d[1]=7-d[2];break; | ^ main.c:14:1: error: expected expression before '?' token 14 | ????????????????case 'R':t=d[3];d[3]=d[1];d[1]=d[4];d[4]=d[2];d[2]=t;break; | ^ main.c:15:1: error: expected expression before '?' token 15 | ????????????????case 'L':t=d[4];d[4]=d[1];d[1]=d[3];d[3]=d[2];d[2]=t;break; | ^
s579012497
p00425
C
#define s(a,b) (t=a,a=b,b=t) char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}}
main.c:2:13: warning: data definition has no type or storage class 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:13: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int] main.c:2:15: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:17: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:19: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:21: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:23: error: type defaults to 'int' in declaration of 'e' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:25: error: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:27: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:29: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^ main.c:2:31: error: return type defaults to 'int' [-Wimplicit-int] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^~~~ main.c: In function 'main': main.c:2:31: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:2:47: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^~~~ main.c:2:52: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^~~~ main.c:2:262: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | #define s(a,b) (t=a,a=b,b=t) main.c:2:262: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 2 | char p[9],m;q,a,b,c,d,e,f,t,r;main(n){while(n=atoi(gets(p))){r=a=1,b=6,c=2,d=5,e=3,f=4;while(n--){gets(p);m=*p-70;if(m%6==0){s(c,e);s(d,f);q=m^6?s(e,f):s(c,d);}else if(7<m&&m<14){s(a,c);s(b,d);q=m^13?s(c,d):s(a,b);}else{s(a,e);s(b,f);q=m>0?s(e,f):s(a,b);}r+=a;}printf("%d\n",r);}} | ^~~~~~ main.c:2:262: note: include '<stdio.h>' or provide a declaration of 'printf'
s632070496
p00425
C
#include<stdio.h> int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r; char s[99]; int main(){ for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); }
main.c: In function 'main': main.c:5:45: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 5 | for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); | ^~~~ | fgets main.c:5:134: error: lvalue required as left operand of assignment 5 | for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); | ^~
s915652046
p00425
C
#include<stdio.h> int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r; char s[99]; int main(){ for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); }
main.c: In function 'main': main.c:5:45: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 5 | for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); | ^~~~ | fgets main.c:5:134: error: lvalue required as left operand of assignment 5 | for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); | ^~
s731159964
p00425
C
#include<stdio.h> int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r; char s[99]; int main(){ s[87]=1,s[78]=4,s[69]=3,s[83]=2; for( ;gets(s); *s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); }
main.c: In function 'main': main.c:7:2: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | ;gets(s); | ^~~~ | fgets main.c:8:82: error: lvalue required as left operand of assignment 8 | *s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); | ^~
s292878794
p00425
C
#include<stdio.h> int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r; char s[99]; int main(){ s[87]=1,s[78]=4,s[69]=3,s[83]=2; for( ;gets(s); *s<60?printf(r?"%d\n":0,r), a=c=0,b=r=1: (d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); }
main.c: In function 'main': main.c:7:2: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | ;gets(s); | ^~~~ | fgets main.c:10:43: error: lvalue required as left operand of assignment 10 | (d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)); | ^~
s178640769
p00425
C
int N[]={ 6,10,18,14, 2,13,22,11, 3, 5,21,19, 1,17,23, 7, 0, 9,20,15, 4,12,16, 8}; int E[]={15, 7,11,19, 8, 3,14,23, 16, 0, 6,22, 4, 2,18,20, 12, 1,10,21, 9, 5,13,17}; int W[]={ 9,17,13, 5, 12,21,10, 1, 4,20,18, 2, 16,22, 6, 0, 8,23,14, 3, 15,19,11, 7}; int S[]={16,12, 4, 8, 20, 9, 0,15, 23,17, 1, 7, 21, 5, 3,19, 22,13, 2,11, 18,10, 6,14}; int R[]={ 1, 2, 3, 0, 5, 6, 7, 4, 9,10,11, 8, 13,14,15,12, 17,18,19,16, 21,22,23,20}; int L[]={ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9,10, 15,12,13,14, 19,16,17,18, 23,20,21,22}; n,a,d; char s[9]; int main() { for(;;) { scanf("%d",&n); if(!n) break; a=1; d=0; for(;n--;) { scanf("%s",s); *s-78||d=N[d]; *s-69||d=E[d]; *s-87||d=W[d]; *s-83||d=S[d]; *s-82||d=R[d]; *s-76||d=L[d]; a+=d/4+1; } printf("%d\n",a); } }
main.c:7:1: warning: data definition has no type or storage class 7 | n,a,d; | ^ main.c:7:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:7:3: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 7 | n,a,d; | ^ main.c:7:5: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 7 | n,a,d; | ^ main.c: In function 'main': main.c:13:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 13 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int N[]={ 6,10,18,14, 2,13,22,11, 3, 5,21,19, 1,17,23, 7, 0, 9,20,15, 4,12,16, 8}; main.c:13:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 13 | scanf("%d",&n); | ^~~~~ main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:21:9: error: lvalue required as left operand of assignment 21 | *s-78||d=N[d]; | ^ main.c:22:9: error: lvalue required as left operand of assignment 22 | *s-69||d=E[d]; | ^ main.c:23:9: error: lvalue required as left operand of assignment 23 | *s-87||d=W[d]; | ^ main.c:24:9: error: lvalue required as left operand of assignment 24 | *s-83||d=S[d]; | ^ main.c:25:9: error: lvalue required as left operand of assignment 25 | *s-82||d=R[d]; | ^ main.c:26:9: error: lvalue required as left operand of assignment 26 | *s-76||d=L[d]; | ^ main.c:29:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 29 | printf("%d\n",a); | ^~~~~~ main.c:29:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:29:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:29:1: note: include '<stdio.h>' or provide a declaration of 'printf'
s046161533
p00425
C
int N[]={ 6,10,18,14, 2,13,22,11, 3, 5,21,19, 1,17,23, 7, 0, 9,20,15, 4,12,16, 8}; int E[]={15, 7,11,19, 8, 3,14,23, 16, 0, 6,22, 4, 2,18,20, 12, 1,10,21, 9, 5,13,17}; int W[]={ 9,17,13, 5, 12,21,10, 1, 4,20,18, 2, 16,22, 6, 0, 8,23,14, 3, 15,19,11, 7}; int S[]={16,12, 4, 8, 20, 9, 0,15, 23,17, 1, 7, 21, 5, 3,19, 22,13, 2,11, 18,10, 6,14}; n,d,a; char s[9]; main(c) { for(;gets(s);) { c=*s; c<60&&a?printf("%d\n",a),a=0:0; d= (c-78?0:N[d])+ (c-69?0:E[d])+ (c-87?0:W[d])+ (c-83?0:S[d])+ (c-82?0:d&28|d%4+1&3)+ (c-76?0:d&28|d%4-1&3); a+=d/4+1; } }
main.c:5:1: warning: data definition has no type or storage class 5 | n,d,a; | ^ main.c:5:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:5:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 5 | n,d,a; | ^ main.c:5:5: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 5 | n,d,a; | ^ main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int] 7 | main(c) | ^~~~ main.c: In function 'main': main.c:7:1: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:9:6: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 9 | for(;gets(s);) | ^~~~ main.c:12:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | c<60&&a?printf("%d\n",a),a=0:0; | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | int N[]={ 6,10,18,14, 2,13,22,11, 3, 5,21,19, 1,17,23, 7, 0, 9,20,15, 4,12,16, 8}; main.c:12:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 12 | c<60&&a?printf("%d\n",a),a=0:0; | ^~~~~~ main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s348767426
p00425
C
printf("77\n174\n86\n331\n17405\n");
main.c:1:8: error: expected declaration specifiers or '...' before string constant 1 | printf("77\n174\n86\n331\n17405\n"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
s323099208
p00425
C
main(n,char*s){for(;scanf("%s",s),*s>48;);puts("aaa");}
main.c:1:8: error: expected ')' before 'char' 1 | main(n,char*s){for(;scanf("%s",s),*s>48;);puts("aaa");} | ^~~~ | )
s450447382
p00425
C
main(n,char*s){for(;scanf("%s",s),*s>48;);puts("aaa");}
main.c:1:8: error: expected ')' before 'char' 1 | main(n,char*s){for(;scanf("%s",s),*s>48;);puts("aaa");} | ^~~~ | )
s147020209
p00425
C
m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);}
main.c:1:1: warning: data definition has no type or storage class 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] main.c:1:34: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^ main.c:1:36: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^ main.c:1:38: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^ main.c:1:40: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^ main.c:1:42: error: return type defaults to 'int' [-Wimplicit-int] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^~~~ main.c: In function 'main': main.c:1:42: error: type of 'd' defaults to 'int' [-Wimplicit-int] main.c:1:65: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} main.c:1:65: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^~~~~ main.c:1:65: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:123: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | m[]={2189,89,1232,866,1796,2603},a,b,c,r;main(d){for(char s[9];~scanf("%s",s);r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1)*s<65?printf(r?"%d\n":0,r),a=c=r=0,b=1:*s%6-4?d=(*s-78?*s%5-1:0)+c&3,a=m[a]>>3*d&7,b=m[b]>>3*d&7:(c+=*s+3);} | ^~~~~~ main.c:1:123: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:123: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:123: note: include '<stdio.h>' or provide a declaration of 'printf'
s002950284
p00425
C
v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}}
main.c:1:1: warning: data definition has no type or storage class 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'v' [-Wimplicit-int] main.c:1:55: error: return type defaults to 'int' [-Wimplicit-int] 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} | ^~~~ main.c: In function 'main': main.c:1:55: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:55: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:1:55: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:55: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:55: error: type of 's' defaults to 'int' [-Wimplicit-int] main.c:1:77: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} main.c:1:77: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} | ^~~~~ main.c:1:77: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:132: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} | ^~~~ main.c:1:259: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | v[]={0,4,2,5,0,5,2,4,0,3,2,1,0,1,2,3,4,3,5,1,1,5,3,4};main(n,c,i,j,s){while(scanf("%d ",&n)&&n){int d[]={1,3,6,4,2,5};for(s=1;n--&&gets(&c);){c&=255;i=c-78?c-83?c-69?c-87?c-76?20:16:12:8:4:0;c=d[v[i]];for(j=0;j<3;++j)d[v[i+j]]=d[v[i+j+1]];d[v[i+3]]=c;s+=*d;}printf("%d\n",s);}} | ^~~~~~ main.c:1:259: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:259: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:259: note: include '<stdio.h>' or provide a declaration of 'printf'
s399483170
p00425
C
a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^ main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^~~~ main.c: In function 'main': main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:83: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^~~~ main.c:1:244: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | ^~~~~~ main.c:1:244: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:244: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:244: note: include '<stdio.h>' or provide a declaration of 'printf'
s078061870
p00425
C
a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d;
main.c:1:1: warning: data definition has no type or storage class 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:6: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^ main.c:1:11: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^ main.c:1:82: error: return type defaults to 'int' [-Wimplicit-int] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^~~~ main.c: In function 'main': main.c:1:82: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:1:101: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; main.c:1:101: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^~~~~ main.c:1:101: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:137: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^~~~~~ main.c:1:137: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:137: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:137: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:1: error: expected declaration or statement at end of input 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,c==82?d=d&28|d%4+1&3:d,c==76?d=d&28|d%4+3&3:d; | ^
s739255143
p00425
C
a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);}
main.c:1:1: warning: data definition has no type or storage class 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:6: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^ main.c:1:11: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^ main.c:1:82: error: return type defaults to 'int' [-Wimplicit-int] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^~~~ main.c: In function 'main': main.c:1:82: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:1:101: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} main.c:1:101: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^~~~~ main.c:1:101: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:137: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^~~~~~ main.c:1:137: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:137: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:137: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:280: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 1 | a=-1,A=65,d;char*N="GKSOCNWLDFVTBRXHAJUPEMQI",*E="PHLTIDOXQAGWECSUMBKVJFNR",s[9];main(c){for(;c-48&&scanf("%s",s);a+=d/4+1)(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0,d=(c==78?d=N[d]:c==69?d=E[d]:c==83?d=N[N[N[d]-A]-A]:c==87?d=E[E[E[d]-A]-A]:d+A)-A,d=c==82|c==76?d&28|d%4+3-c/80*2&3:d;gets(s);} | ^~~~
s472293513
p00425
C
N[]={ 6, 14, 18, 10, 2, 9, 22, 15, 1, 17, 23, 7, 3, 5, 21, 19, 0, 13, 20, 11, 4, 8, 16, 12}; E[]={13, 17, 9, 5, 8, 21, 14, 1, 16, 22, 6, 0, 4, 20, 18, 2, 12, 23, 10, 3, 11, 19, 15, 7}; R[]={ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 14, 19, 16, 17, 18, 23, 20, 21, 22}; a; d; T,F,R; char s[9]; main(c) { for(;c-48&&scanf("%s",s);a+=d/4+1) { c=*s; if(c<60)a&&printf("%d\n",a),a=d=0,T=1,F=2,R=3; if(c==78)d=N[d]; if(c==83)d=N[N[N[d]]]; if(c==69)d=E[d]; if(c==87)d=E[E[E[d]]]; if(c==82)d=R[d]; if(c==76)d=R[R[R[d]]]; } }
main.c:1:1: warning: data definition has no type or storage class 1 | N[]={ 6, 14, 18, 10, 2, 9, 22, 15, 1, 17, 23, 7, 3, 5, 21, 19, 0, 13, 20, 11, 4, 8, 16, 12}; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] main.c:2:1: warning: data definition has no type or storage class 2 | E[]={13, 17, 9, 5, 8, 21, 14, 1, 16, 22, 6, 0, 4, 20, 18, 2, 12, 23, 10, 3, 11, 19, 15, 7}; | ^ main.c:2:1: error: type defaults to 'int' in declaration of 'E' [-Wimplicit-int] main.c:3:1: warning: data definition has no type or storage class 3 | R[]={ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 14, 19, 16, 17, 18, 23, 20, 21, 22}; | ^ main.c:3:1: error: type defaults to 'int' in declaration of 'R' [-Wimplicit-int] main.c:4:1: warning: data definition has no type or storage class 4 | a; | ^ main.c:4:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:5:1: warning: data definition has no type or storage class 5 | d; | ^ main.c:5:1: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] main.c:6:1: warning: data definition has no type or storage class 6 | T,F,R; | ^ main.c:6:1: error: type defaults to 'int' in declaration of 'T' [-Wimplicit-int] main.c:6:3: error: type defaults to 'int' in declaration of 'F' [-Wimplicit-int] 6 | T,F,R; | ^ main.c:6:5: error: type defaults to 'int' in declaration of 'R' [-Wimplicit-int] 6 | T,F,R; | ^ main.c:6:5: error: conflicting types for 'R'; have 'int' main.c:3:1: note: previous definition of 'R' with type 'int[24]' 3 | R[]={ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 14, 19, 16, 17, 18, 23, 20, 21, 22}; | ^ main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int] 8 | main(c) | ^~~~ main.c: In function 'main': main.c:8:1: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:10:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | for(;c-48&&scanf("%s",s);a+=d/4+1) | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | N[]={ 6, 14, 18, 10, 2, 9, 22, 15, 1, 17, 23, 7, 3, 5, 21, 19, 0, 13, 20, 11, 4, 8, 16, 12}; main.c:10:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | for(;c-48&&scanf("%s",s);a+=d/4+1) | ^~~~~ main.c:10:20: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:28: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | if(c<60)a&&printf("%d\n",a),a=d=0,T=1,F=2,R=3; | ^~~~~~ main.c:13:28: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:28: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:13:28: note: include '<stdio.h>' or provide a declaration of 'printf'
s195537723
p00425
C
int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7;
main.c: In function 'main': main.c:1:51: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7; | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7; main.c:1:51: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7; | ^~~~~ main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:119: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7; | ^~~~~~ main.c:1:119: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:119: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:119: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:1: error: expected declaration or statement at end of input 1 | int D,d,c,a,X=448;char s[9];int main(){for(;c+21&&scanf("%s",s);a+=D/64)c=*s-69,d=511-D,D=c-9?c-14?c?c-18?c-13?c-7?a&&printf("%d\n",a),a=0,83:D&X|d*8&56|D/8&7:D&X|D*8&56|d/8&7:D*64&X|D&56|d/64:d*64&X|D&56|D/64:d*8&X|D/8&56|D&7:D*8&X|d/8&56|D&7; | ^~~
s695328602
p00425
C
#include<stdio.h> int main(){ int north,east,west,south,cen,n,sum,b; char str[6]; sum=1; scanf("%d",&n); north=5; cen=1; south=2; west=4; east=3; for(i=0;i<n;i++){ scanf("%s",str); if(str[0]=='N'){ north=cen; cen=south; south=7-north; }else if(str[0]=='E'){ east=cen; cen=west; west=7-east; }else if(str[0]=='W'){ west=cen; cen=east; east=7-west; }else if(str[0]=='S'){ south=cen; cen=north; north=7-south; }else if(str[0]=='R'){ b=south; south=east; east=north; north=west; west=b; }else{ b=east; east=south; south=west; west=north; north=b; } sum+=cen; } printf("%d\n",sum); return 0; }
main.c: In function 'main': main.c:13:7: error: 'i' undeclared (first use in this function) 13 | for(i=0;i<n;i++){ | ^ main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
s650303496
p00425
C
#include<stdio.h> #include<string.h> int main(void){ int top=1,bottom=6,east=3,west=4,south=2,north=5; int top_=1,bottom_=6,east_=4,west_=3,south_=2,north_=5; int n, sum=1; char act[256]; while(1){ scanf("%d",&n); if(n!=0){ while(n>=0){ gets(act); if(!strcmp(act,"North")){ top = south; bottom = north; south = bottom_; north = top_; bottom_ = bottom; top_ = top; sum += top; }else if(!strcmp(act,"South")){ top = north; bottom = south; south = top_; north = bottom_; top_ = top; bottom_ = bottom; sum += top; }else if(!strcmp(act,"West")){ top = east; bottom = west; west = top_; east = bottom_; top_ = top; bottom = bottom_; sum += top; }else if(!strcmp(act,"East")){ top = west; bottom = east; west = bottom_; east = top_; top_ = top; bottom = bottom; sum += top; }else if(!strcmp(act,"Right")){ west = north; east = south; south = west_; north = east_; west_ = west; east_ = east; sum += top; }else if(!strcmp(act,"Left")){ west = south; east = north; south = east_; north = west_; west_ = west; east_ = east; sum += top; } n--; } printf("%d\n",sum); sum = 1; }else{ break; } } return 0; }
main.c: In function 'main': main.c:14:33: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 14 | gets(act); | ^~~~ | fgets
s861768344
p00425
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(void){ int top=1,bottom=6,east=3,west=4,south=2,north=5; int top_=1,bottom_=6,east_=4,west_=3,south_=2,north_=5; int n, sum=1; char act[256]; while(1){ scanf("%d",&n); if(n!=0){ while(n>=0){ gets(act); if(!strcmp(act,"North")){ top = south; bottom = north; south = bottom_; north = top_; bottom_ = bottom; top_ = top; sum += top; }else if(!strcmp(act,"South")){ top = north; bottom = south; south = top_; north = bottom_; top_ = top; bottom_ = bottom; sum += top; }else if(!strcmp(act,"West")){ top = east; bottom = west; west = top_; east = bottom_; top_ = top; bottom = bottom_; sum += top; }else if(!strcmp(act,"East")){ top = west; bottom = east; west = bottom_; east = top_; top_ = top; bottom = bottom; sum += top; }else if(!strcmp(act,"Right")){ west = north; east = south; south = west_; north = east_; west_ = west; east_ = east; sum += top; }else if(!strcmp(act,"Left")){ west = south; east = north; south = east_; north = west_; west_ = west; east_ = east; sum += top; } n--; } printf("%d\n",sum); sum = 1; }else{ break; } } return 0; }
main.c: In function 'main': main.c:15:33: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 15 | gets(act); | ^~~~ | fgets
s146756902
p00425
C
#include <stdio.h> typedef struct { int up; int left; int right; int front; int back; int down; } dice_t; void init(dice_t* dice) { dice->up=1; dice->left=4; dice->right=3; dice->front=2; dice->back=5; dice->down=6; } void North(dice_t* dice) { int temp; temp=dice->up; dice->up=dice->front; dice->front=dice->down; dice->down=dice->back; dice->back=temp; } void East(dice_t* dice) { int temp; temp=dice->up; dice->up=dice->left; dice->left=dice->down; dice->down=dice->right; dice->right=temp; } void West(dice_t* dice) { int temp; temp=dice->up; dice->up=dice->right; dice->right=dice->down; dice->down=dice->left; dice->left=temp; } void South(dice_t* dice) { int temp; temp=dice->up; dice->up=dice->back; dice->back=dice->down; dice->down=dice->front; dice->front=temp; } void Right(dice_t* dice) { int temp; temp=dice->front; dice->front=dice->right; dice->right=dice->back; dice->back=dice->left; dice->left=temp; } void Left(dice_t* dice) { int temp; temp=dice->front; dice->front=dice->left; dice->left=dice->back; dice->back=dice->right; dice->right=temp; } int main(void) { char sizi[10]; int i,n; int sum; dice_t dice; while(1) { scanf("%d",&n); if(n==0)break; init(&dice); sum=1; for(i=0;i<n;i++) { scanf("%s",sizi); switch(size[0]) { case 'N': North(&dice); break; case 'E': East(&dice); break; case 'W': West(&dice); break; case 'S': South(&dice); break; case 'R': Right(&dice); break; case 'L': Left(&dice); break; } sum+=dice.up; } printf("%d\n",sum); } return 0; }
main.c: In function 'main': main.c:87:32: error: 'size' undeclared (first use in this function); did you mean 'sizi'? 87 | switch(size[0]) { | ^~~~ | sizi main.c:87:32: note: each undeclared identifier is reported only once for each function it appears in
s888952072
p00425
C
#include <stdio.h> #include <string.h> void no(int *x,int *y,int *z,int *s){ int n=*x; *x=*y; *y=7-n; *s+=*x; } void ea(int *x,int *y,int *z,int *s){ int n=*x; *x=7-*z; *z=n; *s+=*x; return; } void we(int *x,int *y,int *z,int *s){ int n=*x; *x=*z; *z=7-n; *s+=*x; return; } void so(int *x,int *y,int *z,int *s){ int n=*y; *y=*x; *x=7-n; *s+=*x; return; } void ri(int *x,int *y,int *z,int *s){ int n=*y; *y=*z; *z=7-n; *s+=*x; return; } void le(int *x,int *y,int *z,int *s){ int n=*z; *z=*y; *y=7-n; *z=n; *s+=*x; return; } int main(){ int n,i,j=0,sum,a1,a2,a3,num[1000]; sum=1;a1=1;a2=2;a3=3; char c[6]; for(;;j++){ scanf("%d",&n); if(n==0) break; while(n>0){ A: scanf("%s",c); if(strcmp(c,"North")==0){ no(&a1,&a2,&a3,&sum); }else if(strcmp(c,"East")==0){ ea(&a1,&a2,&a3,&sum); }else if(strcmp(c,"West")==0){ we(&a1,&a2,&a3,&sum); }else if(strcmp(c,"South")==0){ so(&a1,&a2,&a3,&sum); }else if(strcmp(c,"Right")==0){ ri(&a1,&a2,&a3,&sum); }else if(strcmp(c,"Left")==0){ le(&a1,&a2,&a3,&sum); }else{ printf("error!"); goto A; } n--; } num[j]=sum; sum=1;a1=1;a2=2;a3=3; c[0]='\0'; } for(i=0;i<j;i++){ printf("%d\n",num[i]); }      return 0; }
main.c: In function 'main': main.c:82:1: error: stray '\343' in program 82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:82:3: error: stray '\343' in program 82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:82:5: error: stray '\343' in program 82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:82:7: error: stray '\343' in program 82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:82:9: error: stray '\343' in program 82 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~
s219028112
p00425
C
#include <stdio.h> #include <stdlib.h> #include <string.h> void no(int *x,int *y,int *z,int *s){ int n=*x; *x=*y; *y=7-n; *s+=*x; } void ea(int *x,int *y,int *z,int *s){ int n=*x; *x=7-*z; *z=n; *s+=*x; return; } void we(int *x,int *y,int *z,int *s){ int n=*x; *x=*z; *z=7-n; *s+=*x; return; } void so(int *x,int *y,int *z,int *s){ int n=*y; *y=*x; *x=7-n; *s+=*x; return; } void ri(int *x,int *y,int *z,int *s){ int n=*y; *y=*z; *z=7-n; *s+=*x; return; } void le(int *x,int *y,int *z,int *s){ int n=*z; *z=*y; *y=7-n; *z=n; *s+=*x; return; } int main(){ int n,i,j=0,sum,a1,a2,a3,num[1000]; sum=1;a1=1;a2=2;a3=3; char c[6]; for(;;j++){ scanf("%d",&n); if(n==0) break; while(n>0){ A: scanf("%s",c); if(strcmp(c,"North")==0){ no(&a1,&a2,&a3,&sum); }else if(strcmp(c,"East")==0){ ea(&a1,&a2,&a3,&sum); }else if(strcmp(c,"West")==0){ we(&a1,&a2,&a3,&sum); }else if(strcmp(c,"South")==0){ so(&a1,&a2,&a3,&sum); }else if(strcmp(c,"Right")==0){ ri(&a1,&a2,&a3,&sum); }else if(strcmp(c,"Left")==0){ le(&a1,&a2,&a3,&sum); }else{ printf("error!"); goto A; } n--; } num[j]=sum; sum=1;a1=1;a2=2;a3=3; c[0]='\0'; } for(i=0;i<j;i++){ printf("%d\n",num[i]); }      return 0; }
main.c: In function 'main': main.c:83:1: error: stray '\343' in program 83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:83:3: error: stray '\343' in program 83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:83:5: error: stray '\343' in program 83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:83:7: error: stray '\343' in program 83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~ main.c:83:9: error: stray '\343' in program 83 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0; | ^~~~~~~~
s601431189
p00425
C
scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ sum +=saikoro1; scanf("%s",mozi); if(strcmp("North",mozi)==0){ me = 7 - saikoro1; saikoro1 = saikoro2; saikoro2 = me; } if(strcmp("East",mozi)==0){ me = 7-saikoro3; saikoro3 = saikoro1; saikoro1 = me; } if(strcmp("West",mozi)==0){ me = 7-saikoro1; saikoro1 = saikoro3; saikoro3 = me; } if(strcmp("South",mozi)==0){ me = 7-saikoro2; saikoro2 = saikoro1; saikoro1 = me; } if(strcmp("Right",mozi)==0){ me = 7-saikoro2; saikoro2 = saikoro3; saikoro3 = me; } if(strcmp("Left",mozi)==0){ me = 7 - saikoro3; saikoro3 = saikoro2; saikoro2 = me; } } printf("%d\n",sum); } return 0; }
main.c:1:15: error: expected declaration specifiers or '...' before string constant 1 | scanf("%d",&n); | ^~~~ main.c:1:20: error: expected declaration specifiers or '...' before '&' token 1 | scanf("%d",&n); | ^ main.c:2:9: error: expected identifier or '(' before 'if' 2 | if(n==0)break; | ^~ main.c:3:9: error: expected identifier or '(' before 'for' 3 | for(i=0;i<n;i++){ | ^~~ main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 3 | for(i=0;i<n;i++){ | ^ main.c:3:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 3 | for(i=0;i<n;i++){ | ^~ main.c:39:16: error: expected declaration specifiers or '...' before string constant 39 | printf("%d\n",sum); | ^~~~~~ main.c:39:23: error: unknown type name 'sum' 39 | printf("%d\n",sum); | ^~~ main.c:40:1: error: expected identifier or '(' before '}' token 40 | } | ^ main.c:41:1: error: expected identifier or '(' before 'return' 41 | return 0; | ^~~~~~ main.c:42:1: error: expected identifier or '(' before '}' token 42 | } | ^
s082995523
p00425
C
#include <stdio.h> #include <string.h> enum { UP, FRONT, RIGHT, DOWN, BACK, LEFT, }; int _tmain(int argc, _TCHAR* argv[]) { int dice[6] = {1, 2, 3, 6, 5, 4}; int cnt = 0, times, sum = dice[UP]; printf("回数 => "); scanf("%d", &times); do{ char input[20] = ""; printf("命令 => "); scanf("%s", input); int keep; if(strcmp(input, "North") == 0){ keep = dice[UP]; dice[UP] = dice[FRONT]; dice[FRONT] = dice[DOWN]; dice[DOWN] = dice[BACK]; dice[BACK] = keep; sum += dice[UP]; cnt++; } else if(strcmp(input, "East") == 0){ keep = dice[UP]; dice[UP] = dice[LEFT]; dice[LEFT] = dice[DOWN]; dice[DOWN] = dice[RIGHT]; dice[RIGHT] = keep; sum += dice[UP]; cnt++; } else if(strcmp(input, "West") == 0){ keep = dice[UP]; dice[UP] = dice[RIGHT]; dice[RIGHT] = dice[DOWN]; dice[DOWN] = dice[LEFT]; dice[LEFT] = dice[UP]; sum += dice[UP]; cnt++; } else if(strcmp(input, "South") == 0){ keep = dice[UP]; dice[UP] = dice[BACK]; dice[BACK] = dice[DOWN]; dice[DOWN] = dice[FRONT]; dice[FRONT] = dice[UP]; sum += dice[UP]; cnt++; } else if(strcmp(input, "Right") == 0){ keep = dice[FRONT]; dice[FRONT] = dice[RIGHT]; dice[RIGHT] = dice[BACK]; dice[BACK] = dice[LEFT]; dice[LEFT] = keep; sum += dice[UP]; cnt++; } else if(strcmp(input, "Left") == 0){ keep = dice[FRONT]; dice[FRONT] = dice[LEFT]; dice[LEFT] = dice[BACK]; dice[BACK] = dice[RIGHT]; dice[RIGHT] = keep; sum += dice[UP]; cnt++; } else{ printf("入力ミスがあります。もう一度入力してください。\n"); continue; } }while(cnt != times); printf("合計 => %d\n", sum); return 0; }
main.c:13:22: error: unknown type name '_TCHAR' 13 | int _tmain(int argc, _TCHAR* argv[]) | ^~~~~~
s236853235
p00425
C++
#include <iostream> using namespace std; int main(){ string h; int a; while(cin >> a,a){ int sum = 1,top = 1,dice[4] = {2,3,4,5}; for(int i = 0 ; i < a ; i++){ cin >> h; int tmp = top; if( i == 0 ) top = 1; if(h == "North"){ top = dice[0]; dice[0] = 7 - tmp; dice[3] = tmp; } else if(h == "East"){ top = dice[2]; dice[2] = 7 - tmp; dice[1] = tmp; } else if(h == "West"){ top = dice[1]; dice[1] = 7 - tmp; dice[2] = tmp; } else if(h == "South"){ top = dice[3]; dice[3] = 7 - tmp; dice[0] = tmp; } else if(h == "Right"){ tmp = dice[3]; dice[3] = dice[2]; dice[2] = dice[0]; dice[0] = dice[1]; dice[1] = tmp; } else{ tmp = dice[3]; dice[3] = dice[1]; dice[1] = dice[0]; dice[0] = dice[2]; dice[2] = tmp; } sum += top; } cout << sum << endl; } return 0; } Compile Error Logs: Status Judge: 1/1 C++ CPU: 00:00 sec Memory: 1208 KB Length: 905 B 2014-07-11 12:39 Results for testcases Case # Verdict CPU Time Memory In Out Case Name Case #1 : Accepted 00:00 1208 28563 20 judge_data < prev | / | next > Judge Input # ( | ) Judge Output # ( | )
a.cc:67:6: error: stray '#' in program 67 | Case # Verdict CPU Time Memory In Out Case Name | ^ a.cc:69:6: error: stray '#' in program 69 | Case #1 : Accepted 00:00 1208 28563 20 judge_data | ^ a.cc:77:13: error: stray '#' in program 77 | Judge Input # ( | ) Judge Output # ( | ) | ^ a.cc:77:37: error: stray '#' in program 77 | Judge Input # ( | ) Judge Output # ( | ) | ^ a.cc:60:1: error: 'Compile' does not name a type 60 | Compile Error Logs: | ^~~~~~~
s876739972
p00425
C++
#include <iostream> using namespace std; int main(){ int a[3]={1,2,3}; int n,i,temp,out; char b[6]; while(cin>>n){ if(n==0){break;} a[3]={1,2,3}; out=1; for(i=0;i<n;i++){ cin>>b; if(b[0]=='N'){ temp=a[0]; a[0]=a[1]; a[1]=7-temp; out+=a[0]; }else if(b[0]=='E'){ temp=a[2]; a[2]=a[0]; a[0]=7-temp; out+=a[0]; }else if(b[0]=='W'){ temp=a[0]; a[0]=a[2]; a[2]=7-temp; out+=a[0]; }else if(b[0]=='S'){ temp=a[1]; a[1]=a[0]; a[0]=7-temp; out+=a[0]; }else if(b[0]=='R'){ temp=a[1]; a[1]=a[2]; a[2]=7-temp; out+=a[0]; }else if(b[0]=='L'){ temp=a[2]; a[2]=a[1]; a[1]=7-temp; out+=a[0]; } } cout<<out<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:28: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment 9 | a[3]={1,2,3}; | ^
s938186737
p00425
C++
#include<cstdio> #include<string> #include<iostream> using namespace std; int main(){ while (1){ int u = 1, d = 6, e = 3, w = 4, n = 5, s = 2; int ans = 1; int N; scanf_s("%d", &N); if (N == 0)return 0; for (int i = 0; i < N; i++){ string dir; cin >> dir; int a; if (dir == "North"){ a = u; u = s, s = d, d = n; n = a; } if (dir == "East"){ a = u, u = w, w = d, d = e, e = a; } if (dir == "Right"){ a = s, s = e, e = n, n = w, w = a; } if (dir == "Left"){ a = s, s = w, w = n, n = e, e = a; } if (dir == "West"){ a = u, u = e, e = d, d = w, w = a; } if (dir == "South"){ a = u, u = n, n = d, d = s, s = a; } ans += u; } printf("%d\n", ans); } }
a.cc: In function 'int main()': a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 11 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s987782344
p00425
C++
#include "stdafx.h" #include <iostream> #include <string> #include <utility> using namespace std; void rotate(int& a,int& b,int& c,int& d){ swap(a,b); swap(a,d); swap(c,d); } int main() { int n,sum=1,num[6]={1,2,3,4,5,6}; string s; cin>>n; while(n--){ cin>>s; if(s=="North")rotate(num[5],num[1],num[0],num[4]); else if(s=="South")rotate(num[4],num[0],num[1],num[5]); else if(s=="West")rotate(num[5],num[2],num[0],num[3]); else if(s=="East")rotate(num[3],num[0],num[2],num[5]); else if(s=="Right")rotate(num[1],num[3],num[4],num[2]); else if(s=="Left")rotate(num[2],num[4],num[3],num[1]); sum+=num[0]; } cout<<sum<<endl; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s438672758
p00425
C++
#include <iostream> #include <string> #include <utility> using namespace std; void rotate(int& a,int& b,int& c,int& d){ swap(a,b); swap(a,d); swap(c,d); } int main() { while(ture){ int n,sum=1,num[6]={1,2,3,4,5,6}; string s; cin>>n; if(!n)break; while(n--){ cin>>s; if(s=="North")rotate(num[5],num[1],num[0],num[4]); else if(s=="South")rotate(num[4],num[0],num[1],num[5]); else if(s=="West")rotate(num[5],num[2],num[0],num[3]); else if(s=="East")rotate(num[3],num[0],num[2],num[5]); else if(s=="Right")rotate(num[1],num[3],num[4],num[2]); else if(s=="Left")rotate(num[2],num[4],num[3],num[1]); sum+=num[0]; } cout<<sum<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:15: error: 'ture' was not declared in this scope 12 | while(ture){ | ^~~~
s659676865
p00425
C++
#include<iostream> using namespace std; struct dice{ int court[6]; dice(int c[6]){court[0]=c[0];court[1]=c[1];court[2]=c[2];court[3]=c[3];court[4]=c[4];court[5]=c[5];} dice(){} void roll(char *ch); int top(){return court[0];} }; void dice::roll(char *ch){ int tmp; if(!strcmp("North", ch)){ tmp = court[0]; court[0] = court[1]; court[1] = court[5]; court[5] = court[4]; court[4] = tmp; } if(!strcmp("East", ch)){ tmp = court[0]; court[0] = court[3]; court[3] = court[5]; court[5] = court[2]; court[2] = tmp; } if(!strcmp("West", ch)){ tmp = court[0]; court[0] = court[2]; court[2] = court[5]; court[5] = court[3]; court[3] = tmp; } if(!strcmp("South", ch)){ tmp = court[0]; court[0] = court[4]; court[4] = court[5]; court[5] = court[1]; court[1] = tmp; } if(!strcmp("Right", ch)){ tmp = court[1]; court[1] = court[2]; court[2] = court[4]; court[4] = court[3]; court[3] = tmp; } if(!strcmp("Left", ch)){ tmp = court[1]; court[1] = court[3]; court[3] = court[4]; court[4] = court[2]; court[2] = tmp; } return; } int main(){ int n, sum; int a[6] = {1,2,3,4,5,6}; char ch[10]; while(true){ cin >> n; dice d(a); sum=d.top(); if(n==0)break; for(int i=0;i<n;i++){ cin>>ch; d.roll(ch); sum += d.top(); } cout << sum << endl; } return 0; }
a.cc: In member function 'void dice::roll(char*)': a.cc:13:13: error: 'strcmp' was not declared in this scope 13 | if(!strcmp("North", ch)){ | ^~~~~~ a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | using namespace std; a.cc:20:13: error: 'strcmp' was not declared in this scope 20 | if(!strcmp("East", ch)){ | ^~~~~~ a.cc:20:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:27:13: error: 'strcmp' was not declared in this scope 27 | if(!strcmp("West", ch)){ | ^~~~~~ a.cc:27:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:34:13: error: 'strcmp' was not declared in this scope 34 | if(!strcmp("South", ch)){ | ^~~~~~ a.cc:34:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:41:13: error: 'strcmp' was not declared in this scope 41 | if(!strcmp("Right", ch)){ | ^~~~~~ a.cc:41:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:48:13: error: 'strcmp' was not declared in this scope 48 | if(!strcmp("Left", ch)){ | ^~~~~~ a.cc:48:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s123268544
p00425
C++
import java.io.*; // namespace... class aoj0502 { public static void main() { System.out.printf("%d%n", solve()); return; } private int solve() { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); int ret = 1; String buf; int dtop=1, dforward=2, dside=3; while((buf = br.readLine()) != null) { int tmp; switch(buf) { case "North": tmp = dtop; dtop = dforward; dforward = 7-tmp; break; case "South": tmp = dtop; dtop = 7-dforward; dforward = tmp; break; case "West": tmp = dtop; dtop = dside; dside = 7-tmp; break; case "East": tmp = dtop; dtop = 7-dside; dside = tmp; break; case "Right": tmp = dforward; dforward = dside; dside = 7-tmp; break; case "Left": tmp = dforward; dforward = 7-dside; dside = tmp; } ret += dtop; } return ret; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; // namespace... | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:15: error: expected ':' before 'static' 5 | public static void main() { | ^~~~~~~ | : a.cc:11:16: error: expected ':' before 'int' 11 | private int solve() { | ^~~~ | : a.cc:58:2: error: expected ';' after class definition 58 | } | ^ | ; a.cc: In static member function 'static void aoj0502::main()': a.cc:7:17: error: 'System' was not declared in this scope 7 | System.out.printf("%d%n", solve()); | ^~~~~~ a.cc:7:48: error: cannot call member function 'int aoj0502::solve()' without object 7 | System.out.printf("%d%n", solve()); | ~~~~~^~ a.cc: In member function 'int aoj0502::solve()': a.cc:12:17: error: 'InputStreamReader' was not declared in this scope 12 | InputStreamReader isr = new InputStreamReader(System.in); | ^~~~~~~~~~~~~~~~~ a.cc:13:17: error: 'BufferedReader' was not declared in this scope 13 | BufferedReader br = new BufferedReader(isr); | ^~~~~~~~~~~~~~ a.cc:16:17: error: 'String' was not declared in this scope 16 | String buf; | ^~~~~~ a.cc:21:24: error: 'buf' was not declared in this scope 21 | while((buf = br.readLine()) != null) { | ^~~ a.cc:21:30: error: 'br' was not declared in this scope 21 | while((buf = br.readLine()) != null) { | ^~ a.cc:21:48: error: 'null' was not declared in this scope 21 | while((buf = br.readLine()) != null) { | ^~~~
s580464892
p00425
C++
#include <map> #include <string> using namespace std; // 1<-here //2345 // 6 // // {1,2,3,4,5,6} map<string,int[6]> table={ {"North",{3,2,6,4,1,5}},//north {"East",{2,6,3,1,5,4}},//east {"West",{4,1,3,6,5,2}},//west {"South",{5,2,1,4,6,3}},//south {"Right",{1,5,2,3,4,6}},//right {"Left",{1,3,4,5,2,6}} //left }; // 1 //4235 // 6 int init[6]={1,4,2,3,5,6}; int view[6]={1,4,2,3,5,6}; int copy[6]={1,4,2,3,5,6}; void init(){ for(int i=0;i<6;i++){ view[i]=init[i]; } } void rotate(string id){ for(int i=0;i<6;i++){ copy[i]=view[table[id][i]]; } for(int i=0;i<6;i++){ view[i]=copy[i]; } } int main(){ bool flag=false; string name=""; int ans=0; do{ ans=0; init(); flag=false; cin >> max; for(int i=0;i<max;i++){ flag=true; cin>>name; rotate(name); ans+=view[0]; } if (flag){cout << ans;} }while(flag); return 0; }
a.cc:19:1: error: could not convert '{{"North", {3, 2, 6, 4, 1, 5}}, {"East", {2, 6, 3, 1, 5, 4}}, {"West", {4, 1, 3, 6, 5, 2}}, {"South", {5, 2, 1, 4, 6, 3}}, {"Right", {1, 5, 2, 3, 4, 6}}, {"Left", {1, 3, 4, 5, 2, 6}}}' from '<brace-enclosed initializer list>' to 'std::map<std::__cxx11::basic_string<char>, int [6]>' 19 | }; | ^ | | | <brace-enclosed initializer list> a.cc:29:11: error: 'void init()' redeclared as different kind of entity 29 | void init(){ | ^ a.cc:24:5: note: previous declaration 'int init [6]' 24 | int init[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'void rotate(std::string)': a.cc:37:17: error: reference to 'copy' is ambiguous 37 | copy[i]=view[table[id][i]]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:27:5: note: 'int copy [6]' 27 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc:40:25: error: reference to 'copy' is ambiguous 40 | view[i]=copy[i]; | ^~~~ /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:27:5: note: 'int copy [6]' 27 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'int main()': a.cc:51:21: error: 'init' cannot be used as a function 51 | init(); | ~~~~^~ a.cc:53:17: error: 'cin' was not declared in this scope 53 | cin >> max; | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <string> +++ |+#include <iostream> 5 | using namespace std; a.cc:54:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<' 54 | for(int i=0;i<max;i++){ | ~^~~~ a.cc:60:27: error: 'cout' was not declared in this scope 60 | if (flag){cout << ans;} | ^~~~ a.cc:60:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s421713444
p00425
C++
/* * File Name :.cpp * Author : * Date : * Explain : */ #include <map> #include <string> using namespace std; // 1<-here //2345 // 6 // // {1,2,3,4,5,6} map<string,int[6]> table; table["North"]={3,2,6,4,1,5}};//north table["East"]={2,6,3,1,5,4}};//east table["West"]={4,1,3,6,5,2}};//west table["South"]={5,2,1,4,6,3};//south table["Right"]={1,5,2,3,4,6};//right table["Left"]={1,3,4,5,2,6}};//left // 1 //4235 // 6 int init[6]={1,4,2,3,5,6}; int view[6]={1,4,2,3,5,6}; int copy[6]={1,4,2,3,5,6}; void init(){ for(int i=0;i<6;i++){ view[i]=init[i]; } } void rotate(string id){ for(int i=0;i<6;i++){ copy[i]=view[table[id][i]]; } for(int i=0;i<6;i++){ view[i]=copy[i]; } } int main(){ bool flag=false; string name=""; int ans=0; do{ ans=0; init(); flag=false; cin >> max; for(int i=0;i<max;i++){ flag=true; cin>>name; rotate(name); ans+=view[0]; } if (flag){cout << ans;} }while(flag); return 0; }
a.cc:18:9: error: 'table' does not name a type; did you mean 'mutable'? 18 | table["North"]={3,2,6,4,1,5}};//north | ^~~~~ | mutable a.cc:18:37: error: expected declaration before '}' token 18 | table["North"]={3,2,6,4,1,5}};//north | ^ a.cc:19:9: error: 'table' does not name a type; did you mean 'mutable'? 19 | table["East"]={2,6,3,1,5,4}};//east | ^~~~~ | mutable a.cc:19:36: error: expected declaration before '}' token 19 | table["East"]={2,6,3,1,5,4}};//east | ^ a.cc:20:9: error: 'table' does not name a type; did you mean 'mutable'? 20 | table["West"]={4,1,3,6,5,2}};//west | ^~~~~ | mutable a.cc:20:36: error: expected declaration before '}' token 20 | table["West"]={4,1,3,6,5,2}};//west | ^ a.cc:21:9: error: 'table' does not name a type; did you mean 'mutable'? 21 | table["South"]={5,2,1,4,6,3};//south | ^~~~~ | mutable a.cc:22:9: error: 'table' does not name a type; did you mean 'mutable'? 22 | table["Right"]={1,5,2,3,4,6};//right | ^~~~~ | mutable a.cc:23:9: error: 'table' does not name a type; did you mean 'mutable'? 23 | table["Left"]={1,3,4,5,2,6}};//left | ^~~~~ | mutable a.cc:23:36: error: expected declaration before '}' token 23 | table["Left"]={1,3,4,5,2,6}};//left | ^ a.cc:34:11: error: 'void init()' redeclared as different kind of entity 34 | void init(){ | ^ a.cc:29:5: note: previous declaration 'int init [6]' 29 | int init[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'void rotate(std::string)': a.cc:42:17: error: reference to 'copy' is ambiguous 42 | copy[i]=view[table[id][i]]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:8: /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:32:5: note: 'int copy [6]' 32 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc:45:25: error: reference to 'copy' is ambiguous 45 | view[i]=copy[i]; | ^~~~ /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:32:5: note: 'int copy [6]' 32 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'int main()': a.cc:56:21: error: 'init' cannot be used as a function 56 | init(); | ~~~~^~ a.cc:58:17: error: 'cin' was not declared in this scope 58 | cin >> max; | ^~~ a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 9 | #include <string> +++ |+#include <iostream> 10 | using namespace std; a.cc:59:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<' 59 | for(int i=0;i<max;i++){ | ~^~~~ a.cc:65:27: error: 'cout' was not declared in this scope 65 | if (flag){cout << ans;} | ^~~~ a.cc:65:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s704346395
p00425
C++
/* * File Name :.cpp * Author : * Date : * Explain : */ #include <map> #include <string> using namespace std; // 1<-here //2345 // 6 // // {1,2,3,4,5,6} map<string,int[6]> table; table["North"]={3,2,6,4,1,5};//north table["East"] ={2,6,3,1,5,4};//east table["West"] ={4,1,3,6,5,2};//west table["South"]={5,2,1,4,6,3};//south table["Right"]={1,5,2,3,4,6};//right table["Left"] ={1,3,4,5,2,6};//left // 1 //4235 // 6 int init[6]={1,4,2,3,5,6}; int view[6]={1,4,2,3,5,6}; int copy[6]={1,4,2,3,5,6}; void init(){ for(int i=0;i<6;i++){ view[i]=init[i]; } } void rotate(string id){ for(int i=0;i<6;i++){ copy[i]=view[table[id][i]]; } for(int i=0;i<6;i++){ view[i]=copy[i]; } } int main(){ bool flag=false; string name=""; int ans=0; do{ ans=0; init(); flag=false; cin >> max; for(int i=0;i<max;i++){ flag=true; cin>>name; rotate(name); ans+=view[0]; } if (flag){cout << ans;} }while(flag); return 0; }
a.cc:18:9: error: 'table' does not name a type; did you mean 'mutable'? 18 | table["North"]={3,2,6,4,1,5};//north | ^~~~~ | mutable a.cc:19:9: error: 'table' does not name a type; did you mean 'mutable'? 19 | table["East"] ={2,6,3,1,5,4};//east | ^~~~~ | mutable a.cc:20:9: error: 'table' does not name a type; did you mean 'mutable'? 20 | table["West"] ={4,1,3,6,5,2};//west | ^~~~~ | mutable a.cc:21:9: error: 'table' does not name a type; did you mean 'mutable'? 21 | table["South"]={5,2,1,4,6,3};//south | ^~~~~ | mutable a.cc:22:9: error: 'table' does not name a type; did you mean 'mutable'? 22 | table["Right"]={1,5,2,3,4,6};//right | ^~~~~ | mutable a.cc:23:9: error: 'table' does not name a type; did you mean 'mutable'? 23 | table["Left"] ={1,3,4,5,2,6};//left | ^~~~~ | mutable a.cc:34:11: error: 'void init()' redeclared as different kind of entity 34 | void init(){ | ^ a.cc:29:5: note: previous declaration 'int init [6]' 29 | int init[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'void rotate(std::string)': a.cc:42:17: error: reference to 'copy' is ambiguous 42 | copy[i]=view[table[id][i]]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:8: /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:32:5: note: 'int copy [6]' 32 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc:45:25: error: reference to 'copy' is ambiguous 45 | view[i]=copy[i]; | ^~~~ /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:32:5: note: 'int copy [6]' 32 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'int main()': a.cc:56:21: error: 'init' cannot be used as a function 56 | init(); | ~~~~^~ a.cc:58:17: error: 'cin' was not declared in this scope 58 | cin >> max; | ^~~ a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 9 | #include <string> +++ |+#include <iostream> 10 | using namespace std; a.cc:59:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<' 59 | for(int i=0;i<max;i++){ | ~^~~~ a.cc:65:27: error: 'cout' was not declared in this scope 65 | if (flag){cout << ans;} | ^~~~ a.cc:65:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s743891154
p00425
C++
/* * File Name :.cpp * Author : * Date : * Explain : */ #include <map> #include <string> using namespace std; // 1<-here //2345 // 6 // // {1,2,3,4,5,6} map<string,int[6]> table; table["North"]={3,2,6,4,1,5};//north table["East"] ={2,6,3,1,5,4};//east table["West"] ={4,1,3,6,5,2};//west table["South"]={5,2,1,4,6,3};//south table["Right"]={1,5,2,3,4,6};//right table["Left"] ={1,3,4,5,2,6};//left // 1 //4235 // 6 int init[6]={1,4,2,3,5,6}; int view[6]={1,4,2,3,5,6}; int copy[6]={1,4,2,3,5,6}; void ini(){ for(int i=0;i<6;i++){ view[i]=init[i]; } } void rotate(string id){ for(int i=0;i<6;i++){ copy[i]=view[table[id][i]]; } for(int i=0;i<6;i++){ view[i]=copy[i]; } } int main(){ bool flag=false; string name=""; int ans=0; do{ ans=0; ini(); flag=false; cin >> max; for(int i=0;i<max;i++){ flag=true; cin>>name; rotate(name); ans+=view[0]; } if (flag){cout << ans;} }while(flag); return 0; }
a.cc:18:9: error: 'table' does not name a type; did you mean 'mutable'? 18 | table["North"]={3,2,6,4,1,5};//north | ^~~~~ | mutable a.cc:19:9: error: 'table' does not name a type; did you mean 'mutable'? 19 | table["East"] ={2,6,3,1,5,4};//east | ^~~~~ | mutable a.cc:20:9: error: 'table' does not name a type; did you mean 'mutable'? 20 | table["West"] ={4,1,3,6,5,2};//west | ^~~~~ | mutable a.cc:21:9: error: 'table' does not name a type; did you mean 'mutable'? 21 | table["South"]={5,2,1,4,6,3};//south | ^~~~~ | mutable a.cc:22:9: error: 'table' does not name a type; did you mean 'mutable'? 22 | table["Right"]={1,5,2,3,4,6};//right | ^~~~~ | mutable a.cc:23:9: error: 'table' does not name a type; did you mean 'mutable'? 23 | table["Left"] ={1,3,4,5,2,6};//left | ^~~~~ | mutable a.cc: In function 'void rotate(std::string)': a.cc:42:17: error: reference to 'copy' is ambiguous 42 | copy[i]=view[table[id][i]]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:8: /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:32:5: note: 'int copy [6]' 32 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc:45:25: error: reference to 'copy' is ambiguous 45 | view[i]=copy[i]; | ^~~~ /usr/include/c++/14/bits/stl_algobase.h:642:5: note: candidates are: 'template<class _II, class _OI> _OI std::copy(_II, _II, _OI)' 642 | copy(_II __first, _II __last, _OI __result) | ^~~~ a.cc:32:5: note: 'int copy [6]' 32 | int copy[6]={1,4,2,3,5,6}; | ^~~~ a.cc: In function 'int main()': a.cc:58:17: error: 'cin' was not declared in this scope 58 | cin >> max; | ^~~ a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 9 | #include <string> +++ |+#include <iostream> 10 | using namespace std; a.cc:59:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<' 59 | for(int i=0;i<max;i++){ | ~^~~~ a.cc:65:27: error: 'cout' was not declared in this scope 65 | if (flag){cout << ans;} | ^~~~ a.cc:65:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s391577365
p00425
C++
#include<iostream> #include <string> #include <utility> using namespace std; int main(){ while(1){ int n = 0; cin >> n; if(n == 0){break;} int sum = 1; int a[7]; for(int i = 0;i <= 6;i++){ a[i] = i + 1; } for (int i = 1;i <= n;i++){ string c;string N = "North";string E = "East";string S = "South";string W = "West"; string R = "Right";string L = "Left"; cin >> c; if(c == N){ a[6] = a[0];a[0] = a[1];a[1] = a[5];a[5] = a[4];a[4] = a[6]; } if(c == S){ a[6] = a[0];a[0] = a[4];a[4] = a[5];a[5] = a[1];a[1] = a[6]; } if(c == E){ a[6] = a[0];a[0] = a[3];a[3] = a[5];a[5] = a[2];a[2] = a[6]; } if(c == W){ a[6] = a[0];a[0] = a[2];a[2] = a[5];a[5] = a[3];a[3] = a[6]; } if(c == R){ a[6] = a[1];a[1] = a[2];a[2] = a[4];a[4] = a[3];a[3] = a[6]; } if(c == L{ a[6] = a[1];a[1] = a[3];a[3] = a[4];a[4] =a[2];a[2] = a[6]; } sum = sum + a[0]; } cout << sum << endl; } return 0; }
a.cc: In function 'int main()': a.cc:35:10: error: expected ';' before '{' token 35 | if(c == L{ | ^ | ; a.cc:35:6: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result] 35 | if(c == L{ | ~~^~~~ In file included from /usr/include/c++/14/string:54, 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, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3755:5: note: declared here 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ a.cc:38:17: error: expected ')' before ';' token 38 | sum = sum + a[0]; | ^ | ) a.cc:35:3: note: to match this '(' 35 | if(c == L{ | ^
s459022304
p00425
C++
# -*- coding:shift-jis -*- class Dice: def __init__(self): self.top = 1 self.south = 2 self.north = 5 self.east = 3 self.west = 4 self.bottom = 6 def rotate(self,operation): if operation == "North": self.top,self.north,self.bottom,self.south = self.south,self.top,self.north,self.bottom elif operation == "East": self.top,self.east,self.bottom,self.west = self.west,self.top,self.east,self.bottom elif operation == "West": self.top,self.east,self.bottom,self.west = self.east,self.bottom,self.west,self.top elif operation == "South": self.top,self.north,self.bottom,self.south = self.north,self.bottom,self.south,self.top elif operation == "Right": self.north,self.east,self.south,self.west = self.west,self.north,self.east,self.south elif operation == "Left": self.north,self.east,self.south,self.west = self.east,self.south,self.west,self.north, n = int(input()) while n!=0: value = 1 d = Dice() for i in [input() for _ in range(n)]: d.rotate(i) value += d.top print(value) n = int(input())
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding:shift-jis -*- | ^ a.cc:5:9: error: expected class-name before '__init__' 5 | def __init__(self): | ^~~~~~~~ a.cc:5:9: error: expected '{' before '__init__' a.cc:5:18: error: 'self' was not declared in this scope 5 | def __init__(self): | ^~~~
s235273372
p00425
C++
# -*- coding:shift-jis -*- class Dice: def __init__(self): self.top = 1 self.south = 2 self.north = 5 self.east = 3 self.west = 4 self.bottom = 6 def rotate(self,operation): if operation == "North": self.top,self.north,self.bottom,self.south = self.south,self.top,self.north,self.bottom elif operation == "East": self.top,self.east,self.bottom,self.west = self.west,self.top,self.east,self.bottom elif operation == "West": self.top,self.east,self.bottom,self.west = self.east,self.bottom,self.west,self.top elif operation == "South": self.top,self.north,self.bottom,self.south = self.north,self.bottom,self.south,self.top elif operation == "Right": self.north,self.east,self.south,self.west = self.west,self.north,self.east,self.south elif operation == "Left": self.north,self.east,self.south,self.west = self.east,self.south,self.west,self.north, n = int(input()) while n!=0: value = 1 d = Dice() for i in range(n): d.rotate(input()) value += d.top print(value) n = int(input())
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding:shift-jis -*- | ^ a.cc:5:9: error: expected class-name before '__init__' 5 | def __init__(self): | ^~~~~~~~ a.cc:5:9: error: expected '{' before '__init__' a.cc:5:18: error: 'self' was not declared in this scope 5 | def __init__(self): | ^~~~
s761036815
p00425
C++
??£??£???
a.cc:1:3: error: extended character £ is not valid in an identifier 1 | ??£??£??? | ^ a.cc:1:6: error: extended character £ is not valid in an identifier 1 | ??£??£??? | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??£??£??? | ^
s375971868
p00425
C++
import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.InputMismatchException; import java.util.Map; import java.util.PriorityQueue; import java.math.BigInteger; public class Main{ static final InputStream in=System.in; static final PrintWriter out=new PrintWriter(System.out); static final int INF=Integer.MAX_VALUE/2; static final long LINF=Long.MAX_VALUE/2; static String str; public static void main(String[] args) throws IOException{ InputReader ir=new InputReader(in); while(true){ int n=ir.nextInt(); if(n==0) break; int[] d={1,2,4,5,3,6}; int ans=1; while(n-->0){ String command=ir.next(); int top=d[0]; int front=d[1]; int left=d[2]; int back=d[3]; int right=d[4]; int bottom=d[5]; if("North".equals(command)){ d[3]=top; d[0]=front; d[1]=bottom; d[5]=back; } else if("East".equals(command)){ d[4]=top; d[5]=right; d[2]=bottom; d[0]=left; } else if("West".equals(command)){ d[2]=top; d[0]=right; d[4]=bottom; d[5]=left; } else if("South".equals(command)){ d[1]=top; d[5]=front; d[3]=bottom; d[0]=back; } else if("Right".equals(command)){ d[2]=front; d[3]=left; d[4]=back; d[1]=right; } else{ d[4]=front; d[1]=left; d[2]=back; d[3]=right; } ans+=d[0]; } out.println(ans); } out.flush(); } public static boolean isPalindrome(int s,int e){ for(int i=0;i<=(e-s)/2;i++) if(str.charAt(s+i)!=str.charAt(e-i)) return false; return true; } static class InputReader { private InputStream in; private byte[] buffer=new byte[1024]; private int curbuf; private int lenbuf; public InputReader(InputStream in) {this.in=in;} public int readByte() { if(lenbuf==-1) throw new InputMismatchException(); if(curbuf>=lenbuf){ curbuf= 0; try{ lenbuf=in.read(buffer); } catch (IOException e) { throw new InputMismatchException(); } if(lenbuf<=0) return -1; } return buffer[curbuf++]; } public boolean isSpaceChar(int c){return !(c>=33&&c<=126);} private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;} public String next() { int b=skip(); StringBuilder sb=new StringBuilder(); while(!isSpaceChar(b)){ sb.appendCodePoint(b); b=readByte(); } return sb.toString(); } public int nextInt() { int c=readByte(); while (isSpaceChar(c)) c=readByte(); boolean minus=false; if (c=='-') { minus=true; c=readByte(); } int res=0; do{ if(c<'0'||c>'9') throw new InputMismatchException(); res=res*10+c-'0'; c=readByte(); }while(!isSpaceChar(c)); return (minus)?-res:res; } public long nextLong() { int c=readByte(); while (isSpaceChar(c)) c=readByte(); boolean minus=false; if (c=='-') { minus=true; c=readByte(); } long res = 0; do{ if(c<'0'||c>'9') throw new InputMismatchException(); res=res*10+c-'0'; c=readByte(); }while(!isSpaceChar(c)); return (minus)?-res:res; } public int[] toIntArray(int n){ int[] a=new int[n]; for(int i=0;i<n;i++) a[i]=nextInt(); return a; } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.InputStream; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.InputStreamReader; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.IOException; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.io.PrintWriter; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.util.ArrayDeque; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.ArrayList; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.util.Arrays; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: 'import' does not name a type 8 | import java.util.Comparator; | ^~~~~~ a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: 'import' does not name a type 9 | import java.util.Deque; | ^~~~~~ a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:10:1: error: 'import' does not name a type 10 | import java.util.HashMap; | ^~~~~~ a.cc:10:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: 'import' does not name a type 11 | import java.util.InputMismatchException; | ^~~~~~ a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:12:1: error: 'import' does not name a type 12 | import java.util.Map; | ^~~~~~ a.cc:12:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:13:1: error: 'import' does not name a type 13 | import java.util.PriorityQueue; | ^~~~~~ a.cc:13:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:14:1: error: 'import' does not name a type 14 | import java.math.BigInteger; | ^~~~~~ a.cc:14:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:16:1: error: expected unqualified-id before 'public' 16 | public class Main{ | ^~~~~~
s973999258
p00425
C++
#include<stdio.h> #include<string.h> #include<iostream> using namespace std; int main(void){ int n, b = 1, z1 = 2, z2 = 3, n1, n2, g = 1; char muki[10]; while (1){ scanf_s("%d", &n); b = 1, z1 = 2, z2 = 3, g = 1; for (int i = 0; i < n; i++){ scanf_s("%s", muki, 10); if (strcmp(muki, "North") == 0){ n1 = z1; z1 = 7 - b; b = n1; } if (strcmp(muki, "East") == 0){ n1 = 7 - z2; z2 = b; b = n1; } if (strcmp(muki, "West") == 0){ n1 = z2; z2 = 7 - b; b = n1; } if (strcmp(muki, "South") == 0){ n1 = 7 - z1; z1 = b; b = n1; } if (strcmp(muki, "Right") == 0){ n2 = 7 - z1; z1 = z2; z2 = n2; } if (strcmp(muki, "Left") == 0){ n2 = z1; z1 = 7 - z2; z2 = n2; } g += b; } if (n == 0){ break; } printf("%d", g); } return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 10 | scanf_s("%d", &n); | ^~~~~~~ | scanf