submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s385112133
p00046
C++
#include <iostream> using namespace std; float a; float min = 1000000; float max = 0; int main(){ while(cin >> a){ if(a < min) min = a; if(a > max) max = a; count++; } cout << max - min << endl; }
a.cc: In function 'int main()': a.cc:10:16: error: reference to 'min' is ambiguous 10 | if(a < min) min = a; | ^~~ In file included 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_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:7: note: 'float min' 5 | float min = 1000000; | ^~~ a.cc:10:21: error: reference to 'min' is ambiguous 10 | if(a < min) min = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:7: note: 'float min' 5 | float min = 1000000; | ^~~ a.cc:11:16: error: reference to 'max' is ambiguous 11 | if(a > max) max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:7: note: 'float max' 6 | float max = 0; | ^~~ a.cc:11:21: error: reference to 'max' is ambiguous 11 | if(a > max) max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:7: note: 'float max' 6 | float max = 0; | ^~~ a.cc:12:9: error: 'count' was not declared in this scope 12 | count++; | ^~~~~ a.cc:14:13: error: reference to 'max' is ambiguous 14 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:7: note: 'float max' 6 | float max = 0; | ^~~ a.cc:14:19: error: reference to 'min' is ambiguous 14 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:7: note: 'float min' 5 | float min = 1000000; | ^~~
s051854135
p00046
C++
#include <iostream> using namespace std; float a; float min = 1000000; float max = 0; int main(){ while(cin >> a){ if(a < min) min = a; if(a > max) max = a; } cout << max - min << endl; }
a.cc: In function 'int main()': a.cc:10:16: error: reference to 'min' is ambiguous 10 | if(a < min) min = a; | ^~~ In file included 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_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:7: note: 'float min' 5 | float min = 1000000; | ^~~ a.cc:10:21: error: reference to 'min' is ambiguous 10 | if(a < min) min = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:7: note: 'float min' 5 | float min = 1000000; | ^~~ a.cc:11:16: error: reference to 'max' is ambiguous 11 | if(a > max) max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:7: note: 'float max' 6 | float max = 0; | ^~~ a.cc:11:21: error: reference to 'max' is ambiguous 11 | if(a > max) max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:7: note: 'float max' 6 | float max = 0; | ^~~ a.cc:13:13: error: reference to 'max' is ambiguous 13 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:7: note: 'float max' 6 | float max = 0; | ^~~ a.cc:13:19: error: reference to 'min' is ambiguous 13 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:7: note: 'float min' 5 | float min = 1000000; | ^~~
s369010327
p00046
C++
#include <bits/stdc++.h> using namespace std; int main(){ double n; vector<double> vec; while (cin >> n){ vec.push_back(); } sort(vec.begin(), vec.end()); double ans = vec.back() - vec.front(); cout << fixed << setprecision(3) << ans << endl; }
a.cc: In function 'int main()': a.cc:8:18: error: no matching function for call to 'std::vector<double>::push_back()' 8 | vec.push_back(); | ~~~~~~~~~~~~~^~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = double; _Alloc = std::allocator<double>; value_type = double]' 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 = double; _Alloc = std::allocator<double>; value_type = double]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate expects 1 argument, 0 provided
s515777431
p00046
C++
#include<iostream.h> int main(){double l,m,n=1e5;for(;cin>>l;m<l?m=l:l,n>l?n=l:l);cout<<m-n<<endl;}
a.cc:1:9: fatal error: iostream.h: No such file or directory 1 | #include<iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s469387893
p00046
C++
main(){ double max=0,min=1e9,h; while(~scanf("%lf",&h)){ if(max<h) max=h; if(min>h) min=h; } printf("%f\n",max-min); exit(0); }
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:3:16: error: 'scanf' was not declared in this scope 3 | while(~scanf("%lf",&h)){ | ^~~~~ a.cc:7:9: error: 'printf' was not declared in this scope 7 | printf("%f\n",max-min); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){ a.cc:8:9: error: 'exit' was not declared in this scope 8 | exit(0); | ^~~~ a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' +++ |+#include <cstdlib> 1 | main(){
s818446578
p00046
C++
#include <stdio.h> #include <vector> using namespace std; int main(){ vector<double> h; double n; while( scanf("%lf", &n) != EOF ){ h.push_back(n); } sort( h.begin() , h.end() ); int i = h.size()-1; printf("%.1f\n", h[i]-h[0]); return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort( h.begin() , h.end() ); | ^~~~ | short
s140035051
p00046
C++
#include <iostream> #include <cstdio> int main(){ double i=1e+64,a=0,t; while(std::cin>>t){ if(t<i)i=t; if(t>a)a=t; } printf("%f\n", maxi-mini); }
a.cc: In function 'int main()': a.cc:9:24: error: 'maxi' was not declared in this scope 9 | printf("%f\n", maxi-mini); | ^~~~ a.cc:9:29: error: 'mini' was not declared in this scope 9 | printf("%f\n", maxi-mini); | ^~~~
s858463222
p00046
C++
#include <cstdio> #include <cstring> #include <algorithm> #include <string> #include <cmath> #include <stack> #include <vector> #include <map> #include <set> #include <iostream> using namespace std; int main() { double ma = DBL_MIN; double mi = DBL_MAX; double al; while (scanf("%lf", &al) != EOF) { if (al > ma) ma = al; if (al < mi) mi = al; } printf("%.1f\n", ma-mi); return 0; }
a.cc: In function 'int main()': a.cc:18:21: error: 'DBL_MIN' was not declared in this scope 18 | double ma = DBL_MIN; | ^~~~~~~ a.cc:11:1: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>' 10 | #include <iostream> +++ |+#include <cfloat> 11 | a.cc:19:21: error: 'DBL_MAX' was not declared in this scope 19 | double mi = DBL_MAX; | ^~~~~~~ a.cc:19:21: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
s540236445
p00046
C++
#include <cstdio> #include <cstring> #include <algorithm> #include <string> #include <cmath> #include <stack> #include <vector> #include <map> #include <set> #include <iostream> #include <climits> using namespace std; int main() { double ma = DBL_MIN; double mi = DBL_MAX; double al; while (scanf("%lf", &al) != EOF) { if (al > ma) ma = al; if (al < mi) mi = al; } printf("%.1f\n", ma-mi); return 0; }
a.cc: In function 'int main()': a.cc:19:21: error: 'DBL_MIN' was not declared in this scope 19 | double ma = DBL_MIN; | ^~~~~~~ a.cc:12:1: note: 'DBL_MIN' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>' 11 | #include <climits> +++ |+#include <cfloat> 12 | a.cc:20:21: error: 'DBL_MAX' was not declared in this scope 20 | double mi = DBL_MAX; | ^~~~~~~ a.cc:20:21: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
s944374333
p00046
C++
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String args[]) { ArrayList<Double> al = new ArrayList<Double>(); while(sc.hasNext()) { al.add(sc.nextDouble()); } System.out.println(Collections.max(al) - Collections.min(al)); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s855627101
p00046
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ double xmax=0,xmin=INT_MAX,ans,n[100000]; int i=0; while(cin >> n[i]){ xmax=max(xmax,n[i]); xmin=min(xmin,n[i]); i++; } cout << xmax-xmin << endl; }
a.cc: In function 'int main()': a.cc:7:22: error: 'INT_MAX' was not declared in this scope 7 | double xmax=0,xmin=INT_MAX,ans,n[100000]; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include<algorithm> +++ |+#include <climits> 4 | using namespace std; a.cc:10:16: error: 'n' was not declared in this scope 10 | while(cin >> n[i]){ | ^
s597258394
p00046
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector<double> height; double tmp; while(cin >> tmp){ height.push_back(tmp); } sort(height.begin(), height.end()); double min; double max; min = height[0]; max = height[height.size()-1]; cout << max - min << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(height.begin(), height.end()); | ^~~~ | short
s713563996
p00046
C++
#include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <algorithm> #include <functional> using namespace std; double abs( double n ) { if ( n < 0 ) { return -n; } else { return n; } } int main() { vector<double> height; double input; while ( cin >> input ) { height.push_back( input ); } sort( height.begin(), height.end() ); cout << abs( *height.begin() - *height.rbegin() ) << endl; return 0; }
a.cc: In function 'int main()': a.cc:43:20: error: call of overloaded 'abs(double)' is ambiguous 43 | cout << abs( *height.begin() - *height.rbegin() ) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, 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/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:18:8: note: candidate: 'double abs(double)' 18 | double abs( double n ) | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s727101329
p00046
C++
#include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <algorithm> #include <functional> using namespace std; double abs( double n ) { if ( n < 0 ) { return -n; } else { return n; } } int main() { vector<double> height; double input; while ( cin >> input ) { height.push_back( input ); } sort( height.begin(), height.end() ); cout << abs( *height.begin() - *height.rbegin() ) << endl; return 0; }
a.cc: In function 'int main()': a.cc:43:20: error: call of overloaded 'abs(double)' is ambiguous 43 | cout << abs( *height.begin() - *height.rbegin() ) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, 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/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:18:8: note: candidate: 'double abs(double)' 18 | double abs( double n ) | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s672641443
p00046
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; //0046 int main(){ double h; vector<double> height; while(cin >> h){ if(cin.eof())break; height.push_back(h); } sort(height.begin(),height.end()); double diff = height[height.back()] - height[height.front()]; cout << diff << endl;
a.cc: In function 'int main()': a.cc:19:30: error: expected '}' at end of input 19 | cout << diff << endl; | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s707106935
p00046
C++
#include <iostream> using namespace std; int main(int argc, char **argv) { double max, min, tmp; cin >> max; min = max; while(cin >> tmp){ if(max < tmp){ max = tmp; } else (tmp < min){ min = tmp; } } cout << (double)(max - min) << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:15:27: error: expected ';' before '{' token 15 | } else (tmp < min){ | ^ | ;
s021991278
p00046
C++
#include <iostream> using namespace std; int main(int argc, char **argv) { double max, min, tmp; cin >> max; min = max; while(cin >> tmp){ if(max < tmp){ max = tmp; } elseif (tmp < min){ min = tmp; } } cout << (double)(max - min) << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:15:11: error: 'elseif' was not declared in this scope 15 | } elseif (tmp < min){ | ^~~~~~
s872172023
p00046
C++
int main(){ double a,tans,hans; cin >> a; tans = a; hans = a; while(cin>>a){ if(tans>a) tans = a; if(hans<a) hans = a; } cout << hans - tans << endl; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >> a; | ^~~ a.cc:10:3: error: 'cout' was not declared in this scope 10 | cout << hans - tans << endl; | ^~~~ a.cc:10:26: error: 'endl' was not declared in this scope 10 | cout << hans - tans << endl; | ^~~~
s706334134
p00046
C++
#include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;} | ^~~~~~~~~ a.cc:1:9: fatal error: iostream>usin: No such file or directory 1 | #include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;} | ^~~~~~~~~~~~~~~ compilation terminated.
s993410446
p00046
C++
#include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;} | ^~~~~~~~~ a.cc:1:9: fatal error: iostream>usin: No such file or directory 1 | #include<iostream>using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;} | ^~~~~~~~~~~~~~~ compilation terminated.
s146806752
p00046
C++
#include<iostream> using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include<iostream> using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;} | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s074524364
p00046
C++
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <cstdio> #include <cFloat> using namespace std; int main() { double height = 0, maxNum=0.0, minNum=DBL_MAX; while(cin>>height){ if(cin.eof()) break; maxNum = max(maxNum, height); minNum = min(minNum, height); } printf("%.1f\n", maxNum-minNum); return 0; }
a.cc:7:10: fatal error: cFloat: No such file or directory 7 | #include <cFloat> | ^~~~~~~~ compilation terminated.
s311235518
p00046
C++
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <cstdio> using namespace std; int main() { double height = 0, maxNum=0.0, minNum=DBL_MAX; while(cin>>height){ if(cin.eof()) break; maxNum = max(maxNum, height); minNum = min(minNum, height); } printf("%.1f\n", maxNum-minNum); return 0; }
a.cc: In function 'int main()': a.cc:11:47: error: 'DBL_MAX' was not declared in this scope 11 | double height = 0, maxNum=0.0, minNum=DBL_MAX; | ^~~~~~~ a.cc:7:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>' 6 | #include <cstdio> +++ |+#include <cfloat> 7 |
s521141598
p00046
C++
a#include<iostream> #include<algorithm> using namespace std; int main(){ double x; cin >> x; double minimum = x, maximum = x; while(cin >> x){ minimum = min(minimum, x); maximum = max(maximum, x); } cout << maximum - maximum << endl; return 0; }
a.cc:1:2: error: stray '#' in program 1 | a#include<iostream> | ^ a.cc:1:1: error: 'a' does not name a type 1 | a#include<iostream> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, 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/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867
s576885856
p00046
C++
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> using namespace std; int main(){ vector<float> v; float input; while(cin >> input){ v.push_back(input); sort(v.begin(), v.end()); float ans; vector<float>::iterator ite; ite = v.end(); ans = *(ite-1) - v.at(0); } printf("%.1f\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:19:26: error: 'ans' was not declared in this scope; did you mean 'abs'? 19 | printf("%.1f\n", ans); | ^~~ | abs
s296994287
p00047
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; int[] ball={1,0,0}; while((line=br.readLine())!=null){ char[] c=line.toCharArray(); reverse(c[0],c[2],ball); } for(int i=0;i<ball.length;i++){ if(ball[i]==1){ System.out.println(String.valueOf((char)('A'+1)); } } } private static void reverse(char c1,char c2,final int[] ball){ int a=ball[c1-'A'+1]; ball[c1-'A'+1]=ball[c2-'A'+1]; ball[c2-'A'+1]=a; } }
Main.java:14: error: ')' or ',' expected System.out.println(String.valueOf((char)('A'+1)); ^ 1 error
s617362490
p00047
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; int[] ball={1,0,0}; while((line=br.readLine())!=null){ char[] c=line.toCharArray(); reverse(c[0],c[2],ball); } for(int i=0;i<ball.length;i++){ if(ball[i]==1){ switch(i){ case 0:System.out.println("A"); case 1:System.out.println("B"); case 2:System.out.println("C"); } } } private static void reverse(char c1,char c2,final int[] ball){ int a=ball[c1-'A'+1]; ball[c1-'A'+1]=ball[c2-'A'+1]; ball[c2-'A'+1]=a; } }
Main.java:21: error: illegal start of expression private static void reverse(char c1,char c2,final int[] ball){ ^ 1 error
s592313617
p00047
Java
package field; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; public class Field { public static void main(String[] args) { Map<String, Integer> toIndex = new HashMap<>(); toIndex.put("A", 0); toIndex.put("B", 1); toIndex.put("C", 2); Map<Integer, String> toAlphabet = new HashMap<>(); toAlphabet.put(0, "A"); toAlphabet.put(1, "B"); toAlphabet.put(2, "C"); int[] cap = {1, 0, 0}; List<String[]> splitedString = read(","); for(String[] stringLine : splitedString) { swap(cap, toIndex.get(stringLine[0]), toIndex.get(stringLine[1])); } for(int cur = 0; cur < cap.length; cur++) { if(cap[cur] == 1) { System.out.println(toAlphabet.get(cur)); } } } private static void swap(int[] array, int leftIndex, int rightIndex) { int temp = array[leftIndex]; array[leftIndex] = array[rightIndex]; array[rightIndex] = temp; } public static List<String[]> read(String delim) { Scanner scanner = new Scanner(System.in); List<String[]> splitedStringArray = new ArrayList<>(); while (scanner.hasNext()) { splitedStringArray.add(scanner.nextLine().split(delim)); } scanner.close(); return splitedStringArray; } }
Main.java:9: error: class Field is public, should be declared in a file named Field.java public class Field { ^ 1 error
s869747112
p00047
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class Main { public static void main(String[] args) { try { BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in)); PrintWriter answerwriter = new PrintWriter(System.out); String answer = "A"; String[] params = null; String question = null; while (questionreader.ready()) { if ("".equals(question = questionreader.readLine())) break; params = question.split(","); if (answer.equals(params[0])) answer = params[1]; else if (answer.equals(params[1])) answer = params[0]; } answerwriter.println(answer); answerwriter.close(); questionreader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); return; } catch (IOException e) { e.printStackTrace(); return; } } }
Main.java:32: error: cannot find symbol } catch (FileNotFoundException e) { ^ symbol: class FileNotFoundException location: class Main 1 error
s015300017
p00047
Java
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class Main { public static void main(String[] args) { try { // BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in)); // PrintWriter answerwriter = new PrintWriter(System.out); String answer = "A"; String[] params = null; String question = null; while (questionreader.ready()) { if ("".equals(question = questionreader.readLine())) break; params = question.split(","); if (answer.equals(params[0])) answer = params[1]; else if (answer.equals(params[1])) answer = params[0]; } answerwriter.println(answer); answerwriter.close(); questionreader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); return; } catch (IOException e) { e.printStackTrace(); return; } } }
Main.java:25: error: cannot find symbol while (questionreader.ready()) { ^ symbol: variable questionreader location: class Main Main.java:26: error: cannot find symbol if ("".equals(question = questionreader.readLine())) break; ^ symbol: variable questionreader location: class Main Main.java:32: error: cannot find symbol answerwriter.println(answer); ^ symbol: variable answerwriter location: class Main Main.java:34: error: cannot find symbol answerwriter.close(); ^ symbol: variable answerwriter location: class Main Main.java:35: error: cannot find symbol questionreader.close(); ^ symbol: variable questionreader location: class Main 5 errors
s915376305
p00047
Java
package volume00.set0040; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class P0047 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; char current = 'A'; while ((line = br.readLine()) != null) { if (line.charAt(0) == current || line.charAt(2) == current) current = line.charAt(0) == current ? line.charAt(2) : line .charAt(0); } System.out.println(current); } }
Main.java:7: error: class P0047 is public, should be declared in a file named P0047.java public class P0047 { ^ 1 error
s091106562
p00047
C
#include <stdio.h> ?? int main() { ????????char cup = 'A'; ????????char a, b; ????????while (scanf("%c,%c", &a, &b) != EOF) { ????????????????if (a == cup) { ????????????????????????cup = b; ????????????????} ????????????????else if (b == cup) { ????????????????????????cup = a; ????????????????} ????????} ????????printf("%c\n", cup); ????????return 0; }
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s776394368
p00047
C
#include <stdio.h> ?? int main() { ????????char cup = 'A'; ????????char a, b; ????????while (scanf("%c,%c", &a, &b) != EOF) { ????????????????if (a == cup) { ????????????????????????cup = b; ????????????????} ????????????????else if (b == cup) { ????????????????????????cup = a; ????????????????} ????????} ????????printf("%c\n", cup); ????????return 0; }
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s519580290
p00047
C
main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:20: error: implicit declaration of function 'read' [-Wimplicit-function-declaration] 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~~~ main.c:1:37: error: invalid type argument of unary '*' (have 'int') 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~ main.c:1:43: error: subscripted value is neither array nor pointer nor vector 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^ main.c:1:49: error: invalid type argument of unary '*' (have 'int') 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~ main.c:1:53: error: subscripted value is neither array nor pointer nor vector 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^ main.c:1:57: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} main.c:1:57: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~~~ main.c:1:57: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:63: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts' +++ |+#include <stdio.h> 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} main.c:1:68: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types] 1 | main(b,a){for(b=65;read(0,a,4);)b=b-*a?b-a[2]?b:*a:a[2];exit(!puts(&b));} | ^~ | | | int * main.c:1:68: note: expected 'const char *' but argument is of type 'int *'
s648142352
p00047
C
p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);}
main.c:1:1: warning: data definition has no type or storage class 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 's' defaults to 'int' [-Wimplicit-int] main.c:1:3: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:3: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} | ^~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:58: error: expected ')' before 's' 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} | ~ ^ | ) main.c:1:90: error: expected expression before '}' token 1 | p;main(s,a,b){for(;~scanf("%X,%X",&a,&b);p=(p<=s?s-p%3:p)s=a+b-20;p=!printf("%c\n",65+p);} | ^
s796938833
p00047
C
#include<stdio.h> int change(char s){ if(s=='A')return 0; if(s=='B')return 1; if(s=='C')return 2; return -1; } main(){ int cup[3]={1,0,0}; char x,y; int tmp; while(~scanf("%c,%c",&x,&y)){ tmp=cup[change(x)]; cup[change(x)]=cup[change(y)]; cup[change(y)]=tmxp; } if(cup[0])printf("A\n"); if(cup[1])printf("B\n"); if(cup[2])printf("C\n"); return 0; }
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int] 8 | main(){ | ^~~~ main.c: In function 'main': main.c:15:20: error: 'tmxp' undeclared (first use in this function); did you mean 'tmp'? 15 | cup[change(y)]=tmxp; | ^~~~ | tmp main.c:15:20: note: each undeclared identifier is reported only once for each function it appears in
s280067124
p00047
C
include <stdio.h> #include <stdbool.h> #define conv(c) (int)(c-'A') void swap(bool *cup1, bool *cup2) { bool tmp = *cup1; *cup1 = *cup2; *cup2 = tmp; } int main() { char input_cup[10]; bool cups[3] = {true, false, false}; // while(~scanf("%c,%c", &cup1, &cup2)) while(fgets(input_cup, sizeof in/sizeof in[0], stdin)) swap(&cups[conv(cup1)], &cups[conv(cup2)]); int i; for(i = 0; i < 3; ++i) if(cups[i]){ printf("%c\n", (char)('A'+i)); break; } return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^ main.c: In function 'main': main.c:19:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 19 | while(fgets(input_cup, sizeof in/sizeof in[0], stdin)) | ^~~~~ main.c:19:33: error: 'in' undeclared (first use in this function); did you mean 'int'? 19 | while(fgets(input_cup, sizeof in/sizeof in[0], stdin)) | ^~ | int main.c:19:33: note: each undeclared identifier is reported only once for each function it appears in main.c:19:50: error: 'stdin' undeclared (first use in this function) 19 | while(fgets(input_cup, sizeof in/sizeof in[0], stdin)) | ^~~~~ main.c:3:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' 2 | #include <stdbool.h> +++ |+#include <stdio.h> 3 | main.c:20:5: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration] 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:20:21: error: 'cup1' undeclared (first use in this function); did you mean 'cups'? 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^ main.c:20:40: error: 'cup2' undeclared (first use in this function); did you mean 'cups'? 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^ main.c:25:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 25 | printf("%c\n", (char)('A'+i)); | ^~~~~~ main.c:25:7: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:25:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:25:7: note: include '<stdio.h>' or provide a declaration of 'printf'
s191204808
p00047
C
#include <stdio.h> #include <stdbool.h> #define conv(c) (int)(c-'A') void swap(bool *cup1, bool *cup2) { bool tmp = *cup1; *cup1 = *cup2; *cup2 = tmp; } int main() { char input_cup[10]; bool cups[3] = {true, false, false}; // while(~scanf("%c,%c", &cup1, &cup2)) while(fgets(input_cup, sizeof in/sizeof in[0], stdin)!=NULL) swap(&cups[conv(cup1)], &cups[conv(cup2)]); int i; for(i = 0; i < 3; ++i) if(cups[i]){ printf("%c\n", (char)('A'+i)); break; } return 0; }
main.c: In function 'main': main.c:19:33: error: 'in' undeclared (first use in this function); did you mean 'int'? 19 | while(fgets(input_cup, sizeof in/sizeof in[0], stdin)!=NULL) | ^~ | int main.c:19:33: note: each undeclared identifier is reported only once for each function it appears in main.c:20:21: error: 'cup1' undeclared (first use in this function); did you mean 'cups'? 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^ main.c:20:40: error: 'cup2' undeclared (first use in this function); did you mean 'cups'? 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^
s700665667
p00047
C
#include <stdio.h> #include <stdbool.h> #define conv(c) (int)(c-'A') void swap(bool *cup1, bool *cup2) { bool tmp = *cup1; *cup1 = *cup2; *cup2 = tmp; } int main() { char input_cup[10]; bool cups[3] = {true, false, false}; // while(~scanf("%c,%c", &cup1, &cup2)) while(fgets(input_cup, sizeof input_cup/sizeof input_cup[0], stdin)!=NULL) swap(&cups[conv(cup1)], &cups[conv(cup2)]); int i; for(i = 0; i < 3; ++i) if(cups[i]){ printf("%c\n", (char)('A'+i)); break; } return 0; }
main.c: In function 'main': main.c:20:21: error: 'cup1' undeclared (first use in this function); did you mean 'cups'? 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^ main.c:20:21: note: each undeclared identifier is reported only once for each function it appears in 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^ main.c:20:40: error: 'cup2' undeclared (first use in this function); did you mean 'cups'? 20 | swap(&cups[conv(cup1)], &cups[conv(cup2)]); | ^~~~ main.c:4:23: note: in definition of macro 'conv' 4 | #define conv(c) (int)(c-'A') | ^
s085042829
p00047
C
#include <stdio.h> #include <math.h> int main(){ char x[1], y[1]; int a[3], z, i, j; a[0] = 1; a[1] = a[2] = 0; while(scanf("%s,%s", &x[0], &y[0]) != EOF){ if(x[0] == 'A') i = 0; if(x[0] == 'B') i = 1; if(x[0] == 'C') i = 2; if(y[0] == 'A') j = 0; if(y[0] == 'B') j = 1; if(y[0] == 'C') j = 2; z = a[i]; a[i] = a[j]; a[j] = z; } if(a[0] == 1) printf("%s\n", A); if(a[1] == 1) printf("%s\n", B); if(a[2] == 1) printf("%s\n", C); return 0; }
main.c: In function 'main': main.c:20:38: error: 'A' undeclared (first use in this function) 20 | if(a[0] == 1) printf("%s\n", A); | ^ main.c:20:38: note: each undeclared identifier is reported only once for each function it appears in main.c:21:38: error: 'B' undeclared (first use in this function) 21 | if(a[1] == 1) printf("%s\n", B); | ^ main.c:22:38: error: 'C' undeclared (first use in this function) 22 | if(a[2] == 1) printf("%s\n", C); | ^
s475210331
p00047
C++
#include<iostream> #include<ios> using namespace std; char c='A'm\,a,b; main() { while(~scanf("%c,%c\n",&a,&b)) { if(a==c)c=b; } printf("%c\n",c); }
a.cc:4:12: error: stray '\' in program 4 | char c='A'm\,a,b; | ^ a.cc:4:8: error: unable to find character literal operator 'operator""m' with 'char' argument 4 | char c='A'm\,a,b; | ^~~~ a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~ a.cc: In function 'int main()': a.cc:7:29: error: 'a' was not declared in this scope 7 | while(~scanf("%c,%c\n",&a,&b)) | ^ a.cc:7:32: error: 'b' was not declared in this scope 7 | while(~scanf("%c,%c\n",&a,&b)) | ^
s785076260
p00047
C++
#include<iostream> using namespace std; int main(){ int a=1,b=0,c=0,tmp; char x,y; while(cin>>x>>y){ if(x=="A"){ if(y=="B"){ tmp = a; a = b; b = tmp; }else{ tmp = a; a = c; c = tmp; } }else if(x=="B"){ if(y=="A"){ tmp = a; a = b; b = tmp; }else{ tmp = b; b = c; c = tmp; } }else{ if(y=="A"){ tmp = a; a = c; c = tmp; }else{ tmp = b; b = c; c = tmp; } } } if(a==1){ cout << "A" << endl; }else if(b==1){ cout << "B" << endl; }else{ cout << "C" << endl; } } }
a.cc: In function 'int main()': a.cc:9:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if(x=="A"){ | ~^~~~~ a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(y=="B"){ | ~^~~~~ a.cc:19:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 19 | }else if(x=="B"){ | ~^~~~~ a.cc:20:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 20 | if(y=="A"){ | ~^~~~~ a.cc:30:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 30 | if(y=="A"){ | ~^~~~~ a.cc: At global scope: a.cc:49:5: error: expected declaration before '}' token 49 | } | ^
s994916406
p00047
C++
#include<iostream> #include<string> using namespace std; int main() { int A = 1; int B = 0; int C = 0; while(true){ string s; cin >> s; if (s[0]=='A'){ if(s[2]=='B'){ int tmp; tmp = B; B = A; A = tmp; } else if(s[2]=='C'){ int tmp; tmp = C; C = A; A = tmp; } } if (s[0]=='B'){ if(s[2]=='A'){ int tmp; tmp = A; A = B; B = tmp; } else if(s[2]=='C'){ int tmp; tmp = C; C = B; B = tmp; } } else if (s[0]=='C'){ if(s[2]=='A'){ int tmp; tmp = A; A = C; C = tmp; } else if(s[2]=='B'){ int tmp; tmp = B; B = C; C = tmp; } } } if (A==1){ cout << "A" << endl; } else if (B==1){ cout << "B" << endl; } else if (c==1){ cout << "C" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:61:14: error: 'c' was not declared in this scope 61 | else if (c==1){ | ^
s023927650
p00047
C++
#include<iostream> using namespace std; int main(){ int A,B,C,x,y,s,t,u; A=1,B=2,C=3; while(cin>>x","y){ if((x==A && y==B)||(x==B && y==A)){ s=A; A=B; B=z; }else if((x==B && y==C)||(x==C && y==B)){ t=B; B=C; C=t; }else if((x==C && y==A)||(x==A && y==C)){ u=C; C=A; A=u; } } if(A==1){A=A} else if(A==2){A=B} else if(A==3){A=C}; cout << A << endl; }
a.cc: In function 'int main()': a.cc:8:21: error: expected ')' before user-defined string literal 8 | while(cin>>x","y){ | ~ ^~~~ | ) a.cc:8:21: error: unable to find string literal operator 'operator""y' with 'const char [2]', 'long unsigned int' arguments 8 | while(cin>>x","y){ | ^~~~ a.cc:23:21: error: expected ';' before '}' token 23 | if(A==1){A=A} | ^ | ; a.cc:24:26: error: expected ';' before '}' token 24 | else if(A==2){A=B} | ^ | ; a.cc:25:26: error: expected ';' before '}' token 25 | else if(A==3){A=C}; | ^ | ;
s648216939
p00047
C++
#include<iostream> #include<string> using namespace std; int main() { int A = 1; int B = 0; int C = 0; string s; while(cin >> s){ if (s[0]=='A'){ if(s[2]=='B'){ int tmp; tmp = B; B = A; A = tmp; } else if(s[2]=='C'){ int tmp; tmp = C; C = A; A = tmp; } } if (s[0]=='B'){ if(s[2]=='A'){ int tmp; tmp = A; A = B; B = tmp; } else if(s[2]=='C'){ int tmp; tmp = C; C = B; B = tmp; } } else if (s[0]=='C'){ if(s[2]=='A'){ int tmp; tmp = A; A = C; C = tmp; } else if(s[2]=='B'){ int tmp; tmp = B; B = C; C = tmp; } } } if (A==1){ cout << "A" << endl; } else if (B==1){ cout << "B" << endl; } else if (c==1){ cout << "C" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:60:14: error: 'c' was not declared in this scope 60 | else if (c==1){ | ^
s060269405
p00047
C++
#include<iostream> #include<string> using namespace std; int main() { int A = 1; int B = 0; int C = 0; string s; while(cin >> s){ if (s[0]=='A'){ if(s[2]=='B'){ int tmp; tmp = B; B = A; A = tmp; } else if(s[2]=='C'){ int tmp; tmp = C; C = A; A = tmp; } } if (s[0]=='B'){ if(s[2]=='A'){ int tmp; tmp = A; A = B; B = tmp; } else if(s[2]=='C'){ int tmp; tmp = C; C = B; B = tmp; } } else if (s[0]=='C'){ if(s[2]=='A'){ int tmp; tmp = A; A = C; C = tmp; } else if(s[2]=='B'){ int tmp; tmp = B; B = C; C = tmp; } } } if (A==1){ cout << "A" << endl; } else if (B==1){ cout << "B" << endl; } else if (c==1){ cout << "C" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:60:14: error: 'c' was not declared in this scope 60 | else if (c==1){ | ^
s018284878
p00047
C++
#include<iostream> using namespace std; int main(){ char x,y,z; int i,n; for(i=0;i<=n;++i){ cin >> x >> y; if (x==A){ z=x; } else if(y==A){ z=y; } else { z=z; } } cout << z << endl; return 0;}
a.cc: In function 'int main()': a.cc:9:10: error: 'A' was not declared in this scope 9 | if (x==A){ | ^
s174611703
p00047
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s691641143
p00047
C++
#include<iostream> #include<string> using namespace std; int main(){ int A,B,C,s,t,u; string x; A=1,B=2,C=3; while(cin>>x){ if((x==(A,B))||(x==(B,A))){ s=A; A=B; B=z; }else if((x==(C,B))||(x==(B,C))){ t=B; B=C; C=t; }else if((x==(A,C))||(x==(C,A))){ u=C; C=A; A=u; } } if(A==1){A=A; }else if(A==2){A=B; }else if(A==3){A=C; }; cout << A << endl; }
a.cc: In function 'int main()': a.cc:11:22: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 11 | if((x==(A,B))||(x==(B,A))){ | ~^~~~~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:11:28: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:11:28: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:11:28: note: mismatched types 'const _CharT*' and 'int' 11 | if((x==(A,B))||(x==(B,A))){ | ^ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:11:28: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 11 | if((x==(A,B))||(x==(B,A))){ | ^ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed: a.cc:11:28: note:
s972706265
p00047
C++
B,C A,C C,B A,B C,B
a.cc:1:1: error: 'B' does not name a type 1 | B,C | ^
s040868730
p00047
C++
#include<stdio.h> int main(){ char x,y,T=A,tmp; while(scanf("%c,%c",&x,&y)!=EOF{ if(x==T)T=y; else if(y==T)T=x; } printf("%c\n",T); return 0; }
a.cc: In function 'int main()': a.cc:4:12: error: 'A' was not declared in this scope 4 | char x,y,T=A,tmp; | ^ a.cc:5:32: error: expected ')' before '{' token 5 | while(scanf("%c,%c",&x,&y)!=EOF{ | ~ ^
s044741645
p00047
C++
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main(){ int a,b; char cup1,cup2,abc[2][3]={{'A','B','C'},{'1','0','0'}}; while(scanf("%c,%c",&cup1,&cup2)!EOF){ for(int i=0;i<3;i++){ if(abc[0][i]==cup1) a=i; if(abc[0][i]==cup2) b=i; } swap(abc[1][a],abc[1][b]); } for(int i=0;i<3;i++){ if(abc[1][i]=='1'){ printf("%c\n",abc[0][i]); } } return 0; }
a.cc: In function 'int main()': a.cc:8:37: error: expected ')' before '!' token 8 | while(scanf("%c,%c",&cup1,&cup2)!EOF){ | ~ ^ | ) a.cc:8:41: error: expected ';' before ')' token 8 | while(scanf("%c,%c",&cup1,&cup2)!EOF){ | ^
s774625827
p00047
C++
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main(){ int cup[3] = {1}; int x, y; while (scanf(" %d,%d", &x, &y) != EOF) { swap(cup[a - 'A'], cup[b - 'A']); } for (int i = 0; i < 3; i++) { if (cup[i] > 0) { printf("%c\n", 'A' + i); break; } } return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: 'a' was not declared in this scope 10 | swap(cup[a - 'A'], cup[b - 'A']); | ^ a.cc:10:32: error: 'b' was not declared in this scope 10 | swap(cup[a - 'A'], cup[b - 'A']); | ^
s510459249
p00047
C++
#include <iostream> using namespace std; int main(){ int i, j, tmp, a[3]={1, 0, 0}; char s1, s2, kanma; while(1){ cin>>s1>>kanma>>s2; if(cin.eof())break; if(s1=='A'||s2=='A'){ i=0; if(s1=='B'||s2=='B') j=1; else j=2; } else if(s1=='B'||s2=='B'){ i=1; if(s1=='C'||s2=='C') j=2; else j=0; } else if(s1=='C'||s2=='C'){ i=2; if(s1=='A'||s2=='A') j=0; else j=1; } tmp=a[i]; a[i]=a[j]; a[j]=tmp; } if(a[0]==1) cout<<"A\n"; else if(a[1]==1) cout<<"B\n"; else if(a[2]==1) cout<<"C\n"; return 0;
a.cc: In function 'int main()': a.cc:47:18: error: expected '}' at end of input 47 | return 0; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s865501603
p00047
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main() { char x, y; string str; int posi = 1; while (cin >> str) { x = str[0]; y = str[2]; (char)x = min((int)x, (int)y); (char)y = max((int)x, (int)y); if (posi == 1) { if (x == 'A' && y == 'B')posi = 2; else if (x == 'A' && y == 'C')posi = 3; } else if (posi == 2) { if (x == 'A' && y == 'B')posi = 1; else if (x == 'B' && y == 'C')posi = 3; } else if (posi == 3) { if (x == 'A' && y == 'C')posi = 1; else if (x == 'B' && y == 'C')posi = 2; } } //cout << (posi == 1 ? "A" : (posi == 2 ? "B" : "C")) << endl; if (posi == 1)cout << "A" << endl; else if (posi == 2)cout << "B" << endl; else if (posi == 3)cout << "C" << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: lvalue required as left operand of assignment 14 | (char)x = min((int)x, (int)y); | ^~~~~~~ a.cc:15:17: error: lvalue required as left operand of assignment 15 | (char)y = max((int)x, (int)y); | ^~~~~~~
s838106099
p00047
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main() { char x, y; string str; int posi = 1; while (cin >> str) { x = str[0]; y = str[2]; (char)x = min((int)x, (int)y); //(char)y = max((int)x, (int)y); if (posi == 1) { if (x == 'A' && y == 'B')posi = 2; else if (x == 'A' && y == 'C')posi = 3; } else if (posi == 2) { if (x == 'A' && y == 'B')posi = 1; else if (x == 'B' && y == 'C')posi = 3; } else if (posi == 3) { if (x == 'A' && y == 'C')posi = 1; else if (x == 'B' && y == 'C')posi = 2; } } if (posi == 1)cout << "A" << endl; else if (posi == 2)cout << "B" << endl; else if (posi == 3)cout << "C" << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: lvalue required as left operand of assignment 14 | (char)x = min((int)x, (int)y); | ^~~~~~~
s470665155
p00047
C++
#include<iostream> #include<algorithm> #include<map> using namespace std; int main(){ map<char, int> cup; cup['A'] = 1; cup['B'] = 0; cup['C'] = 0; char c1, c2, delim; while( cin >> c1 >> delim >> c2 ){ swap(cup['c1'] , cup['c2']); } if( cup['A'] = 1) cout << A << '?\n'; if( cup['B'] = 1) cout << B << '?\n'; if( cup['C'] = 1) cout << C << '?\n'; }
a.cc:12:26: warning: multi-character character constant [-Wmultichar] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:12:38: warning: multi-character character constant [-Wmultichar] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:14:44: warning: multi-character character constant [-Wmultichar] 14 | if( cup['A'] = 1) cout << A << '?\n'; | ^~~~~ a.cc:15:44: warning: multi-character character constant [-Wmultichar] 15 | if( cup['B'] = 1) cout << B << '?\n'; | ^~~~~ a.cc:16:44: warning: multi-character character constant [-Wmultichar] 16 | if( cup['C'] = 1) cout << C << '?\n'; | ^~~~~ a.cc: In function 'int main()': a.cc:12:26: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25393' to '49' [-Woverflow] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:12:38: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25394' to '50' [-Woverflow] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:14:39: error: 'A' was not declared in this scope 14 | if( cup['A'] = 1) cout << A << '?\n'; | ^ a.cc:15:39: error: 'B' was not declared in this scope 15 | if( cup['B'] = 1) cout << B << '?\n'; | ^ a.cc:16:39: error: 'C' was not declared in this scope 16 | if( cup['C'] = 1) cout << C << '?\n'; | ^
s433587058
p00047
C++
#include<iostream> #include<algorithm> #include<map> using namespace std; int main(){ map<char, int> cup; cup['A'] = 1; cup['B'] = 0; cup['C'] = 0; char c1, c2, delim; while( cin >> c1 >> delim >> c2 ){ swap(cup['c1'] , cup['c2']); } if( cup['A'] == 1) cout << A << '?\n'; if( cup['B'] == 1) cout << B << '?\n'; if( cup['C'] == 1) cout << C << '?\n'; }
a.cc:12:26: warning: multi-character character constant [-Wmultichar] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:12:38: warning: multi-character character constant [-Wmultichar] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:14:45: warning: multi-character character constant [-Wmultichar] 14 | if( cup['A'] == 1) cout << A << '?\n'; | ^~~~~ a.cc:15:45: warning: multi-character character constant [-Wmultichar] 15 | if( cup['B'] == 1) cout << B << '?\n'; | ^~~~~ a.cc:16:45: warning: multi-character character constant [-Wmultichar] 16 | if( cup['C'] == 1) cout << C << '?\n'; | ^~~~~ a.cc: In function 'int main()': a.cc:12:26: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25393' to '49' [-Woverflow] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:12:38: warning: overflow in conversion from 'int' to 'std::map<char, int>::key_type' {aka 'char'} changes value from '25394' to '50' [-Woverflow] 12 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:14:40: error: 'A' was not declared in this scope 14 | if( cup['A'] == 1) cout << A << '?\n'; | ^ a.cc:15:40: error: 'B' was not declared in this scope 15 | if( cup['B'] == 1) cout << B << '?\n'; | ^ a.cc:16:40: error: 'C' was not declared in this scope 16 | if( cup['C'] == 1) cout << C << '?\n'; | ^
s110163560
p00047
C++
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int main(){ map<string, int> cup; cup["A"] = 1; cup["B"] = 0; cup["C"] = 0; char c1, c2, delim; while( cin >> c1 >> delim >> c2 ){ swap(cup["c1"] , cup["c2"]); } if(cup["A"] == 1) cout << A << '?\n'; if(cup["B"] == 1) cout << B << '?\n'; if(cup["C"] == 1) cout << C << '?\n'; }
a.cc:15:40: warning: multi-character character constant [-Wmultichar] 15 | if(cup["A"] == 1) cout << A << '?\n'; | ^~~~~ a.cc:16:40: warning: multi-character character constant [-Wmultichar] 16 | if(cup["B"] == 1) cout << B << '?\n'; | ^~~~~ a.cc:17:40: warning: multi-character character constant [-Wmultichar] 17 | if(cup["C"] == 1) cout << C << '?\n'; | ^~~~~ a.cc: In function 'int main()': a.cc:15:35: error: 'A' was not declared in this scope 15 | if(cup["A"] == 1) cout << A << '?\n'; | ^ a.cc:16:35: error: 'B' was not declared in this scope 16 | if(cup["B"] == 1) cout << B << '?\n'; | ^ a.cc:17:35: error: 'C' was not declared in this scope 17 | if(cup["C"] == 1) cout << C << '?\n'; | ^
s361323907
p00047
C++
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int main(){ map<string, int> cup; cup["A"] = 1; cup["B"] = 0; cup["C"] = 0; char c1, c2, delim; while( cin >> c1 >> delim >> c2 ){ swap(cup["c1"] , cup["c2"]); } if(cup["A"] == 1) cout << A << '?\n'; if(cup["B"] == 1) cout << B << '?\n'; if(cup["C"] == 1) cout << C << '?\n'; }
a.cc:15:40: warning: multi-character character constant [-Wmultichar] 15 | if(cup["A"] == 1) cout << A << '?\n'; | ^~~~~ a.cc:16:40: warning: multi-character character constant [-Wmultichar] 16 | if(cup["B"] == 1) cout << B << '?\n'; | ^~~~~ a.cc:17:40: warning: multi-character character constant [-Wmultichar] 17 | if(cup["C"] == 1) cout << C << '?\n'; | ^~~~~ a.cc: In function 'int main()': a.cc:15:35: error: 'A' was not declared in this scope 15 | if(cup["A"] == 1) cout << A << '?\n'; | ^ a.cc:16:35: error: 'B' was not declared in this scope 16 | if(cup["B"] == 1) cout << B << '?\n'; | ^ a.cc:17:35: error: 'C' was not declared in this scope 17 | if(cup["C"] == 1) cout << C << '?\n'; | ^
s372217765
p00047
C++
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int main(){ map<string, int> cup; cup["A"] = 1; cup["B"] = 0; cup["C"] = 0; string c1, c2; char delim; while( cin >> c1 >> delim >> c2 ){ swap(cup["c1"] , cup["c2"]); } if(cup["A"] == 1) cout << A << '?\n'; if(cup["B"] == 1) cout << B << '?\n'; if(cup["C"] == 1) cout << C << '?\n'; }
a.cc:16:40: warning: multi-character character constant [-Wmultichar] 16 | if(cup["A"] == 1) cout << A << '?\n'; | ^~~~~ a.cc:17:40: warning: multi-character character constant [-Wmultichar] 17 | if(cup["B"] == 1) cout << B << '?\n'; | ^~~~~ a.cc:18:40: warning: multi-character character constant [-Wmultichar] 18 | if(cup["C"] == 1) cout << C << '?\n'; | ^~~~~ a.cc: In function 'int main()': a.cc:16:35: error: 'A' was not declared in this scope 16 | if(cup["A"] == 1) cout << A << '?\n'; | ^ a.cc:17:35: error: 'B' was not declared in this scope 17 | if(cup["B"] == 1) cout << B << '?\n'; | ^ a.cc:18:35: error: 'C' was not declared in this scope 18 | if(cup["C"] == 1) cout << C << '?\n'; | ^
s574786518
p00047
C++
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int main(){ map<string, int> cup; cup["A"] = 1; cup["B"] = 0; cup["C"] = 0; char c1, c2, delim; while( cin >> c1 >> delim >> c2 ){ swap(cup['c1'] , cup['c2']); } if(cup["A"] == 1) cout << "A" << '?\n'; if(cup["B"] == 1) cout << "B" << '?\n'; if(cup["C"] == 1) cout << "C" << '?\n'; }
a.cc:13:26: warning: multi-character character constant [-Wmultichar] 13 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:13:38: warning: multi-character character constant [-Wmultichar] 13 | swap(cup['c1'] , cup['c2']); | ^~~~ a.cc:15:42: warning: multi-character character constant [-Wmultichar] 15 | if(cup["A"] == 1) cout << "A" << '?\n'; | ^~~~~ a.cc:16:42: warning: multi-character character constant [-Wmultichar] 16 | if(cup["B"] == 1) cout << "B" << '?\n'; | ^~~~~ a.cc:17:42: warning: multi-character character constant [-Wmultichar] 17 | if(cup["C"] == 1) cout << "C" << '?\n'; | ^~~~~ a.cc: In function 'int main()': a.cc:13:25: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int') 13 | swap(cup['c1'] , cup['c2']); | ^ In file included from /usr/include/c++/14/map:63, from a.cc:4: /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from 'int' to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~ a.cc:13:37: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int') 13 | swap(cup['c1'] , cup['c2']); | ^ /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from 'int' to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~
s890591172
p00047
C++
#include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int main(){ map<string, int> cup; cup["A"] = 1; cup["B"] = 0; cup["C"] = 0; char c1, c2, delim; while( cin >> c1 >> delim >> c2 ){ swap(cup["c1"] , cup["c2"]); } cout << cup.at(1) << endl; }
a.cc: In function 'int main()': a.cc:15:23: error: no matching function for call to 'std::map<std::__cxx11::basic_string<char>, int>::at(int)' 15 | cout << cup.at(1) << endl; | ~~~~~~^~~ In file included from /usr/include/c++/14/map:63, from a.cc:4: /usr/include/c++/14/bits/stl_map.h:549:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 549 | at(const key_type& __k) | ^~ /usr/include/c++/14/bits/stl_map.h:549:26: note: no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'} 549 | at(const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:558:7: note: candidate: 'const std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 558 | at(const key_type& __k) const | ^~ /usr/include/c++/14/bits/stl_map.h:558:26: note: no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'} 558 | at(const key_type& __k) const | ~~~~~~~~~~~~~~~~^~~
s425483181
p00047
C++
#include<iostream> using namespace std; int main(){ char c1, c2, delim, ball = 'A'; while(cin >> c1 >> delim >> c2){ if(ball == c1) ball == c2; else if(ball == c2) ball == c1; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | cout << ans << endl; | ^~~ | abs
s330280335
p00047
C++
import sys def convert(s): x = 0 if s == "A": x = 0 elif s == "B": x = 1 elif s == "C": x = 2 return x def main(): A = [0 for i in range(3)] A[0] = 1 for line in sys.stdin: B = line.split(",") B[0] = convert(B[0]) B[1] = B[1].replace("\n", "") B[1] = convert(B[1]) tmp = A[B[0]] A[B[0]] = A[B[1]] A[B[1]] = tmp S = ["A", "B", "C"] for i in range(3): if A[i] == 1: print(S[i]) if __name__ == "__main__": main()
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s044481936
p00047
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s140036570
p00047
C++
#include<iostream> #include<string> using namespace std; int main() { int cup[3] = {1,0,0}; string cupa("A"); string cupb("B"); string cupc("C"); string swapping; int a = 0; int b = 100; while (cin >> swapping){ int temp; if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ temp = cup[0]; cup[0] = cup[1]; cup[1] = temp; } else if(swapping[0] == cupa && swapping[2] == cupc || swapping[0] == cupc && swapping[2] == cupa){ temp = cup[0]; cup[0] = cup[2]; cup[2] = temp; } else if(swapping[0] == cupb && swapping[2] == cupc || swapping[0] == cupc && swapping[2] == cupb){ temp = cup[1]; cup[1] = cup[2]; cup[2] = temp; } } if(cup[0] == 1){ cout<<cupa<<endl; } else if(cup[1] == 1){ cout<<cupb<<endl; } else if(cup[2] == 1){ cout<<cupc<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:20: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::fpos<_StateT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::allocator<_CharT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::pair<_T1, _T2>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:19:23: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const _CharT*' and 'char' 19 | if(swapping[0] == cupa && swapping[2] == cupb || swapping[0] == cupb && swapping[2] == cupa){ | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t,
s996942165
p00047
C++
#include<iostream> #include<string> using namespace std; int main() { int cup[3] = {1,0,0}; string cupab("A,B"); string cupba("B,A"); string cupac("A,C"); string cupca("C,A"); string cupbc("B,C"); string cupcb("C,B"); string swapping; while (cin >> swapping){ int temp; if(swapping == cupab || swapping == cupba){ temp = cup[0]; cup[0] = cup[1]; cup[1] = temp; } else if(swapping == cupac || swapping == cupca){ temp = cup[0]; cup[0] = cup[2]; cup[2] = temp; } else if(swapping == cupbc || swapping == cupcb){ temp = cup[1]; cup[1] = cup[2]; cup[2] = temp; } cout<<cup[0]<<cup[1]<<cup[2]<<endl; } if(cup[0] == 1){ cout<<"A"<<endl; } else if(cup[1] == 1){ cout<<"B"<<endl; } else if(cup[2] == 1){ cout<<"C"<<endl; } return 0; }#include<iostream> #include<string> using namespace std; int main() { int cup[3] = {1,0,0}; string cupab("A,B"); string cupba("B,A"); string cupac("A,C"); string cupca("C,A"); string cupbc("B,C"); string cupcb("C,B"); string swapping; while (cin >> swapping){ int temp; if(swapping == cupab || swapping == cupba){ temp = cup[0]; cup[0] = cup[1]; cup[1] = temp; } else if(swapping == cupac || swapping == cupca){ temp = cup[0]; cup[0] = cup[2]; cup[2] = temp; } else if(swapping == cupbc || swapping == cupcb){ temp = cup[1]; cup[1] = cup[2]; cup[2] = temp; } cout<<cup[0]<<cup[1]<<cup[2]<<endl; } if(cup[0] == 1){ cout<<"A"<<endl; } else if(cup[1] == 1){ cout<<"B"<<endl; } else if(cup[2] == 1){ cout<<"C"<<endl; } return 0; }
a.cc:48:2: error: stray '#' in program 48 | }#include<iostream> | ^ a.cc:48:3: error: 'include' does not name a type 48 | }#include<iostream> | ^~~~~~~ a.cc:53:5: error: redefinition of 'int main()' 53 | int main() | ^~~~ a.cc:6:5: note: 'int main()' previously defined here 6 | int main() | ^~~~
s145780911
p00047
C++
#include<bits/stdc++.h> using namespace std; #define all(vec) vec.begin(),vec.end() typedef long long int ll; typedef pair<int,int> P; const ll MOD=1000000007; const ll INF=1000000010; const ll LINF=4000000000000000010LL; const int MAX=310; const double EPS=1e-9; int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; int main(){ char a,b; int ans=0; char c[3]={'A','B','C'}; while(scanf("%c,%c",a,b)){ nt aa,bb; if(a=='A'){ aa=0; }else if(a=='B'){ aa=1; }else{ aa=2; } if(b=='A'){ bb=0; }else if(b=='B'){ bb=1; }else{ bb=2; } if(aa==ans){ ans=bb; }else if(bb==ans){ ans=aa; } } cout<<c[ans]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:9: error: 'nt' was not declared in this scope; did you mean 'int'? 18 | nt aa,bb; | ^~ | int a.cc:20:13: error: 'aa' was not declared in this scope; did you mean 'a'? 20 | aa=0; | ^~ | a a.cc:22:13: error: 'aa' was not declared in this scope; did you mean 'a'? 22 | aa=1; | ^~ | a a.cc:24:13: error: 'aa' was not declared in this scope; did you mean 'a'? 24 | aa=2; | ^~ | a a.cc:27:13: error: 'bb' was not declared in this scope; did you mean 'b'? 27 | bb=0; | ^~ | b a.cc:29:13: error: 'bb' was not declared in this scope; did you mean 'b'? 29 | bb=1; | ^~ | b a.cc:31:13: error: 'bb' was not declared in this scope; did you mean 'b'? 31 | bb=2; | ^~ | b a.cc:33:12: error: 'aa' was not declared in this scope; did you mean 'a'? 33 | if(aa==ans){ | ^~ | a a.cc:34:17: error: 'bb' was not declared in this scope; did you mean 'b'? 34 | ans=bb; | ^~ | b a.cc:35:18: error: 'bb' was not declared in this scope; did you mean 'b'? 35 | }else if(bb==ans){ | ^~ | b
s710863202
p00047
C++
B,C A,C C,B A,B C,B
a.cc:1:1: error: 'B' does not name a type 1 | B,C | ^
s776875210
p00047
C++
#include <iostream> using namespace std; int main(){ int a[3]={1,0,0},b;char c[3]; while(cin>>c){ b=a[(c[0]-'A')]; a[c[0]-'A']=a[(c[2]-'A')]; a[(c[2]-'A')]=b; } for(b=0;i<3;i++)if(a[i])cout<<(char)('A'+i)<<endl; }
a.cc: In function 'int main()': a.cc:10:11: error: 'i' was not declared in this scope 10 | for(b=0;i<3;i++)if(a[i])cout<<(char)('A'+i)<<endl; | ^
s360630100
p00047
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ char k; string a="A",b="B",c="C" int i,j,A=1,B=0,C=0; while(cin>>i>>k>>j){ if((i =='A' && j=='B')||(i=='B' && j=='A')) swap(A,B); if((i =='B' && j=='C')||(i=='C' && j=='B')) swap(B,C); if((i =='A' && j=='C')||(i=='C' && j=='A')) swap(A,C); } if(A==1) cout<<a<<endl; else if(B==1) cout<<b<<endl; else if(C==1) cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:8:9: error: expected ',' or ';' before 'int' 8 | int i,j,A=1,B=0,C=0; | ^~~ a.cc:9:20: error: 'i' was not declared in this scope 9 | while(cin>>i>>k>>j){ | ^ a.cc:9:26: error: 'j' was not declared in this scope 9 | while(cin>>i>>k>>j){ | ^ a.cc:10:66: error: 'A' was not declared in this scope 10 | if((i =='A' && j=='B')||(i=='B' && j=='A')) swap(A,B); | ^ a.cc:10:68: error: 'B' was not declared in this scope 10 | if((i =='A' && j=='B')||(i=='B' && j=='A')) swap(A,B); | ^ a.cc:11:66: error: 'B' was not declared in this scope 11 | if((i =='B' && j=='C')||(i=='C' && j=='B')) swap(B,C); | ^ a.cc:11:68: error: 'C' was not declared in this scope 11 | if((i =='B' && j=='C')||(i=='C' && j=='B')) swap(B,C); | ^ a.cc:12:66: error: 'A' was not declared in this scope 12 | if((i =='A' && j=='C')||(i=='C' && j=='A')) swap(A,C); | ^ a.cc:12:68: error: 'C' was not declared in this scope 12 | if((i =='A' && j=='C')||(i=='C' && j=='A')) swap(A,C); | ^ a.cc:14:12: error: 'A' was not declared in this scope 14 | if(A==1) cout<<a<<endl; | ^ a.cc:15:17: error: 'B' was not declared in this scope 15 | else if(B==1) cout<<b<<endl; | ^ a.cc:16:17: error: 'C' was not declared in this scope 16 | else if(C==1) cout<<c<<endl; | ^
s622920588
p00047
C++
#include <iostream> using namespace std; int main() { char c[5]; char n[] = "A"; while(cin>>c){ if(c[0]==n[0]) n[0] = c[2]; else if( c[2] == n[0] ) n[0] = c[0]; } putchar(n[0]); putcharendl); return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'putcharendl' was not declared in this scope; did you mean 'putchar'? 12 | putcharendl); | ^~~~~~~~~~~ | putchar
s727282004
p00047
C++
#include <iostream> #include <algorithm> using namespace std; int a[3]; int main() { a[0] = 1; char c1,c2; while(cin >> c1){ cin.ignore(); cin >> c2; swap(a[c1 - 'A'],a[c2 - 'A']); } } for(int i = 0; i < 3; ++i){ if(a[i])cout << (char)('A' + i) << endl; } }
a.cc:17:9: error: expected unqualified-id before 'for' 17 | for(int i = 0; i < 3; ++i){ | ^~~ a.cc:17:24: error: 'i' does not name a type 17 | for(int i = 0; i < 3; ++i){ | ^ a.cc:17:31: error: expected unqualified-id before '++' token 17 | for(int i = 0; i < 3; ++i){ | ^~ a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s239297678
p00047
C++
#include<iostream> using namespace std; int main(){ string str; ch n,m; int a=1,b=0,c=0,d; while(cin>>str){ n=str[0];m=str[2]; if(n=='A'&&m=='B'){ d=a;a=b;b=d; }else if(n=='A'&&m=='C'){ d=a;a=c;c=d; }else if(n=='B'&&m=='A'){ d=b;b=a;a=d; }else if(n=='B'&&m=='C'){ d=b;b=c;c=d; }else if(n=='C'&&m=='A'){ d=c;c=a;a=d; }else{ d=c;c=b;b=d; } } if(a)cout<<'A'<<endl; if(b)cout<<'B'<<endl; if(c)cout<<'C'<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'ch' was not declared in this scope 5 | ch n,m; | ^~ a.cc:8:17: error: 'n' was not declared in this scope 8 | n=str[0];m=str[2]; | ^ a.cc:8:26: error: 'm' was not declared in this scope 8 | n=str[0];m=str[2]; | ^
s724979731
p00047
C++
using namespace std; int main(){ bool existBall[3] = { 1, 0, 0 }; bool tm; char a, b; string s; while (getline(cin, s), s != "\0"){ a = s[0]; b = s[2]; tm = existBall[b - 'A']; existBall[b - 'A'] = existBall[a - 'A']; existBall[a - 'A'] = tm; } s = ""; for (int i = 0; i < 3;++i) if (existBall[i]) cout << s + (char)('A' + i) << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'string' was not declared in this scope 8 | string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:10:24: error: 'cin' was not declared in this scope 10 | while (getline(cin, s), s != "\0"){ | ^~~ 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:10:29: error: 's' was not declared in this scope 10 | while (getline(cin, s), s != "\0"){ | ^ a.cc:10:16: error: 'getline' was not declared in this scope 10 | while (getline(cin, s), s != "\0"){ | ^~~~~~~ a.cc:20:9: error: 's' was not declared in this scope 20 | s = ""; | ^ a.cc:23:17: error: 'cout' was not declared in this scope 23 | cout << s + (char)('A' + i) << endl; | ^~~~ a.cc:23:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:23:48: error: 'endl' was not declared in this scope 23 | cout << s + (char)('A' + i) << 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;
s899849912
p00048
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ double x = sc.nextDouble(); System.out.println(x<=48.00?"light fly":x<=51.00?"fly":x<=54.00?"bantam":x<=57.00?"feather": x<=60.00?"light":x<=64.00?"light welter":x<=69.00?"welter": x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":x>=91.00?"heavy"); } } }
Main.java:11: error: : expected x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":x>=91.00?"heavy"); ^ 1 error
s592690079
p00048
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ double x = sc.nextDouble(); System.out.println(x<=48.00?"light fly":x<=51.00?"fly":x<=54.00?"bantam":x<=57.00?"feather": x<=60.00?"light":x<=64.00?"light welter":x<=69.00?"welter": x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":x>=91.00?"heavy"); } } }
Main.java:11: error: : expected x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":x>=91.00?"heavy"); ^ 1 error
s441750758
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new ImputStreamReader(System.in)); String line=""; double weight; while((line=br.readLine())!=null){ weight=Double.parseDouble(line); classOfBoxing(weight); } } private static void classOfBoxing(double w){ PrintWriter p=new PrintWriter(System.out); if(w<=48){ p.println("light fly"); } else if(w<=51){ p.println("fly"); } else if(w<=54){ p.println("bantam"); } else if(w<=57){ p.println("feather"); } else if(w<=60){ p.println("light"); } else if(w<=64){ p.println("light welter"); } else if(w<=69){ p.println("welter"); } else if(w<=75){ p.println("light middle"); } else if(w<=81){ p.println("middle"); } else if(w<=91){ p.println("light heavy"); } else{ p.println("heavy"); } }
Main.java:48: error: reached end of file while parsing } ^ 1 error
s475399505
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new ImputStreamReader(System.in)); String line=""; double weight; while((line=br.readLine())!=null){ weight=Double.parseDouble(line); classOfBoxing(weight); } } private static void classOfBoxing(double w){ PrintWriter p=new PrintWriter(System.out); if(w<=48){ p.println("light fly"); } else if(w<=51){ p.println("fly"); } else if(w<=54){ p.println("bantam"); } else if(w<=57){ p.println("feather"); } else if(w<=60){ p.println("light"); } else if(w<=64){ p.println("light welter"); } else if(w<=69){ p.println("welter"); } else if(w<=75){ p.println("light middle"); } else if(w<=81){ p.println("middle"); } else if(w<=91){ p.println("light heavy"); } else{ p.println("heavy"); } } }
Main.java:5: error: cannot find symbol BufferedReader br=new BufferedReader(new ImputStreamReader(System.in)); ^ symbol: class ImputStreamReader location: class Main 1 error
s201629817
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; float weight; while((line=br.readLine())!=null){ weight=Float.parseFloat(line); classOfBoxing(weight); } } private static void classOfBoxing(float w){ PrintWriter p=new PrintWriter(System.out); w=Math.ceil(w); if(w<=48){ p.println("light fly"); } else if(w<=51){ p.println("fly"); } else if(w<=54){ p.println("bantam"); } else if(w<=57){ p.println("feather"); } else if(w<=60){ p.println("light"); } else if(w<=64){ p.println("light welter"); } else if(w<=69){ p.println("welter"); } else if(w<=75){ p.println("light middle"); } else if(w<=81){ p.println("middle"); } else if(w<=91){ p.println("light heavy"); } else{ p.println("heavy"); } } }
Main.java:15: error: incompatible types: possible lossy conversion from double to float w=Math.ceil(w); ^ 1 error
s267343257
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; float weight; while((line=br.readLine())!=null){ weight=Float.parseFloat(line); classOfBoxing(weight); } } private static void classOfBoxing(float w){ PrintWriter p=new PrintWriter(System.out); w=Math.ceil((double)w); if(w<=48){ p.println("light fly"); } else if(w<=51){ p.println("fly"); } else if(w<=54){ p.println("bantam"); } else if(w<=57){ p.println("feather"); } else if(w<=60){ p.println("light"); } else if(w<=64){ p.println("light welter"); } else if(w<=69){ p.println("welter"); } else if(w<=75){ p.println("light middle"); } else if(w<=81){ p.println("middle"); } else if(w<=91){ p.println("light heavy"); } else{ p.println("heavy"); } } }
Main.java:15: error: incompatible types: possible lossy conversion from double to float w=Math.ceil((double)w); ^ 1 error
s707263782
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; d weioubleght; while((line=br.readLine())!=null){ weight=Double.parseDouble(line); classOfBoxing(weight); } } private static void classOfBoxing(double w){ PrintWriter p=new PrintWriter(System.out); if(w<=48.0){ p.println("light fly"); } else if(w<=51.0){ p.println("fly"); } else if(w<=54.0){ p.println("bantam"); } else if(w<=57.0){ p.println("feather"); } else if(w<=60.0){ p.println("light"); } else if(w<=64.0){ p.println("light welter"); } else if(w<=69.0){ p.println("welter"); } else if(w<=75.0){ p.println("light middle"); } else if(w<=81.0){ p.println("middle"); } else if(w<=91.0){ p.println("light heavy"); } else{ p.println("heavy"); } } }
Main.java:7: error: cannot find symbol d weioubleght; ^ symbol: class d location: class Main Main.java:9: error: cannot find symbol weight=Double.parseDouble(line); ^ symbol: variable weight location: class Main Main.java:10: error: cannot find symbol classOfBoxing(weight); ^ symbol: variable weight location: class Main 3 errors
s832280614
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; doubl weight; while((line=br.readLine())!=null){ weight=Double.parseDouble(line); classOfBoxing(weight); } } private static void classOfBoxing(double w){ PrintWriter p=new PrintWriter(System.out); if(w<=48.0){ p.println("light fly"); } else if(w<=51.0){ p.println("fly"); } else if(w<=54.0){ p.println("bantam"); } else if(w<=57.0){ p.println("feather"); } else if(w<=60.0){ p.println("light"); } else if(w<=64.0){ p.println("light welter"); } else if(w<=69.0){ p.println("welter"); } else if(w<=75.0){ p.println("light middle"); } else if(w<=81.0){ p.println("middle"); } else if(w<=91.0){ p.println("light heavy"); } else{ p.println("heavy"); } } }
Main.java:7: error: cannot find symbol doubl weight; ^ symbol: class doubl location: class Main 1 error
s481614471
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; double weight; while((line=br.readLine())!=null){ weight=Double.parseDouble(line); classOfBoxing(weight); } } private static void classOfBoxing(double n){ PrintWriter p=new PrintWriter(System.out); if(n<=48.00){ p.println("light fly"); } else if(n>48.00 &&n<=51.00){ p.println("fly"); } else if(n>51.00 &&n<=54.00){ p.println("bantam"); } else if(n>54.00 &&n<=57.00){ p.println("feather"); } else if((n>57.00 &&n<=60.00){ p.println("light"); } else if(n>60.00 &&n<=64.00){ p.println("light welter"); } else if(n>64.00 &&n<=69.00){ p.println("welter"); } else if(n>69.00 &&n<=75.00){ p.println("light middle"); } else if(n>75.00 &&n<=81.00){ p.println("middle"); } else if(n>81.00 &&n<=91.00){ p.println("light heavy"); } else{ p.println("heavy"); } } }
Main.java:27: error: ')' expected else if((n>57.00 &&n<=60.00){ ^ 1 error
s628015081
p00048
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; double weight; while((line=br.readLine())!=null){ weight=Double.parseDouble(line); classOfBoxing(weight); } } private static void classOfBoxing(double n){ if(n<=48.00){ System.out.println("light fly"); } else if(n>48.00 &&n<=51.00){ System.out.println("fly"); } else if(n>51.00 &&n<=54.00){ System.out.println("bantam"); } else if(n>54.00 &&n<=57.00){ p.println("feather"); } else if(n>57.00 &&n<=60.00){ System.out.println("light"); } else if(n>60.00 &&n<=64.00){ System.out.println("light welter"); } else if(n>64.00 &&n<=69.00){ System.out.println("welter"); } else if(n>69.00 &&n<=75.00){ System.out.println("light middle"); } else if(n>75.00 &&n<=81.00){ System.out.println("middle"); } else if(n>81.00 &&n<=91.00){ System.out.println("light heavy"); } else{ System.out.println("heavy"); } } }
Main.java:24: error: cannot find symbol p.println("feather"); ^ symbol: variable p location: class Main 1 error
s437001749
p00048
Java
import java.util.Scanner; public enum Main{ LF("light fly"), FL("fly"), BT("bantam"), FE("feather"), LG("light"), LW("light welter"), WT("welter"), LM("light middle"), MI("middle"), LH("light heavy"), HV("heavy"); private String s; private BoxingClass(String str) { this.s = str;} public String toString() { return this.s;} private static BoxingClass classify(double weight) { if(weight <= 48) return LF; else if(weight <= 51) return FL; else if(weight <= 54) return BT; else if(weight <= 57) return FE; else if(weight <= 60) return LG; else if(weight <= 64) return LW; else if(weight <= 69) return WT; else if(weight <= 75) return LM; else if(weight <= 81) return MI; else if(weight <= 91) return LH; else return HV; } public static void main(String... args) { Scanner sc = new Scanner(System.in); while(sc.hasNextDouble()) System.out.println(classify(sc.nextDouble())); sc.close(); } }
Main.java:8: error: invalid method declaration; return type required private BoxingClass(String str) { this.s = str;} ^ 1 error
s569919183
p00048
Java
import java.util.*;public class Main {Scanner sc = new Scanner(System.in);void p(String s){System.out.println(s);}void run(){for(;sc.hasNextDouble();){double d =sc.nextDouble();if(d<=48)p("light fly");else if(d<=51)p("fly");else if(d<=54)p("bantam");else if(d<=57)p("feather");else if(d<=60)p("light");else if(d<=51){p("fly");else if(d<=64)p("light welter");else if(d<=69)p("welter");else if(d<=75)p("light middle");else if(d<=81)p("middle");else if(d<=91)p("light heavy");else{p("heavy");}}public static void main(String[] a){Main m=new Main();m.run();}}
Main.java:1: error: 'else' without 'if' import java.util.*;public class Main {Scanner sc = new Scanner(System.in);void p(String s){System.out.println(s);}void run(){for(;sc.hasNextDouble();){double d =sc.nextDouble();if(d<=48)p("light fly");else if(d<=51)p("fly");else if(d<=54)p("bantam");else if(d<=57)p("feather");else if(d<=60)p("light");else if(d<=51){p("fly");else if(d<=64)p("light welter");else if(d<=69)p("welter");else if(d<=75)p("light middle");else if(d<=81)p("middle");else if(d<=91)p("light heavy");else{p("heavy");}}public static void main(String[] a){Main m=new Main();m.run();}} ^ Main.java:1: error: illegal start of expression import java.util.*;public class Main {Scanner sc = new Scanner(System.in);void p(String s){System.out.println(s);}void run(){for(;sc.hasNextDouble();){double d =sc.nextDouble();if(d<=48)p("light fly");else if(d<=51)p("fly");else if(d<=54)p("bantam");else if(d<=57)p("feather");else if(d<=60)p("light");else if(d<=51){p("fly");else if(d<=64)p("light welter");else if(d<=69)p("welter");else if(d<=75)p("light middle");else if(d<=81)p("middle");else if(d<=91)p("light heavy");else{p("heavy");}}public static void main(String[] a){Main m=new Main();m.run();}} ^ 2 errors
s678713854
p00048
Java
import java.io.*; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { String str; Double wgt; Scanner in = new Scanner(System.in); // BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while ( in.hasNext() ) { wgt = in.nextDouble(); System.out.println(rank(wgt)); } } public static String rank( double weight ) { String[] date = {"light fly" , "fly" , "bantam", "heather" , "light" , "light welter" , "welter" , "light middle" , "middle" , "light heavy" , "heavy"}; int index; if ( weight <= 48.00 ) index = 0; else if ( weight > 48.00 && weight <= 51.00 ) index = 1; else if ( weight > 51.00 && weight <= 54.00 ) index = 2; else if ( weight > 54.00 && weight <= 57.00 ) index = 3; else if ( weight > 57.00 && weight <= 60.00 ) index = 4; else if ( weight > 60.00 && weight <= 64.00 ) index = 5; else if ( weight > 64.00 && weight <= 69.00 ) index = 6; else if ( weight > 69.00 && weight <= 75.00 ) index = 7; else if ( weight > 75.00 && weight <= 81.00 ) index = 8; else if ( weight > 81.00 && weight <= 91.00 ) index = 9; else if ( weight > 91.00 ) index = 10; return date[index]; } }
Main.java:32: error: variable index might not have been initialized return date[index]; ^ 1 error
s649274562
p00048
Java
import java.io.*; public class Main{ public static void main(String[] args){ BufferedReader reader =new BufferedReader(new InputStreamReader(System.in)); String s; double n; try{ while((s=reader.readLine()) !=null){ n=Double.parseDouble(s); if(n<=48.00){ System.out.println("lightfly"); } if(n>48.00 && n<=51.00){ System.out.println("fly"); } if(n>51.00 &&n<=54.00){ System.out.println("bantam"); } if(n>54.00 && n<=57.00){System.out.println("feather");} if(n>57.00 &&n<=60.00){System.out.println("light");} if(n>60.00 &&n<=64.00){System.out.println("light welter");} if(n>64.00 &&n<=69.00){System.out.println("welter");} if(n>69.00 &&n<=75.00){System.out.println("light middle");} if(n>75.00 &&n<=81.00){System.out.println("middle");} if(n>81.00 &&N<=91.00){System.out.println("light heavy"); }else{System.out.println("heavy");} } }catch(IOException e){ System.out.println(e); } } }
Main.java:26: error: cannot find symbol if(n>81.00 &&N<=91.00){System.out.println("light heavy"); ^ symbol: variable N location: class Main 1 error
s347525406
p00048
Java
import java.io.*; public class Main{ public static void main(String[] args){ BufferedReader reader =new BufferedReader(new InputStreamReader(System.in)); String s; double n; try{ while((s=reader.readLine()) !=null){ n=Double.parseDouble(s); if(n<=48.00){ System.out.println("lightfly"); } if(n>48.00 && n<=51.00){ System.out.println("fly"); } if(n>51.00 &&n<=54.00){ System.out.println("bantam"); } if(n>54.00 && n<=57.00){System.out.println("feather");} if(n>57.00 &&n<=60.00){System.out.println("light");} if(n>60.00 &&n<=64.00){System.out.println("light welter");} if(n>64.00 &&n<=69.00){System.out.println("welter");} if(n>69.00 &&n<=75.00){System.out.println("light middle");} if(n>75.00 &&n<=81.00){System.out.println("middle");} if(n>81.00 &&N<=91.00){System.out.println("light heavy"); }else{System.out.println("heavy");} } }catch(IOException e){ System.out.println(e); } } }
Main.java:26: error: cannot find symbol if(n>81.00 &&N<=91.00){System.out.println("light heavy"); ^ symbol: variable N location: class Main 1 error
s882558209
p00048
Java
import java.io.*; public class Main{ public static void main(String[] args){ BufferedReader reader =new BufferedReader(new InputStreamReader(System.in)); String s; double n; try{ while((s=reader.readLine()) !=null){ n=Double.parseDouble(s); if(n<=48.00){ System.out.println("lightfly"); } if(n>48.00 && n<=51.00){ System.out.println("fly"); } if(n>51.00 &&n<=54.00){ System.out.println("bantam"); } if(n>54.00 && n<=57.00){System.out.println("feather");} if(n>57.00 &&n<=60.00){System.out.println("light");} if(n>60.00 &&n<=64.00){System.out.println("light welter");} if(n>64.00 &&n<=69.00){System.out.println("welter");} if(n>69.00 &&n<=75.00){System.out.println("light middle");} if(n>75.00 &&n<=81.00){System.out.println("middle");} if(n>81.00 &&N<=91.00){System.out.println("light heavy"); }else{System.out.println("heavy");} } }catch(IOException e){ System.out.println(e); } } }
Main.java:26: error: cannot find symbol if(n>81.00 &&N<=91.00){System.out.println("light heavy"); ^ symbol: variable N location: class Main 1 error
s250114650
p00048
C
#include<stdio.h> int main(){ double a; while(1){ scanf("%lfn", &a); if(a<=48.00){printf("light fly\n");} else ifif(a>48.00 && a<=51.00){printf("fly\n");} else ifif(a>51.00 && a<=54.00){printf("bantam\n");} else ifif(a>54.00 && a<=57.00){printf("feather\n");} else ifif(a>57.00 && a<=60.00){printf("light\n");} else ifif(a>60.00 && a<=64.00){printf("light welter\n");} else ifif(a>64.00 && a<=69.00){printf("welter\n");} else ifif(a>69.00 && a<=75.00){printf("light middle\n");} else ifif(a>75.00 && a<=81.00){printf("middle\n");} else ifif(a>81.00 && a<=91.00){printf("light heavy\n");} else ifif(a>91.00){printf("heavy\n");} } return 0; }
main.c: In function 'main': main.c:11:8: error: implicit declaration of function 'ifif' [-Wimplicit-function-declaration] 11 | else ifif(a>48.00 && a<=51.00){printf("fly\n");} | ^~~~ main.c:11:33: error: expected ';' before '{' token 11 | else ifif(a>48.00 && a<=51.00){printf("fly\n");} | ^ | ;
s891602380
p00048
C
#include <stdio.h> int main(void) { double w; while (scanf("%lf", &w) != EOF){ if (w > 91.00){ printf("heavy\n"); } else if (w > 81.00){ printf("light heavy\n"); } else if (w > 75.00){ printf("middle\n"); } else if (w > 69.00){ printf("light middle\n"); } else if (w > 64.00){ printf("welter\n"); } else if (w > 60.00){ printf("light welter\n"); } else if (w > 57.00){ printf("light\n"); } else if (w > 54.00){ printf("feather\n"); } else if (w > 51.00){ printf("bantam\n"); } else if (w > 48.00){ printf("fly\n"); } else { printf("light fly\n"); } } return (0);
main.c: In function 'main': main.c:43:5: error: expected declaration or statement at end of input 43 | return (0); | ^~~~~~
s244242766
p00048
C
include <stdio.h> int main(void){ double num; for(;scanf("%lf",&num);){ if(num <= 48.00) printf("light fly\n"); else if(num <= 51.00) printf("fly\n"); else if(num <= 54.00) printf("bantam\n"); else if(num <= 57.00) printf("feather\n"); else if(num <= 60.00) printf("light\n"); else if(num <= 64.00) printf("light welter\n"); else if(num <= 69.00) printf("welter\n"); else if(num <= 75.00) printf("light middle\n"); else if(num <= 81.00) printf("middle\n"); else if(num <= 91.00) printf("light heavy\n"); else printf("heavy\n"); } return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s375232028
p00048
C
#include <stdio.h> int main(void) { double kg; while(scanf("%lf",&kg)!=EOF){ if(kg<=48.00){ kai[nin]="light fly"; }else if(kg<=51.00){printf("fly"); }else if(kg<=54.00){printf("bantam"); }else if(kg<=57.00){printf("feather"); }else if(kg<=60.00){printf("light"); }else if(kg<=64.00){printf("light welter"); }else if(kg<=69.00){printf("welter"); }else if(kg<=75.00){printf("light middle"); }else if(kg<=81.00){printf("middle"); }else if(kg<=91.00){printf("light heavy"); }else if(kg>91.000){printf("heavy"); } } return 0; } /* kg?¶?&&kg??\??? light fly 48.00kg ??\??? fly 48.00kg ?¶? 51.00kg ??\??? bantam 51.00kg ?¶? 54.00kg ??\??? feather 54.00kg ?¶? 57.00kg ??\??? light 57.00kg ?¶? 60.00kg ??\??? light welter 60.00kg ?¶? 64.00kg ??\??? welter 64.00kg ?¶? 69.00 kg ??\??? light middle 69.00kg ?¶? 75.00 kg ??\??? middle 75.00kg ?¶? 81.00 kg ??\??? light heavy 81.00kg ?¶? 91.00 kg ??\??? heavy 91.00kg ?¶? */
main.c: In function 'main': main.c:9:17: error: 'kai' undeclared (first use in this function) 9 | kai[nin]="light fly"; | ^~~ main.c:9:17: note: each undeclared identifier is reported only once for each function it appears in main.c:9:21: error: 'nin' undeclared (first use in this function) 9 | kai[nin]="light fly"; | ^~~
s005889686
p00048
C
#include <stdio.h> int main(void) { double kg; while(scanf("%lf",&kg)!=EOF){ if(kg<=48.00){ kai[nin]="light fly"; }else if(kg<=51.00){printf("fly"); }else if(kg<=54.00){printf("bantam"); }else if(kg<=57.00){printf("feather"); }else if(kg<=60.00){printf("light"); }else if(kg<=64.00){printf("light welter"); }else if(kg<=69.00){printf("welter"); }else if(kg<=75.00){printf("light middle"); }else if(kg<=81.00){printf("middle"); }else if(kg<=91.00){printf("light heavy"); }else if(kg>91.000){printf("heavy"); } } return 0; }
main.c: In function 'main': main.c:9:17: error: 'kai' undeclared (first use in this function) 9 | kai[nin]="light fly"; | ^~~ main.c:9:17: note: each undeclared identifier is reported only once for each function it appears in main.c:9:21: error: 'nin' undeclared (first use in this function) 9 | kai[nin]="light fly"; | ^~~
s835387502
p00048
C
#include <stdio.h> int main(void) { double kg; while(scanf("%lf",&kg)!=EOF){ if(kg<=48.00){ kai[nin]="light fly"; }else if(kg<=51.00){printf("fly"); }else if(kg<=54.00){printf("bantam"); }else if(kg<=57.00){printf("feather"); }else if(kg<=60.00){printf("light"); }else if(kg<=64.00){printf("light welter"); }else if(kg<=69.00){printf("welter"); }else if(kg<=75.00){printf("light middle"); }else if(kg<=81.00){printf("middle"); }else if(kg<=91.00){printf("light heavy"); }else if(kg>91.000){printf("heavy"); } printf("\n"); } return 0; }
main.c: In function 'main': main.c:8:17: error: 'kai' undeclared (first use in this function) 8 | kai[nin]="light fly"; | ^~~ main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in main.c:8:21: error: 'nin' undeclared (first use in this function) 8 | kai[nin]="light fly"; | ^~~
s342607400
p00048
C
#include <stdio.h> main(){ double a; while(scanf("%d",&a) !=EOF){ if(a<=48) printf("light fly"); else if(a>48&&a<=51) printf("fly"); else if(a>51&&a<=54) printf("bantam"); else if(a>54&&a<=57) printf("frather"); else if(a>57&&a<=60) printf("light"); else if(a>60&&a<=64) printf("light welter"); else if(a>64&&a<=69) printf("welter"); else if(a>69&&a<=75) printf("light middle"); else if(a>75&&a<=81) printf("middle"); else if(a>81&&a<=91) printf("light heavy"); else if(a>91) printf("heavy"); return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
s388867990
p00048
C
main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'x' defaults to 'int' [-Wimplicit-int] main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^~~~~ main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:46: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^~~~ main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:217: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} main.c:1:217: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^~~~ main.c:1:217: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:224: error: expected ';' before ':' token 1 | main(x){float a;for(;~scanf("%f",&a);)x=a-.1,puts(x<48?"light fly":x<51?"fly":x<54?"bantam":x<57?"feather":x<60?"light":x<64?"light welter":x<69?"welter":x<75?"light middle":x<81?"middle":x<91?"light heavy":"heavy");exit(0):} | ^ | ;