submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s180806295
p03997
C
#include,stdio.h> int main(void){ int a,b,h; scanf("%d %d %d",&a,&b,&h); printf("%d\n",(a+b)*h/2); return 0;
main.c:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include,stdio.h> | ^ main.c: In function 'main': main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d %d %d",&a,&b,&h); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #include,stdio.h> main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d %d %d",&a,&b,&h); | ^~~~~ main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 5 | printf("%d\n",(a+b)*h/2); | ^~~~~~ main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:5:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:3: error: expected declaration or statement at end of input 6 | return 0; | ^~~~~~
s013953230
p03997
C++
#include <iostream> void main() { int a,b,h; cin >> a >> b >> h; cout << (a+b) * h /2 << endl; }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> a >> b >> h; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout << (a+b) * h /2 << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:6:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | cout << (a+b) * h /2 << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s711787785
p03997
C++
#include <iostream> using namespace std; int main(voud) { int a, b, h, s; cin >> a >> b >> h; s = (a + b) * h / 2; cout << s << endl; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main(voud) | ^~~~ a.cc:4:10: error: 'voud' was not declared in this scope; did you mean 'void'? 4 | int main(voud) | ^~~~ | void
s774280334
p03997
C++
#include <iostream> #include <string> #include <utility> #include <algorithm> #include <map> #include <vector> #include <cmath> #include <cstdlib> #include <queue> #include <stack> using namespace std; #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = n;i >= m;i--) #define REPO(i, n) for(int i = 1;i <= n;i++) #define ll long long #define INF 1999999999 #define MINF -1999999999 #define ALL(n) n.begin(),n.end() int main() { int a, b, c; cin >> a >> b >> c; cout << (a + b)*c / 2 << Endl; }
a.cc: In function 'int main()': a.cc:27:34: error: 'Endl' was not declared in this scope 27 | cout << (a + b)*c / 2 << Endl; | ^~~~
s111054954
p03997
C++
import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); //文字の入力 int a= sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); System.out.println((a+b)*h/2); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:15: error: expected ':' before 'static' 6 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:6:33: error: 'String' has not been declared 6 | public static void main(String[] args) { | ^~~~~~ a.cc:6:42: error: expected ',' or '...' before 'args' 6 | public static void main(String[] args) { | ^~~~ a.cc:13:2: error: expected ';' after class definition 13 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:7:17: error: 'Scanner' was not declared in this scope 7 | Scanner sc = new Scanner(System.in); //文字の入力 | ^~~~~~~ a.cc:8:24: error: 'sc' was not declared in this scope 8 | int a= sc.nextInt(); | ^~ a.cc:11:9: error: 'System' was not declared in this scope 11 | System.out.println((a+b)*h/2); | ^~~~~~
s793276834
p03997
C++
import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); //文字の入力 int a= sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); System.out.println((a+b)*h/2); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:15: error: expected ':' before 'static' 6 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:6:33: error: 'String' has not been declared 6 | public static void main(String[] args) { | ^~~~~~ a.cc:6:42: error: expected ',' or '...' before 'args' 6 | public static void main(String[] args) { | ^~~~ a.cc:13:2: error: expected ';' after class definition 13 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:7:17: error: 'Scanner' was not declared in this scope 7 | Scanner sc = new Scanner(System.in); //文字の入力 | ^~~~~~~ a.cc:8:24: error: 'sc' was not declared in this scope 8 | int a= sc.nextInt(); | ^~ a.cc:11:9: error: 'System' was not declared in this scope 11 | System.out.println((a+b)*h/2); | ^~~~~~
s129158388
p03997
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <map> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> plglg; typedef pair<double, ll> pdlg; typedef tuple<int, int, int> tiii; typedef tuple<ll, ll, ll> tlglglg; typedef tuple<double, double, double> tddd; static const int giga pow(10,9); int main(void){ int a,b,h; cin >> a >> b >> h; cout << (a+b)*(h/2) << endl; return 0; }
a.cc:15:23: error: expected initializer before 'pow' 15 | static const int giga pow(10,9); | ^~~
s084450761
p03997
C++
#include <iostream> int main(){ int a,b,h; cin >> a >> b >> h; cout << (a+b)*2 / 2; <<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> a >> b >> h; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout << (a+b)*2 / 2; <<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:6:26: error: expected primary-expression before '<<' token 6 | cout << (a+b)*2 / 2; <<endl; | ^~ a.cc:6:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | cout << (a+b)*2 / 2; <<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s335494351
p03997
C++
#include <bits/stdc++.h> #define FOR(i, n) for(int i = 0;i <n;i++) #define RFOR(i, n) for(int i = n;i >= 0;i--) #define REP(i, m, n) for(int i = m;i < n;i++) #define RREP(i, m, n) for(int i = m;i >= n;i--) #define INF 999999999 using namespace std; int main(int argc, char const *argv[]) { int a,b,h; cin >>a>>b>>h; h / 2= (a+b)/h; cout<<h<<endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:13:4: error: lvalue required as left operand of assignment 13 | h / 2= (a+b)/h; | ~~^~~
s810416192
p03997
C++
#include <iostream> using namespace std; int main () { int a,b,c; cin >> a >> b >> c; cout << (a+b) * h / 2 << endl; }
a.cc: In function 'int main()': a.cc:7:17: error: 'h' was not declared in this scope 7 | cout << (a+b) * h / 2 << endl; | ^
s242631792
p03997
C++
#include <iostream> #include <vector> #include <string> #include <map> #include <set> #include <stack> #include <queue> #include <cmath> #include <algorithm> #include <utility> #include <functional> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const double EPS = 1e-9; int main() { cin.tie(0); ios::sync_with_stdio(false); int a,b,h; cin>>a>>b>>h; cout << (a + b) * h / 2 << endl; return 0; } #include <iostream> #include <vector> #include <string> #include <map> #include <set> #include <stack> #include <queue> #include <cmath> #include <algorithm> #include <utility> #include <functional> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const double EPS = 1e-9; int main() { cin.tie(0); ios::sync_with_stdio(false); int a,b,h; cin>>a>>b>>h; cout << (a + b) * h / 2 << endl; return 0; }
a.cc:44:11: error: redefinition of 'const int MOD' 44 | const int MOD = 1000000007; | ^~~ a.cc:15:11: note: 'const int MOD' previously defined here 15 | const int MOD = 1000000007; | ^~~ a.cc:45:14: error: redefinition of 'const double EPS' 45 | const double EPS = 1e-9; | ^~~ a.cc:16:14: note: 'const double EPS' previously defined here 16 | const double EPS = 1e-9; | ^~~ a.cc:48:5: error: redefinition of 'int main()' 48 | int main() | ^~~~ a.cc:19:5: note: 'int main()' previously defined here 19 | int main() | ^~~~
s318810626
p03997
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int a, b, h; cin >> a >> b >> h; cout << (a+b)*h/2 << endl;
a.cc: In function 'int main()': a.cc:7:29: error: expected '}' at end of input 7 | cout << (a+b)*h/2 << endl; | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s920550699
p03997
C++
a,b,h=map(int,input().split()) print( (a+b)*h/2 )
a.cc:1:1: error: 'a' does not name a type 1 | a,b,h=map(int,input().split()) | ^
s918209677
p03997
C
#include <iostream> using namespace std; int main() { double x, y, h, area; cin >> x >> y >> h; area = (x+y)*h/2; cout << area; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s893274956
p03997
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h; cin >> a >> b >> h; cout << (a + b) * h / 2 << nedl; }
a.cc: In function 'int main()': a.cc:8:30: error: 'nedl' was not declared in this scope 8 | cout << (a + b) * h / 2 << nedl; | ^~~~
s937505711
p03997
C++
#include <iostream> using namespace std; int main(){ int a, b, h; cin >> a >> b >> h; cout << a * b * h / 2 << endl }
a.cc: In function 'int main()': a.cc:7:32: error: expected ';' before '}' token 7 | cout << a * b * h / 2 << endl | ^ | ; 8 | } | ~
s918447508
p03997
C++
#include<bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << ((a + b)*c) / 2 << endl; }
a.cc:4:17: error: extended character   is not valid in an identifier 4 | int a, b, c; | ^ a.cc: In function 'int main()': a.cc:4:17: error: 'int\U00003000a' was not declared in this scope 4 | int a, b, c; | ^~~~~~ a.cc:4:25: error: 'b' was not declared in this scope 4 | int a, b, c; | ^ a.cc:4:28: error: 'c' was not declared in this scope 4 | int a, b, c; | ^ a.cc:5:24: error: 'a' was not declared in this scope 5 | cin >> a >> b >> c; | ^
s808692972
p03997
C++
#include<bits/stdc++.h> using namespace std; int main() { inta, b, c; cin >> a >> b >> c; cout << ((a + b)*c) / 2 << endl; }
a.cc: In function 'int main()': a.cc:4:17: error: 'inta' was not declared in this scope; did you mean 'int'? 4 | inta, b, c; | ^~~~ | int a.cc:4:23: error: 'b' was not declared in this scope 4 | inta, b, c; | ^ a.cc:4:26: error: 'c' was not declared in this scope 4 | inta, b, c; | ^ a.cc:5:24: error: 'a' was not declared in this scope 5 | cin >> a >> b >> c; | ^
s881170853
p03997
C++
#include <iostream> using namespace std; int main(void) { int a,b,c; cin >> a >> b >> h; cout << (a+b) * h /2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:26: error: 'h' was not declared in this scope 6 | cin >> a >> b >> h; | ^
s759551206
p03997
C++
#include <iostream> using namespace std; int main(void) { int a,b,c; cin >> a >> b >> h; cout << (a+b) * h /2 << endl;a return 0; }
a.cc: In function 'int main()': a.cc:6:26: error: 'h' was not declared in this scope 6 | cin >> a >> b >> h; | ^ a.cc:7:39: error: expected ';' before 'return' 7 | cout << (a+b) * h /2 << endl;a | ^ | ; 8 | return 0; | ~~~~~~
s530367189
p03997
C++
#include <iostream> #include <cstdlib> #include <vector> #include <algorithm> #include <cstring> using namespace std; int main(int argc, char *argv[]) { int a, b, c; cin >> a >> b >> c; cout << ((a + b) * h) / 2 << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:13:28: error: 'h' was not declared in this scope 13 | cout << ((a + b) * h) / 2 << endl; | ^
s259474608
p03997
C++
include <iostream> #include <cstdio> #include <algorithm> using namespace std; int a, b, h, area; int main() { cin >> a; cin >> b; cin >> h; area = (a + b)*h / 2; cout << area << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:3: /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: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:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/stdio.h:34, from /usr/include/c++/14/cstdio:42, from a.cc:2: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /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'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /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'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /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'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /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:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type 112 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 65 | #include <debug/assertions.h> +++ |+#include <cstddef> 66 | #include <bits/stl_iterator_base_types.h> /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type 118 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_iterator.h:67, from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/ptr_traits.h:156:47: error: 'ptrdiff_t' was not declared in this scope 1
s671748048
p03997
C++
#include<iostream> using namespace std; int man(){ int a,b,h; cin>>a>>b>>h; cout<<(a+b)*h/2<<endl; return 0; }
/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
s746254316
p03997
C++
#include <cstdio> int main() { int a =0,b =0,h =0; double s =0; scanf ("%d",&a); scanf ("%d",&b); scanf ("%d",&c); s =(a+b)*h/2; printf ("%f",s); return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: 'c' was not declared in this scope 8 | scanf ("%d",&c); | ^
s442956875
p03997
C++
#include <cstdio> int main() { int a =0,b =0,h =0,s =0; scanf ("%d\n",&a); scanf ("%d\n",&b); scanf ("%d\n",&c); s =(a+b)*h/2; printf ("%d\n",s); return 0; }
a.cc: In function 'int main()': a.cc:7:24: error: 'c' was not declared in this scope 7 | scanf ("%d\n",&c); | ^
s798982829
p03997
C++
#include <cstdio> int main() { int a =0,b =0,h =0,s =0; scanf ("%d",&a); scanf ("%d",&b); scanf ("%d",&c); s =(a+b)*h/2; printf ("%d",s); return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: 'c' was not declared in this scope 7 | scanf ("%d",&c); | ^
s216330758
p03997
C++
#include <cstdio> int main() { int a = 0,b = 0,h = 0,s = 0; s=(a+b)*h/2 scanf ("%d",&a); scanf ("%d",&b); scanf ("%d",&h); printf ("%d\n",s) ; return 0; }
a.cc: In function 'int main()': a.cc:5:12: error: expected ';' before 'scanf' 5 | s=(a+b)*h/2 | ^ | ; 6 | 7 | scanf ("%d",&a); | ~~~~~
s675927614
p03997
C++
#include <cstdio> int main() { int a = 0,b = 0,h = 0,s = 0; s=(a+b)*h/2 scanf ("%d",a); scanf ("%d",b); scanf ("%d",h); printf ("%d\n",s) ; return 0; }
a.cc: In function 'int main()': a.cc:5:12: error: expected ';' before 'scanf' 5 | s=(a+b)*h/2 | ^ | ; 6 | 7 | scanf ("%d",a); | ~~~~~
s771554424
p03997
C
#include<stdio.h> int main() { int a,b,h,s=0; //1<=a<=100,1<=b<=100,1<=h<=100 scanf("%d%d%d,&a&b&h); //h为偶数 s=(a+b)*h*1/2; printf("%d",s); return 0; }
main.c: In function 'main': main.c:6:7: warning: missing terminating " character 6 | scanf("%d%d%d,&a&b&h); | ^ main.c:6:7: error: missing terminating " character 6 | scanf("%d%d%d,&a&b&h); | ^~~~~~~~~~~~~~~~ main.c:8:14: error: expected ')' before ';' token 8 | s=(a+b)*h*1/2; | ^ | ) main.c:6:6: note: to match this '(' 6 | scanf("%d%d%d,&a&b&h); | ^ main.c:8:2: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion] 8 | s=(a+b)*h*1/2; | ~^~~~~~~~~~~~ | | | int In file included from main.c:1: /usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int' 428 | extern int scanf (const char *__restrict __format, ...) __wur; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ main.c:10:10: error: expected ';' before '}' token 10 | return 0; | ^ | ; 11 | } | ~
s832154181
p03997
C++
include<stdio.h> int main(void){ int a,b,h; scanf("%d",&a); scanf("%d",&b); scanf("%d",&h); printf("%d\n",(a+b)*h/2); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~
s100424448
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”, &a, &b, &h); s= (a+b) *h/2; printf (“%f”,s); return 0; }
main.c: In function 'main': main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”, &a, &b, &h); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:8:16: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s); | ^~~~~~~~ main.c:8:17: error: expected expression before '%' token 8 | printf (“%f”,s); | ^ main.c:8:19: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s); | ^~~~~~~~
s616205094
p03997
C
#include<stdio.h> Int main () { Int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return 0; }
main.c:2:1: error: unknown type name 'Int'; did you mean 'int'? 2 | Int main () | ^~~ | int main.c: In function 'main': main.c:4:8: error: unknown type name 'Int'; did you mean 'int'? 4 | Int a,b,h; | ^~~ | int main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:18: error: expected ';' before '}' token 9 | return 0; | ^ | ; 10 | } | ~
s737995476
p03997
Java
#include <bits/stdc++.h> #include <vector> using namespace std; int a,b,c; int main(){ cin>>a>>b>>c; cout<< (a+b)*c/2<<endl; return 0; }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:2: error: illegal character: '#' #include <vector> ^ Main.java:4: error: class, interface, enum, or record expected int a,b,c; ^ Main.java:6: error: not a statement cin>>a>>b>>c; ^ Main.java:7: error: not a statement cout<< (a+b)*c/2<<endl; ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) 7 errors
s159566138
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return0; }
main.c: In function 'main': main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D><U+FF0C>s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D><U+FF0C>s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:17: error: expected ';' before '}' token 9 | return0; | ^ | ; 10 | } | ~
s516388948
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return 0; }
main.c: In function 'main': main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:18: error: expected ';' before '}' token 9 | return 0; | ^ | ; 10 | } | ~
s208616431
p03997
C
#include<stdio.h> Int main () { Int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return0; }
main.c:2:1: error: unknown type name 'Int'; did you mean 'int'? 2 | Int main () | ^~~ | int main.c: In function 'main': main.c:4:8: error: unknown type name 'Int'; did you mean 'int'? 4 | Int a,b,h; | ^~~ | int main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:17: error: expected ';' before '}' token 9 | return0; | ^ | ; 10 | } | ~
s623442223
p03997
C
#include<stdio.h> Int main () { Int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return 0; }
main.c:2:1: error: unknown type name 'Int'; did you mean 'int'? 2 | Int main () | ^~~ | int main.c: In function 'main': main.c:4:8: error: unknown type name 'Int'; did you mean 'int'? 4 | Int a,b,h; | ^~~ | int main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:18: error: expected ';' before '}' token 9 | return 0; | ^ | ; 10 | } | ~
s478520735
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”, &a, &b, &h) ; s= (a+b) *h/2; printf (“%f”,s) ; return0; }
main.c: In function 'main': main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h) ; | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”, &a, &b, &h) ; | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h) ; | ^~~~~~~~ main.c:8:16: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s) ; | ^~~~~~~~ main.c:8:17: error: expected expression before '%' token 8 | printf (“%f”,s) ; | ^ main.c:8:19: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s) ; | ^~~~~~~~ main.c:9:10: error: 'return0' undeclared (first use in this function) 9 | return0; | ^~~~~~~ main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
s506671867
p03997
C
#include<stdio.h> int main () { Int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return 0; }
main.c: In function 'main': main.c:4:8: error: unknown type name 'Int'; did you mean 'int'? 4 | Int a,b,h; | ^~~ | int main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:18: error: expected ';' before '}' token 9 | return 0; | ^ | ; 10 | } | ~
s978892272
p03997
C
#include<stdio.h> Int main () { int a,b,h; float s; scanf(“%d%d%d”,&a,&b,&c); s=(a+b)*h/2; printf(“%f”,s); return 0; }
main.c:2:1: error: unknown type name 'Int'; did you mean 'int'? 2 | Int main () | ^~~ | int main.c: In function 'main': main.c:6:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf' 6 | scanf(“%d%d%d”,&a,&b,&c); | ^~~~~ main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”,&a,&b,&c); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D><U+FF0C>&a<U+FF0C>&b<U+FF0C>&c<U+FF09><U+FF1B> | ^~~~~~~~ main.c:7:20: error: invalid suffix ";" on integer constant 7 | s=(a+b)*h/2; | ^~~ main.c:8:16: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:8:19: error: stray '\342' in program 8 | printf<U+FF08><U+201C>%f<U+201D>,s<U+FF09><U+FF1B> | ^~~~~~~~ main.c:9:18: error: expected ';' before '}' token 9 | return 0; | ^ | ; 10 | } | ~
s316830737
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”, &a, &b, &h); s= (a+b) *h/2; printf (“%f”,s); return0; }
main.c: In function 'main': main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”, &a, &b, &h); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:8:16: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s); | ^~~~~~~~ main.c:8:17: error: expected expression before '%' token 8 | printf (“%f”,s); | ^ main.c:8:19: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s); | ^~~~~~~~ main.c:9:10: error: 'return0' undeclared (first use in this function) 9 | return0; | ^~~~~~~ main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
s991766365
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”, &a, &b, &h); s= (a+b) *h/2; printf (“%f”,s); return 0; }
main.c: In function 'main': main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”, &a, &b, &h); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:8:16: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s); | ^~~~~~~~ main.c:8:17: error: expected expression before '%' token 8 | printf (“%f”,s); | ^ main.c:8:19: error: stray '\342' in program 8 | printf (<U+201C>%f<U+201D>,s); | ^~~~~~~~
s616074741
p03997
C
#include<stdio.h> int main () { int a,b,h; float s; scanf(“%d%d%d”, &a, &b, &h); s=(a+b) *h/2; printf(“%f”,s); return 0; }
main.c: In function 'main': main.c:6:14: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:6:15: error: expected expression before '%' token 6 | scanf(“%d%d%d”, &a, &b, &h); | ^ main.c:6:21: error: stray '\342' in program 6 | scanf(<U+201C>%d%d%d<U+201D>, &a, &b, &h); | ^~~~~~~~ main.c:8:15: error: stray '\342' in program 8 | printf(<U+201C>%f<U+201D>,s); | ^~~~~~~~ main.c:8:16: error: expected expression before '%' token 8 | printf(“%f”,s); | ^ main.c:8:18: error: stray '\342' in program 8 | printf(<U+201C>%f<U+201D>,s); | ^~~~~~~~
s377242077
p03997
C++
{ #include <stdio.h> int main() { float d1,d2,h; scanf("%f%f%f",&d1,&d2,&h); //输入上底、下底以及高 printf("%f",(d1+d2)/2*h); //输出面积 return 0; }
a.cc:1:1: error: expected unqualified-id before '{' token 1 | { | ^
s479967482
p03997
C++
#include <stdio.h> #include <stdlib.h> int main() { int a, b, h,c; scanf_s("%d%d%d", &a, &b, &h); c = (a + b)*h/2; printf("%d\n",c); system("pause"); }
a.cc: In function 'int main()': a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 6 | scanf_s("%d%d%d", &a, &b, &h); | ^~~~~~~ | scanf
s661766050
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>b>>h>>a cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'b' was not declared in this scope 6 | cin>>b>>h>>a | ^ a.cc:6:9: error: 'h' was not declared in this scope 6 | cin>>b>>h>>a | ^ a.cc:6:12: error: 'a' was not declared in this scope 6 | cin>>b>>h>>a | ^
s541076627
p03997
C
#include <stdio.h> int main() { float a,b,c; float s; printf("a,b,h”); scanf("%f %f %f",&a,&b,&c); s=((a+b)*c)/2; printf("%f",s); }
main.c: In function 'main': main.c:6:8: warning: missing terminating " character 6 | printf("a,b,h”); | ^ main.c:6:8: error: missing terminating " character 6 | printf("a,b,h”); | ^~~~~~~~~ main.c:7:27: error: expected ')' before ';' token 7 | scanf("%f %f %f",&a,&b,&c); | ^ | ) main.c:6:7: note: to match this '(' 6 | printf("a,b,h”); | ^ main.c:7:1: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion] 7 | scanf("%f %f %f",&a,&b,&c); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int In file included from main.c:1: /usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ main.c:9:16: error: expected ';' before '}' token 9 | printf("%f",s); | ^ | ; 10 | } | ~
s961083500
p03997
C++
#include int main(void) { int a,b,h,c; printf("a,b,h:"); scanf("%d%d%d",&a,&b,&h); c=a*b; printf("the length=%d,the width=%d,the height=h\nThe area=%d\n",a,b,h); return 0; }
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^ a.cc: In function 'int main()': a.cc:5:1: error: 'printf' was not declared in this scope 5 | printf("a,b,h:"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | #include a.cc:6:1: error: 'scanf' was not declared in this scope 6 | scanf("%d%d%d",&a,&b,&h); | ^~~~~
s695158292
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>b>>a>>h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'b' was not declared in this scope 6 | cin>>b>>a>>h; | ^ a.cc:6:9: error: 'a' was not declared in this scope 6 | cin>>b>>a>>h; | ^ a.cc:6:12: error: 'h' was not declared in this scope 6 | cin>>b>>a>>h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s880438782
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a>>b>>h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:6:9: error: 'b' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:6:12: error: 'h' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s100554287
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a>>b>>h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:6:9: error: 'b' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:6:12: error: 'h' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s424993897
p03997
C++
#include int main(void) { int a,b,h,c; printf("a,b,h"); scanf("%d%d%d",&a,&b,&h); c=a*b; printf("the length=%d,the width=%d,the height=h\nThe area=%d\n",a,b,h); return 0; }
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^ a.cc: In function 'int main()': a.cc:5:1: error: 'printf' was not declared in this scope 5 | printf("a,b,h"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | #include a.cc:6:1: error: 'scanf' was not declared in this scope 6 | scanf("%d%d%d",&a,&b,&h); | ^~~~~
s077246295
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a>>b,h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a>>b,h; | ^ a.cc:6:9: error: 'b' was not declared in this scope 6 | cin>>a>>b,h; | ^ a.cc:6:11: error: 'h' was not declared in this scope 6 | cin>>a>>b,h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s836495566
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a,b,h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:8: error: 'b' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:10: error: 'h' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s311496372
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a,b,h; cout<<s=<<(a+b)*h/2.0<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:8: error: 'b' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:10: error: 'h' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:7:7: error: 's' was not declared in this scope 7 | cout<<s=<<(a+b)*h/2.0<<endl; | ^ a.cc:7:9: error: expected primary-expression before '<<' token 7 | cout<<s=<<(a+b)*h/2.0<<endl; | ^~
s685003399
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a,b,h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:8: error: 'b' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:10: error: 'h' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s031879398
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a,b,h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:8: error: 'b' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:10: error: 'h' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s794186359
p03997
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a,b,h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:8: error: 'b' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:6:10: error: 'h' was not declared in this scope 6 | cin>>a,b,h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s641016330
p03997
C
#include <stdio.h> int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);printf("%d",(a+b)*c/2)}
main.c: In function 'main': main.c:2:69: error: expected ';' before '}' token 2 | int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);printf("%d",(a+b)*c/2)} | ^ | ;
s728137332
p03997
C
#include <stdio.h> int main(void) { int a,b,h; scnaf("%d%d%d",&a,&b,&h); printf("%d",(a+b)*h/2); return 0; }
main.c: In function 'main': main.c:7:1: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scnaf("%d%d%d",&a,&b,&h); | ^~~~~ | scanf
s001560375
p03997
C++
#include <iostream> #include <string> #include <string.h> using namespace std; int main() { int a,b,c,d,e,f; cin >> a >> b >> c; d = a+b; cout << d*c/2 << endl; return 0; } #include <iostream> #include <string> #include <string.h> using namespace std; int main() { int a,b,c,d,e,f; cin >> a >> b >> c; d = a+b; cout << d*c/2 << endl; return 0; }
a.cc:21:5: error: redefinition of 'int main()' 21 | int main() { | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 | int main() { | ^~~~
s327998732
p03997
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, s, d,; cin >> a >> s >> d ; cout << (a+s)*d/2<< endl; }
a.cc: In function 'int main()': a.cc:6:15: error: expected unqualified-id before ';' token 6 | int a, s, d,; | ^
s439534006
p03997
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, s, d,; cin >> a >> s >> d ; cout << (a+s)*d/2<< endl; }
a.cc: In function 'int main()': a.cc:6:15: error: expected unqualified-id before ';' token 6 | int a, s, d,; | ^
s529508614
p03997
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, s, d,; cin >> a >> s >> d ; cout << (a+s)*h/2<< endl; }
a.cc: In function 'int main()': a.cc:6:15: error: expected unqualified-id before ';' token 6 | int a, s, d,; | ^ a.cc:9:17: error: 'h' was not declared in this scope 9 | cout << (a+s)*h/2<< endl; | ^
s270733919
p03997
C++
#include<iostream> using namespace std; int main(){ int a, b, h; cin >> a >> b >> h; cout << (a+b)*h/2 << endl;
a.cc: In function 'int main()': a.cc:5:29: error: expected '}' at end of input 5 | cout << (a+b)*h/2 << endl; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s414993292
p03997
C++
#include <stdio.h> int main(void) { int a,b,h; int s; scanf("%d", &a); scanf("%d", &b); scanf("%d", &h); s =(a + b)*h/2; printf("s = %d\n", s); return 0; } ~
a.cc:19:2: error: expected class-name at end of input 19 | ~ | ^
s854428171
p03997
C++
#include <stdio.h> int main(void) { int a,b,h; int s; printf("a="); scanf("%d", &a); printf("b="); scanf("%d", &b); printf("h="); scanf("%d", &h); s =(a + b)*h/2; printf("s = %d\n", s); return 0; } ~
a.cc:19:2: error: expected class-name at end of input 19 | ~ | ^
s244727536
p03997
C++
#include <iostream> using namespace std; int main(){ int a,b,h; cin<<a<<b<<h; cout<<(a+b)*h/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 5 | cin<<a<<b<<h; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:5:8: note: candidate: 'operator<<(int, int)' (built-in) 5 | cin<<a<<b<<h; | ~~~^~~ a.cc:5:8: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:5:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 5 | cin<<a<<b<<h; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:5:10: required from here 5 | cin<<a<<b<<h; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s399914885
p03997
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); System.out.println((a+b)*h/2); }
Main.java:9: error: reached end of file while parsing } ^ 1 error
s649077189
p03997
C++
#include <bits/stdc++.h> using namespace std; double a, b, h; int main(){ cin>>a>>b>>c; cout<<(a+b)*h/2<<endl; }
a.cc: In function 'int main()': a.cc:6:14: error: 'c' was not declared in this scope 6 | cin>>a>>b>>c; | ^
s611012788
p03997
C++
#include <bits/stdc++.h> using namespace std; int a, b, h; int main(){ cin>>a>>b>>c; cout<<(a+b-1)*h/2+1<<endl; }
a.cc: In function 'int main()': a.cc:6:14: error: 'c' was not declared in this scope 6 | cin>>a>>b>>c; | ^
s660406355
p03997
C++
#include <cstdio> using std::cin; using std::cout; using std::endl; using namespace std; int main() { int a, b, h; cin >> a >> b >> h; cout << (a + b) * 2 / 2 << endl; }
a.cc:3:12: error: 'cin' has not been declared in 'std' 3 | using std::cin; | ^~~ a.cc:4:12: error: 'cout' has not been declared in 'std' 4 | using std::cout; | ^~~~ a.cc:5:12: error: 'endl' has not been declared in 'std' 5 | using std::endl; | ^~~~ a.cc: In function 'int main()': a.cc:12:3: error: 'cin' was not declared in this scope 12 | cin >> a >> b >> h; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <cstdio> +++ |+#include <iostream> 2 | a.cc:14:3: error: 'cout' was not declared in this scope 14 | cout << (a + b) * 2 / 2 << endl; | ^~~~ a.cc:14:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:14:30: error: 'endl' was not declared in this scope 14 | cout << (a + b) * 2 / 2 << endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <cstdio> +++ |+#include <ostream> 2 |
s867967339
p03997
Java
import java.util.*; public class Main { public static void main(String[] args) { // 自分の得意な言語で // Let's チャレンジ!! Scanner sc = new Scanner(System.in); String line = sc.nextLine(); int a=integer.parseInt(line); line = sc.nextLine(); int b=integer.parseInt(line); line = sc.nextLine(); int h=integer.parseInt(line); System.out.println((a+b)*h/2); } }
Main.java:11: error: cannot find symbol int a=integer.parseInt(line); ^ symbol: variable integer location: class Main Main.java:13: error: cannot find symbol int b=integer.parseInt(line); ^ symbol: variable integer location: class Main Main.java:15: error: cannot find symbol int h=integer.parseInt(line); ^ symbol: variable integer location: class Main 3 errors
s471851162
p03997
C++
#include <bits/stdc++.h> #include <typeinfo> #include <cxxabi.h> #ifdef LOCAL #include "dbgtoki.hpp" #define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) DbgTimer D_t; #define TSTART() D_t.start() #define TSTOP() D_t.stop() #else #define DUMP(i) #define TSTART() #define TSTOP() #endif #define TOSTRING(x) #x #define SZ(x) (int)(x).size() #define REP(i,n) for(int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define ALL(s) (s).begin(), (s).end() #define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end()); using namespace std; typedef long long unsigned int llu; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; const int EPS = 1e-9; int main (){ cin.tie(0); ios::sync_with_stdio(false); int a,b,c; while(cin >> a >> b >> h){ TSTART(); int ans = (a+b)*h/2; cout << ans << endl; TSTOP(); } return 0; }
a.cc: In function 'int main()': a.cc:36:26: error: 'h' was not declared in this scope 36 | while(cin >> a >> b >> h){ | ^
s774992852
p03997
C++
#include<iostream> using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; cout << (a+b)*h/(double)(2) << endl; }
a.cc: In function 'int main()': a.cc:8:17: error: 'h' was not declared in this scope 8 | cout << (a+b)*h/(double)(2) << endl; | ^
s144322123
p03997
C++
#include<iostream> using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; cout << (a+b)*h/double(2) << endl; }
a.cc: In function 'int main()': a.cc:8:17: error: 'h' was not declared in this scope 8 | cout << (a+b)*h/double(2) << endl; | ^
s239440229
p03997
C++
a = int(input()) b = int(input()) h = int(input()) print(int((a+b)*h/2))
a.cc:1:1: error: 'a' does not name a type 1 | a = int(input()) | ^
s265925819
p03997
C++
a=int(input()) b=int(input()) h=int(input()) print((a+b)*h//2) #inputはstrに対応 #勝手に改行
a.cc:6:2: error: invalid preprocessing directive #input\U0000306fstr\U0000306b\U00005bfe\U00005fdc 6 | #inputはstrに対応 | ^~~~~~~~~~~~~~~~ a.cc:7:2: error: invalid preprocessing directive #\U000052dd\U0000624b\U0000306b\U00006539\U0000884c 7 | #勝手に改行 | ^~~~~~~~~~ a.cc:2:1: error: 'a' does not name a type 2 | a=int(input()) | ^
s841110796
p03997
C++
a = int(input()) b = int(input()) h = int(input()) print((a + b) * h // 2)
a.cc:1:1: error: 'a' does not name a type 1 | a = int(input()) | ^
s219408368
p03997
C++
#include <iostream> using namespace std; int main() { int a, b h; cin >> a >> b >> h; cout<< (a+b)*h/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: expected initializer before 'h' 5 | int a, b h; | ^ a.cc:6:21: error: 'b' was not declared in this scope 6 | cin >> a >> b >> h; | ^ a.cc:6:26: error: 'h' was not declared in this scope 6 | cin >> a >> b >> h; | ^
s348210849
p03997
C++
#include <iostream> using namespace std; int main() { int a, b ,h,; cin >> a >> b >> h; cout<< (a+b)*h/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:21: error: expected unqualified-id before ';' token 5 | int a, b ,h,; | ^
s946018870
p03997
C++
#include s/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<(a+b)/2*c<<endl; }
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include s/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>a>>b>>c; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #include s/stdc++.h> a.cc:7:3: error: 'cout' was not declared in this scope 7 | cout<<(a+b)/2*c<<endl; | ^~~~ a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:20: error: 'endl' was not declared in this scope 7 | cout<<(a+b)/2*c<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #include s/stdc++.h>
s219781718
p03997
C++
#include <iostream> #include <map> using namespace std; typedef long long ll; int main(){ ll i,j,k; ll a,b,c; ll h,w,n; cin>>h>>w>>n; map<pair<int,int>,int> cnt; for(i=0;i<n;i++){ cin>>a>>b; for(j=-1;j<=1;j++){ for(k=-1;k<=1;k++){ if(a+j>=1 && a+j<=h && b+k>=1 && b+j<=w){ cnt[make_pair(a+j,b+k)]++; } } } } ll ans[10]; fill(a,a+10,0); ans[0]=(h-2)*(w-2); for(auto& elem : cnt){ ans[0]--; ans[elem.second]++; } for(i=0;i<=9;i++){ cout<<ans[i]<<endl; } return 0; }
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: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = long long int; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]': /usr/include/c++/14/bits/stl_algobase.h:998:21: required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = long long int; _Tp = int]' 998 | { std::__fill_a1(__first, __last, __value); } | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1029:20: required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = long long int; _Tp = int]' 1029 | std::__fill_a(__first, __last, __value); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:27:6: required from here 27 | fill(a,a+10,0); | ~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'long long int') 952 | *__first = __tmp; | ^~~~~~~~
s627021589
p03997
C++
#include <iostream> using namespace std; int main(){ int a,b,h; cin >> a >> b >> h; cout << (a+b)*h/2 return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before 'return' 7 | cout << (a+b)*h/2 | ^ | ; 8 | 9 | return 0; | ~~~~~~
s299294838
p03997
C++
#include<iostream> using namespace std; int main() { int a, b, h; cin << a << b << h; cout << (a + b)*h / 2 << endl; }
a.cc: In function 'int main()': a.cc:6:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << a << b << h; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:13: note: candidate: 'operator<<(int, int)' (built-in) 6 | cin << a << b << h; | ~~~~^~~~ a.cc:6:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:6:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 6 | cin << a << b << h; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:6:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:6:9: required from here 6 | cin << a << b << h; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s596402347
p03997
C++
process.stdin.resume(); process.stdin.setEncoding('ascii'); var input_stdin = ""; var input_stdin_array = ""; var input_currentline = 0; process.stdin.on('data', function (data) { input_stdin += data; }); process.on('SIGINT', function(){ input_stdin_array = input_stdin.split("\n"); main(); process.exit(); }); process.stdin.on('end', function () { input_stdin_array = input_stdin.split("\n"); main(); }); function readLine() { return input_stdin_array[input_currentline++]; } /////////////// ignore above this line //////////////////// function main() { var b1,b2,h; b1 = parseInt(readLine()); b2 = parseInt(readLine()); h = parseInt(readLine())/2; var ans = (b1+b2)*h; console.log(ans.toString()); process.exit(); }
a.cc:2:27: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 2 | process.stdin.setEncoding('ascii'); | ^~~~~~~ a.cc:8:18: warning: multi-character character constant [-Wmultichar] 8 | process.stdin.on('data', function (data) { | ^~~~~~ a.cc:12:12: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 12 | process.on('SIGINT', function(){ | ^~~~~~~~ a.cc:18:18: warning: multi-character character constant [-Wmultichar] 18 | process.stdin.on('end', function () { | ^~~~~ a.cc:1:1: error: 'process' does not name a type 1 | process.stdin.resume(); | ^~~~~~~ a.cc:2:1: error: 'process' does not name a type 2 | process.stdin.setEncoding('ascii'); | ^~~~~~~ a.cc:4:1: error: 'var' does not name a type 4 | var input_stdin = ""; | ^~~ a.cc:5:1: error: 'var' does not name a type 5 | var input_stdin_array = ""; | ^~~ a.cc:6:1: error: 'var' does not name a type 6 | var input_currentline = 0; | ^~~ a.cc:8:1: error: 'process' does not name a type 8 | process.stdin.on('data', function (data) { | ^~~~~~~ a.cc:10:2: error: expected unqualified-id before ')' token 10 | }); | ^ a.cc:12:1: error: 'process' does not name a type 12 | process.on('SIGINT', function(){ | ^~~~~~~ a.cc:16:2: error: expected unqualified-id before ')' token 16 | }); | ^ a.cc:18:1: error: 'process' does not name a type 18 | process.stdin.on('end', function () { | ^~~~~~~ a.cc:21:2: error: expected unqualified-id before ')' token 21 | }); | ^ a.cc:23:1: error: 'function' does not name a type; did you mean 'union'? 23 | function readLine() { | ^~~~~~~~ | union a.cc:30:1: error: 'function' does not name a type; did you mean 'union'? 30 | function main() { | ^~~~~~~~ | union
s658039917
p03997
C++
#include <stdio.h> int main(){ scanf("%d %d %d",&a,&b,&c); d=((a+b)*h)/2; printf("%d",d); return 0 }
a.cc: In function 'int main()': a.cc:3:27: error: 'a' was not declared in this scope 3 | scanf("%d %d %d",&a,&b,&c); | ^ a.cc:3:30: error: 'b' was not declared in this scope 3 | scanf("%d %d %d",&a,&b,&c); | ^ a.cc:3:33: error: 'c' was not declared in this scope 3 | scanf("%d %d %d",&a,&b,&c); | ^ a.cc:4:9: error: 'd' was not declared in this scope 4 | d=((a+b)*h)/2; | ^ a.cc:4:18: error: 'h' was not declared in this scope 4 | d=((a+b)*h)/2; | ^ a.cc:6:17: error: expected ';' before '}' token 6 | return 0 | ^ | ; 7 | } | ~
s139940974
p03997
C
#include<stdio.h> int main(){ int a,b,h; scanf("%d%d%d",&a,&b,&c); printf("%d",(a+b)*h/2); return 0; }
main.c: In function 'main': main.c:4:25: error: 'c' undeclared (first use in this function) 4 | scanf("%d%d%d",&a,&b,&c); | ^ main.c:4:25: note: each undeclared identifier is reported only once for each function it appears in
s707123278
p03997
C++
#include<iostream> #include<math.h> #include<string> #include<algorithm> using namespace std; #define rep0(n) for(int i=0;i<n;i++) #define rep(n) for(int i=1;i<=n;i++) double const pi=3.1415926535; int printint(int n){ cout<<n<<endl; return 0; } int prints(string s){ cout<<s<<endl; return 0; } int cinint(string s){ int s; cin>>s; return n; } int main(){ cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; return 0; }
a.cc: In function 'int cinint(std::string)': a.cc:23:13: error: declaration of 'int s' shadows a parameter 23 | int s; | ^ a.cc:22:19: note: 'std::string s' previously declared here 22 | int cinint(string s){ | ~~~~~~~^ a.cc:25:16: error: 'n' was not declared in this scope 25 | return n; | ^ a.cc: In function 'int main()': a.cc:30:23: error: 'a' was not declared in this scope 30 | cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; | ^ a.cc:30:33: error: 'b' was not declared in this scope 30 | cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; | ^ a.cc:30:44: error: 'h' was not declared in this scope 30 | cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; | ^
s687410109
p03997
C++
#include<iostream> #include<math.h> #include<string> #include<algorithm> using namespace std; #define rep0(n) for(int i=0;i<n;i++) #define rep(n) for(int i=1;i<=n;i++) int const pi=3.1415926535; int printint(int n){ cout<<n<<endl; return 0; } int prints(string s){ cout<<s<<endl; return 0; } int cinint(int n){ int n; cin>>n; return n; } int main(){ cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; return 0; }
a.cc: In function 'int cinint(int)': a.cc:23:13: error: declaration of 'int n' shadows a parameter 23 | int n; | ^ a.cc:22:16: note: 'int n' previously declared here 22 | int cinint(int n){ | ~~~~^ a.cc: In function 'int main()': a.cc:30:23: error: 'a' was not declared in this scope 30 | cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; | ^ a.cc:30:33: error: 'b' was not declared in this scope 30 | cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; | ^ a.cc:30:44: error: 'h' was not declared in this scope 30 | cout<<(cinint(a)+cinint(b))*cinint(h)/2<<endl; | ^
s872852128
p03997
C++
#include<bits/stdc++.h> using namespace std; int main() { cin >> a >> b >> h; cout << (a+b)*h/2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:12: error: 'a' was not declared in this scope 5 | cin >> a >> b >> h; | ^ a.cc:5:17: error: 'b' was not declared in this scope 5 | cin >> a >> b >> h; | ^ a.cc:5:22: error: 'h' was not declared in this scope 5 | cin >> a >> b >> h; | ^
s147948564
p03997
C++
#include <bits/stdc++.h> //#include <math.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for (int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define pb push_back #define pf push_front #define fi first #define se second #define BIT(x,n) bitset<n>(x) #define PI 3.14159265358979323846 typedef long long ll; typedef pair<int,int> P; typedef pair<int,P> PP; struct edge { int to, cost; edge(int t,int c):to(t),cost(c) {} }; //----------------------------------------------------------------------------- int main() { cin.tie(0); ios::sync_with_stdio(false); int a,b,c;cin>>a>>b>>c; cout<<a*h/2+b*h/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:34:17: error: 'h' was not declared in this scope 34 | cout<<a*h/2+b*h/2<<endl; | ^
s841749386
p03997
C++
#include<iostream> using namespace std; int main(){ int a,b,h; cin >> a >> b >> h; int ans = (a+b)*h/2 cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: expected ',' or ';' before 'cout' 9 | cout << ans << endl; | ^~~~
s928750982
p03997
C++
using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; class hawawa { static Printer sw = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; static void Main() { Console.SetOut(sw); solve(); Console.Out.Flush(); } static void solve() { Scanner scanner = new Scanner(); int a = scanner.nextInt(), b = scanner.nextInt(), h = scanner.nextInt(); Console.WriteLine((a + b) * h / 2); } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string next() { if (i < s.Length) return s[i++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return next(); } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } } class Printer : StreamWriter { public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } } public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { } public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { } } /// <summary> /// Self-Balancing Binary Search Tree /// (using Randamized BST) /// </summary> public class SB_BinarySearchTree<T> where T : IComparable { public class Node { public T Value; public Node LChild; public Node RChild; public int Count; //size of the sub tree public Node(T v) { Value = v; Count = 1; } } static Random _rnd = new Random(); public static int Count(Node t) { return t == null ? 0 : t.Count; } static Node Update(Node t) { t.Count = Count(t.LChild) + Count(t.RChild) + 1; return t; } public static Node Merge(Node l, Node r) { if (l == null || r == null) return l == null ? r : l; if ((double)Count(l) / (double)(Count(l) + Count(r)) > _rnd.NextDouble()) { l.RChild = Merge(l.RChild, r); return Update(l); } else { r.LChild = Merge(l, r.LChild); return Update(r); } } /// <summary> /// split as [0, k), [k, n) /// </summary> public static Tuple<Node, Node> Split(Node t, int k) { if (t == null) return new Tuple<Node, Node>(null, null); if (k <= Count(t.LChild)) { var s = Split(t.LChild, k); t.LChild = s.Item2; return new Tuple<Node, Node>(s.Item1, Update(t)); } else { var s = Split(t.RChild, k - Count(t.LChild) - 1); t.RChild = s.Item1; return new Tuple<Node, Node>(Update(t), s.Item2); } } public static Node Remove(Node t, T v) { if (Find(t, v) == null) return t; return RemoveAt(t, LowerBound(t, v)); } public static Node RemoveAt(Node t, int k) { var s = Split(t, k); var s2 = Split(s.Item2, 1); return Merge(s.Item1, s2.Item2); } public static bool Contains(Node t, T v) { return Find(t, v) != null; } public static Node Find(Node t, T v) { while (t != null) { var cmp = t.Value.CompareTo(v); if (cmp > 0) t = t.LChild; else if (cmp < 0) t = t.RChild; else break; } return t; } public static Node FindByIndex(Node t, int idx) { if (t == null) return null; var currentIdx = Count(t) - Count(t.RChild) - 1; while (t != null) { if (currentIdx == idx) return t; if (currentIdx > idx) { t = t.LChild; currentIdx -= (Count(t == null ? null : t.RChild) + 1); } else { t = t.RChild; currentIdx += (Count(t == null ? null : t.LChild) + 1); } } return null; } public static int UpperBound(Node t, T v) { var torg = t; if (t == null) return -1; var ret = Int32.MaxValue; var idx = Count(t) - Count(t.RChild) - 1; while (t != null) { var cmp = t.Value.CompareTo(v); if (cmp > 0) { ret = Math.Min(ret, idx); t = t.LChild; idx -= (Count(t == null ? null : t.RChild) + 1); } else if (cmp <= 0) { t = t.RChild; idx += (Count(t == null ? null : t.LChild) + 1); } } return ret == Int32.MaxValue ? Count(torg) : ret; } public static int LowerBound(Node t, T v) { var torg = t; if (t == null) return -1; var idx = Count(t) - Count(t.RChild) - 1; var ret = Int32.MaxValue; while (t != null) { var cmp = t.Value.CompareTo(v); if (cmp >= 0) { if (cmp == 0) ret = Math.Min(ret, idx); t = t.LChild; if (t == null) ret = Math.Min(ret, idx); idx -= t == null ? 0 : (Count(t.RChild) + 1); } else if (cmp < 0) { t = t.RChild; idx += (Count(t == null ? null : t.LChild) + 1); if (t == null) return idx; } } return ret == Int32.MaxValue ? Count(torg) : ret; } public static Node Insert(Node t, T v) { var ub = LowerBound(t, v); return InsertByIdx(t, ub, v); } static Node InsertByIdx(Node t, int k, T v) { var s = Split(t, k); return Merge(Merge(s.Item1, new Node(v)), s.Item2); } public static IEnumerable<T> Enumerate(Node t) { var ret = new List<T>(); Enumerate(t, ret); return ret; } static void Enumerate(Node t, List<T> ret) { if (t == null) return; Enumerate(t.LChild, ret); ret.Add(t.Value); Enumerate(t.RChild, ret); } } /// <summary> /// C-like set /// </summary> public class Set<T> where T : IComparable { protected SB_BinarySearchTree<T>.Node _root; public T this[int idx] { get { return ElementAt(idx); } } public int Count() { return SB_BinarySearchTree<T>.Count(_root); } public virtual void Insert(T v) { if (_root == null) _root = new SB_BinarySearchTree<T>.Node(v); else { if (SB_BinarySearchTree<T>.Find(_root, v) != null) return; _root = SB_BinarySearchTree<T>.Insert(_root, v); } } public void Clear() { _root = null; } public void Remove(T v) { _root = SB_BinarySearchTree<T>.Remove(_root, v); } public bool Contains(T v) { return SB_BinarySearchTree<T>.Contains(_root, v); } public T ElementAt(int k) { var node = SB_BinarySearchTree<T>.FindByIndex(_root, k); if (node == null) throw new IndexOutOfRangeException(); return node.Value; } public int Count(T v) { return SB_BinarySearchTree<T>.UpperBound(_root, v) - SB_BinarySearchTree<T>.LowerBound(_root, v); } public int LowerBound(T v) { return SB_BinarySearchTree<T>.LowerBound(_root, v); } public int UpperBound(T v) { return SB_BinarySearchTree<T>.UpperBound(_root, v); } public Tuple<int, int> EqualRange(T v) { if (!Contains(v)) return new Tuple<int, int>(-1, -1); return new Tuple<int, int>(SB_BinarySearchTree<T>.LowerBound(_root, v), SB_BinarySearchTree<T>.UpperBound(_root, v) - 1); } public List<T> ToList() { return new List<T>(SB_BinarySearchTree<T>.Enumerate(_root)); } } /// <summary> /// C-like multiset /// </summary> public class MultiSet<T> : Set<T> where T : IComparable { public override void Insert(T v) { if (_root == null) _root = new SB_BinarySearchTree<T>.Node(v); else _root = SB_BinarySearchTree<T>.Insert(_root, v); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Globalization; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.IO; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Linq; | ^~~~~~ a.cc:6:7: error: expected nested-name-specifier before 'System' 6 | using System.Text; | ^~~~~~ a.cc:7:7: error: expected nested-name-specifier before 'System' 7 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:10: error: 'Printer' does not name a type 11 | static Printer sw = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; | ^~~~~~~ a.cc:26:2: error: expected ';' after class definition 26 | } | ^ | ; a.cc: In static member function 'static void hawawa::Main()': a.cc:15:5: error: 'Console' was not declared in this scope 15 | Console.SetOut(sw); | ^~~~~~~ a.cc:15:20: error: 'sw' was not declared in this scope 15 | Console.SetOut(sw); | ^~ a.cc: In static member function 'static void hawawa::solve()': a.cc:22:5: error: 'Scanner' was not declared in this scope 22 | Scanner scanner = new Scanner(); | ^~~~~~~ a.cc:23:13: error: 'scanner' was not declared in this scope 23 | int a = scanner.nextInt(), b = scanner.nextInt(), h = scanner.nextInt(); | ^~~~~~~ a.cc:24:5: error: 'Console' was not declared in this scope 24 | Console.WriteLine((a + b) * h / 2); | ^~~~~~~ a.cc:24:28: error: 'b' was not declared in this scope 24 | Console.WriteLine((a + b) * h / 2); | ^ a.cc:24:33: error: 'h' was not declared in this scope 24 | Console.WriteLine((a + b) * h / 2); | ^ a.cc: At global scope: a.cc:30:3: error: 'string' does not name a type 30 | string[] s; | ^~~~~~ a.cc:34:7: error: expected unqualified-id before '[' token 34 | char[] cs = new char[] { ' ' }; | ^ a.cc:36:9: error: expected ':' before 'Scanner' 36 | public Scanner() | ^~~~~~~~ | : a.cc:42:9: error: expected ':' before 'string' 42 | public string next() | ^~~~~~~ | : a.cc:42:10: error: 'string' does not name a type 42 | public string next() | ^~~~~~ a.cc:52:9: error: expected ':' before 'int' 52 | public int nextInt() | ^~~~ | : a.cc:57:9: error: expected ':' before 'long' 57 | public long nextLong() | ^~~~~ | : a.cc:62:9: error: expected ':' before 'double' 62 | public double nextDouble() | ^~~~~~~ | : a.cc:67:2: error: expected ';' after class definition 67 | } | ^ | ; a.cc: In constructor 'Scanner::Scanner()': a.cc:38:5: error: 's' was not declared in this scope 38 | s = new string[0]; | ^ a.cc:38:13: error: 'string' does not name a type 38 | s = new string[0]; | ^~~~~~ a.cc: In member function 'int Scanner::nextInt()': a.cc:54:12: error: expected primary-expression before 'int' 54 | return int.Parse(next()); | ^~~ a.cc:54:12: error: expected ';' before 'int' a.cc:54:15: error: expected unqualified-id before '.' token 54 | return int.Parse(next()); | ^ a.cc: In member function 'long int Scanner::nextLong()': a.cc:59:12: error: expected primary-expression before 'long' 59 | return long.Parse(next()); | ^~~~ a.cc:59:12: error: expected ';' before 'long' a.cc:59:16: error: expected unqualified-id before '.' token 59 | return long.Parse(next()); | ^ a.cc: In member function 'double Scanner::nextDouble()': a.cc:64:12: error: expected primary-expression before 'double' 64 | return double.Parse(next()); | ^~~~~~ a.cc:64:12: error: expected ';' before 'double' a.cc:64:18: error: expected unqualified-id before '.' token 64 | return double.Parse(next()); | ^ a.cc: At global scope: a.cc:70:1: error: expected class-name before '{' token 70 | { | ^ a.cc:71:9: error: expected ':' before 'override' 71 | public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } } | ^~~~~~~~~ | : a.cc:71:10: error: 'override' does not name a type 71 | public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } } | ^~~~~~~~ a.cc:72:9: error: expected ':' before 'Printer' 72 | public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { } | ^~~~~~~~ | : a.cc:72:24: error: expected ')' before 'stream' 72 | public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { } | ~ ^~~~~~~ | ) a.cc:73:9: error: expected ':' before 'Printer' 73 | public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { } | ^~~~~~~~ | : a.cc:73:24: error: expected ')' before 'stream' 73 | public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { } | ~ ^~~~~~~ | ) a.cc:74:2: error: expected ';' after class definition 74 | } | ^ | ; a.cc:80:1: error: expected unqualified-id before 'public' 80 | public class SB_BinarySearchTree<T> where T : IComparable | ^~~~~~ a.cc:282:1: error: expected unqualified-id before 'public' 282 | public class Set<T> where T : IComparable | ^~~~~~ a.cc:355:1: error: expected unqualified-id before 'public' 355 | public class MultiSet<T> : Set<T> where T : IComparable | ^~~~~~
s633061280
p03997
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a + b)*h / 2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:25: error: 'h' was not declared in this scope 8 | cout << (a + b)*h / 2 << endl; | ^
s430298519
p03997
Java
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); int h = scanner.nextInt(); System.out.print((a + b) * h / 2); } }
Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s152407337
p03997
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); int c =2; System.out.println((a+b)h/2); } }
Main.java:9: error: ')' or ',' expected System.out.println((a+b)h/2); ^ Main.java:9: error: not a statement System.out.println((a+b)h/2); ^ Main.java:9: error: ';' expected System.out.println((a+b)h/2); ^ 3 errors
s497041337
p03997
C++
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int h = sc.nextInt(); int c = 2; System.out.println((a+b)h/2); } }
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:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s029832846
p03997
C++
#include<iostream> using namespace std; main int(){ int a,b,c; cin>>a>>b>>c; cout<<(a+b)*c/2<<endl; }
a.cc:3:1: error: 'main' does not name a type 3 | main int(){ | ^~~~
s545004379
p03997
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; cout << (a+b)*h/2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:23: error: 'h' was not declared in this scope 6 | cout << (a+b)*h/2 << endl; | ^