submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s910882878
p00004
C++
* * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004 */ #include <iomanip> #include <iostream> #include <sstream> #include <vector> #define N 2 #define L N*(N+1) using namespace std; int main() { string line; while (getline(cin, line)) { istringstream iss(line); vector <float> coef(L); for (int i = 0; i < L; i++) iss >> coef[i]; float pivot, mul; for (int i = 0; i < N; i++) { pivot = coef[i * (N + 1) + i]; for (int j = 0; j < N + 1; j++) { coef[i * (N + 1) + j] = (1 / pivot) * coef[i * (N + 1) + j]; } for (int k = i + 1; k < N; k++) { mul = coef[k * (N + 1) + i]; for (int l = i; l < N + 1; l++) { coef[k * (N + 1) + l] = coef[k * (N + 1) + l] - mul * coef[i * (N + 1) + l]; } } } for (int i = N - 1; i > 0; i--) { for (int k = i - 1; k >= 0; k--) { mul = coef[k * (N + 1) + i]; for (int l = i; l < N + 1; l++) { coef[k * (N + 1) + l] = coef[k * (N + 1) + l] - mul * coef[i * (N + 1) + l]; } } } for (int i = 0; i < N; i++) { if (i > 0) cout << ' '; cout << fixed << setprecision(3) << coef[i * (N + 1) + N]; } cout << endl; } return 0; }
a.cc:2:8: error: expected constructor, destructor, or type conversion before ':' token 2 | * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004 | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/iomanip:41, from a.cc:4: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50, from /usr/include/c++/14/string:42, 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/iomanip:42: /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/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /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; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /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/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i
s535492009
p00004
C++
#include <iostream> #include <iomanip> using namespace std; double a, b, c, d, e, f; double x(double, double, double, double, double, double) { return (c*e - b*f) / (a*e - b*d); } double y(double, double, double, double, double, double) { return (a*f - c*d) / (a*e - b*d); } double round(double dat, int keta){ int fct; fct = (int)pow(10, keta - 1); dat *= fct; dat += (dat < 0) ? -0.5 : 0.5; dat = (int)(dat); dat /= fct; return dat; } int main() { double x1, x2, y1, y2; cin >> a >> b >> c >> d >> e >> f; x1 = x(a, b, c, d, e, f); y1 = y(a, b, c, d, e, f); cin >> a >> b >> c >> d >> e >> f; x2 = x(a, b, c, d, e, f); y2 = y(a, b, c, d, e, f); cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl; cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl; return 0; }
a.cc: In function 'double round(double, int)': a.cc:20:20: error: 'pow' was not declared in this scope 20 | fct = (int)pow(10, keta - 1); | ^~~
s512089199
p00004
C++
#include <iostream> #include <iomanip> #include <cmath> using namespace std; double a, b, c, d, e, f; double x(double, double, double, double, double, double) { return (c*e - b*f) / (a*e - b*d); } double y(double, double, double, double, double, double) { return (a*f - c*d) / (a*e - b*d); } double round(double dat, int keta ){ int fct; fct = double pow(10, keta - 1); dat *= fct; dat += (dat < 0) ? -0.5 : 0.5; dat = (int)(dat); dat /= fct; return dat; } int main() { double x1, x2, y1, y2; cin >> a >> b >> c >> d >> e >> f; x1 = x(a, b, c, d, e, f); y1 = y(a, b, c, d, e, f); cin >> a >> b >> c >> d >> e >> f; x2 = x(a, b, c, d, e, f); y2 = y(a, b, c, d, e, f); cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl; cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl; return 0; }
a.cc: In function 'double round(double, int)': a.cc:23:16: error: expected primary-expression before 'double' 23 | fct = double pow(10, keta - 1); | ^~~~~~
s401992501
p00004
C++
#include <iostream> #include <iomanip> #include <cmath> using namespace std; double a, b, c, d, e, f; double x(double, double, double, double, double, double) { return (c*e - b*f) / (a*e - b*d); } double y(double, double, double, double, double, double) { return (a*f - c*d) / (a*e - b*d); } double round(double dat, int keta ){ int fct; fct = int pow(10, keta - 1); dat *= fct; dat += (dat < 0) ? -0.5 : 0.5; dat = (int)(dat); dat /= fct; return dat; } int main() { double x1, x2, y1, y2; cin >> a >> b >> c >> d >> e >> f; x1 = x(a, b, c, d, e, f); y1 = y(a, b, c, d, e, f); cin >> a >> b >> c >> d >> e >> f; x2 = x(a, b, c, d, e, f); y2 = y(a, b, c, d, e, f); cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl; cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl; return 0; }
a.cc: In function 'double round(double, int)': a.cc:23:16: error: expected primary-expression before 'int' 23 | fct = int pow(10, keta - 1); | ^~~
s304139283
p00004
C++
#include<iostream> #include<iomanip> int main(){ int a,b,c,d,e,f; while(std::cin >> a >> b >> c >> d >> e >> f){ double x, y; int p,q; p = a * e - d * b; q = c * e - f * b; x = q / p; y = (c - a * x) / b; printf("%.3f %.3f\n",x,y); } return 0; } ~ ~
a.cc:18:1: error: expected class-name before '~' token 18 | ~ | ^
s516577932
p00004
C++
t = 0 while t == 0: try: a,b,e,c,d,f = [int(i) for i in input().split()] except: break else: x = (d*e - b*f) / (a*d - b*c) + 0 y = (a*f - c*e) / (a*d - b*c) + 0 print("{0:.3f}".format(x) + "{0:.3f}".format(y))
a.cc:1:1: error: 't' does not name a type 1 | t = 0 | ^
s772883609
p00004
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> void main(void) { char string[99]; printf("a,b,c,d,e,f??????????????????????????§??\?????????????????????\n"); double a=0, b=0, c=0, d=0, e=0, f=0; scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f); double x = (f*b - e*c) / (d*b - e*a); double y = (f*a - d*c) / (e*a - d*b); printf("%f %f\n", x, y); return; }
a.cc:6:1: error: '::main' must return 'int' 6 | void main(void) { | ^~~~ a.cc: In function 'int main()': a.cc:14:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 14 | return; | ^~~~~~
s697904702
p00004
C++
#include <stdio.h> void main(void){ double a=0, b=0, c=0, d=0, e=0, f=0; scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f); double x = (f*b - e*c) / (d*b - e*a); double y = (f*a - d*c) / (e*a - d*b); printf("%f %f\n", x, y); return; }
a.cc:4:1: error: '::main' must return 'int' 4 | void main(void){ | ^~~~ a.cc: In function 'int main()': a.cc:10:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 10 | return; | ^~~~~~
s102126074
p00004
C++
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> void main(void) { printf("a,b,c,d,e,f??????????????????????????§??\?????????????????????\n"); double a=0, b=0, c=0, d=0, e=0, f=0; scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f); double x = (f*b - e*c) / (d*b - e*a); double y = (f*a - d*c) / (e*a - d*b); printf("%f %f\n", x, y); return; }
a.cc:7:1: error: '::main' must return 'int' 7 | void main(void) { | ^~~~ a.cc: In function 'int main()': a.cc:14:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 14 | return; | ^~~~~~
s530191953
p00004
C++
#include<iostream> #include<iomanip> #include<cstdio> #include<vector> #include<algorithm> #include<cmath> #include<queue> #include<stack> #include<functional> #include<string> #include<cstring> #include <sstream> using namespace std; int main(void){ double a,b,c,d,e,f,x,y; while(cin >> a >> b >> c >> d >> e >> f){ double ad = a / d; d *= ad; e *= ad; f *= ad; d -= a; e -= b; f -= c; y = f/e; x = (c - b * y)/a; y *= 1000; y = round(y); y /= 1000; x *= 1000; x = round(x); x /= 1000; cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; } return 0; }
a.cc:32:70: error: stray '\' in program 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ a.cc: In function 'int main()': a.cc:32:71: error: expected primary-expression before '?' token 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ a.cc:32:72: error: expected primary-expression before '?' token 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ a.cc:32:73: error: expected primary-expression before '?' token 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ a.cc:32:95: error: no match for 'operator<<' (operand types are 'std::_Setprecision' and 'double') 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ~~~~~~~~~~~~~~~~~~~~ ^~ ~ | | | | | double | std::_Setprecision 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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ 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:32:91: note: cannot convert 'std::setprecision(3)' (type 'std::_Setprecision') to type 'std::byte' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ~~~~~~~~~~~~~~~~~^~~ 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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<char, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<char, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<char, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ 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:32:98: note: 'std::_Setprecision' is not derived from 'std::basic_ostream<_CharT, _Traits>' 32 | cout << fixed << std::setprecision(3) << x << " " << fixed <<\???std::setprecision(3) << y << endl; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::ope
s302221440
p00004
C++
#include <cstdio> #include <iostream> double sol[10000][2]; int main() { double a, b, e, c, d, f; int i = 0; while (std::cin >> a >> b >> e >> c >> d >> f) { double det = a * d - b * c; double aa = d / det, bb = -b / det, cc = -c / det, dd = a / det; sol[i][0] = aa * e + bb * f; sol[i][1] = cc * e + dd * f; i++; } for (int j = 0; j < i; j++) printf("%.3f %.3f\n", sol[j][0], sol[j][1]); return 0;
a.cc: In function 'int main()': a.cc:20:14: error: expected '}' at end of input 20 | return 0; | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s344856027
p00004
C++
#include<iostream> #include<algorithm> #include<stdio.h> using namespace std; int main(){ int a,b,c,d,e,f; int o,p,q,r,s,t; float x,y; for(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF){ o=a;p=b;q=c;r=d;s=e;t=f; o*=d;p*=d;q*=d; r*=a;s*=a;t*=a; //printf("%d %d %d %d %d %d \n",o,p,q,r,s,t); p-=s; q-=t; y=(float)(q/p); int g=(int)(e*y); g*=-1; x=(float)((f+g)/d); printf("%.3f %.3f",x,y); } }
a.cc: In function 'int main()': a.cc:9:57: error: expected ';' before ')' token 9 | for(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF){ | ^ a.cc:22:1: error: expected primary-expression before '}' token 22 | } | ^ a.cc:21:10: error: expected ';' before '}' token 21 | } | ^ | ; 22 | } | ~ a.cc:22:1: error: expected primary-expression before '}' token 22 | } | ^ a.cc:21:10: error: expected ')' before '}' token 21 | } | ^ | ) 22 | } | ~ a.cc:9:12: note: to match this '(' 9 | for(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF){ | ^ a.cc:22:1: error: expected primary-expression before '}' token 22 | } | ^
s460212250
p00004
C++
#include<iostream> #include<iomanip> #include<vector> #include<map> #include<string> using namespace std; /* ??£???????¨???? ax + by = c dx + ey = f ????§£x, y???????????????????????°?????? */ int main() { double a, b, c, d, e, f; int cnt = 0; //??\??????????????£???????¨????????????° std::vector<double> x_vector; //x????§£???????´? std::vector<double> y_vector; //y????§£???????´? #if 0 while (cnt < 2) { cin >> a >> b >> c >> d >> e >> f; #else while (cin >> a >> b >> c >> d >> e >> f) { #endif double x = (b * f - c * e) / (b * d - a * e); double y = (c * d - a * f) / (b * d - a * e); cnt++; x_vector.push_back(x); y_vector.push_back(y); } for (unsigned int i = 0; i < cnt; i++) { double x_result = round(x_vector[i] * 1000) / 1000; double y_result = round(y_vector[i] * 1000) / 1000; std::cout << std::fixed; std::cout << std::setprecision(3) << x_result << " "; std::cout << std::setprecision(3) << y_result << endl; } //???????????° //while (1); return 0; }
a.cc: In function 'int main()': a.cc:35:35: error: 'round' was not declared in this scope 35 | double x_result = round(x_vector[i] * 1000) / 1000; | ^~~~~
s879868035
p00004
C++
#include<iostream> #include<iomanip> #include<vector> #include<map> #include<string> using namespace std; /* ??£???????¨???? ax + by = c dx + ey = f ????§£x, y???????????????????????°?????? */ int main() { double a, b, c, d, e, f; int cnt = 0; //??\??????????????£???????¨????????????° std::vector<double> x_vector; //x????§£???????´? std::vector<double> y_vector; //y????§£???????´? #if 0 while (cnt < 2) { cin >> a >> b >> c >> d >> e >> f; #else while (cin >> a >> b >> c >> d >> e >> f) { #endif double x = (b * f - c * e) / (b * d - a * e); double y = (c * d - a * f) / (b * d - a * e); cnt++; x_vector.push_back(x); y_vector.push_back(y); } for (unsigned int i = 0; i < cnt; i++) { double x_result = std::round(x_vector[i] * 1000) / 1000; double y_result = std::round(y_vector[i] * 1000) / 1000; std::cout << std::fixed; std::cout << std::setprecision(3) << x_result << " "; std::cout << std::setprecision(3) << y_result << endl; } //???????????° //while (1); return 0; }
a.cc: In function 'int main()': a.cc:35:40: error: 'round' is not a member of 'std' 35 | double x_result = std::round(x_vector[i] * 1000) / 1000; | ^~~~~ a.cc:36:40: error: 'round' is not a member of 'std' 36 | double y_result = std::round(y_vector[i] * 1000) / 1000; | ^~~~~
s495537100
p00004
C++
while(True): try: a,b,c,d,e,f = map(float,input().split(" ")) z = a*e - b*d if(z!=0): x = (c*e-b*f)/z y = (a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while(True): | ^~~~~
s502540213
p00004
C++
#include <bits/stdc++.h> // #include "bits/stdc++.h" #define pout(n) printf ("%d\n", n) #define rep(i,a,n) for (int i = a;i < n;i++) #define per(i,n,a) for (int i = n-1;i >= a;i--) const int d4x[4] = {1, 0, -1, 0}; const int d4y[4] = {0, 1, 0, -1}; const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 }; const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 }; typedef long long ll; using namespace std; int main() { double a,b,c,d,e,f,x,y; while(cin >> a >> b >> c >> d >> e >> f;){ y = (c*d-a*f)/(b*d-a*e); x = (c-b*y)/a; } printf("%.3f %.3f\n",x,y); return 0; }
a.cc: In function 'int main()': a.cc:20:42: error: expected ')' before ';' token 20 | while(cin >> a >> b >> c >> d >> e >> f;){ | ~ ^ | ) a.cc:20:43: error: expected primary-expression before ')' token 20 | while(cin >> a >> b >> c >> d >> e >> f;){ | ^
s097219071
p00004
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s753012750
p00004
C++
#include <iostream> #include <cstdio> using namespace std; void calc(double x1, double y1, double a, double x2, double y2, double b) { double d1 = x2; double d2 = x1; double xx1 = d1 * x1; double xy1 = d1 * y1; double a1 = d1 * a; double xx2 = d2 * x2; double xy2 = d2 * y2; double b1 = d2 * b; double y = xy1 - xy2; double c = a1 - b1; y = c / y; d1 = y2; d2 = y1; xx1 = d1 * x1; xy1 = d1 * y1; a1 = d1 * a; xx2 = d2 * x2; xy2 = d2 * y2; b1 = d2 * b; double x = xx1 - xx2; c = a1 - b1; x = c / x; if (x == 0) { x = 0; } if (y == 0) { y = 0; } printf("%.3lf %.3lf\n", x, y); } int main() { double x1, y1, a, x2, y2, b; while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &y2 , &b) != EOF) { calc(x1, y1, a, x2, y2, b); } return 0; }
a.cc: In function 'int main()': a.cc:44:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 44 | while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &y2 , &b) != EOF) | ^~~~~~~ | scanf
s684196278
p00004
C++
#include <iostream> #include <cstdio> using namespace std; void calc(double x1, double y1, double a, double x2, double y2, double b) { double d1 = x2; double d2 = x1; double xx1 = d1 * x1; double xy1 = d1 * y1; double a1 = d1 * a; double xx2 = d2 * x2; double xy2 = d2 * y2; double b1 = d2 * b; double y = xy1 - xy2; double c = a1 - b1; y = c / y; d1 = y2; d2 = y1; xx1 = d1 * x1; xy1 = d1 * y1; a1 = d1 * a; xx2 = d2 * x2; xy2 = d2 * y2; b1 = d2 * b; double x = xx1 - xx2; c = a1 - b1; x = c / x; if (x == 0) { x = 0; } if (y == 0) { y = 0; } printf("%.3lf %.3lf\n", x, y); } int main() { int x1, y1, a, x2, y2, b; while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) { calc(x1, y1, a, x2, y2, b); } return 0; }
a.cc: In function 'int main()': a.cc:44:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 44 | while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) | ^~~~~~~ | scanf
s300953643
p00004
C++
#include <iostream> #include <cstdio> using namespace std; void calc(double x1, double y1, double a, double x2, double y2, double b) { double d1 = x2; double d2 = x1; double xx1 = d1 * x1; double xy1 = d1 * y1; double a1 = d1 * a; double xx2 = d2 * x2; double xy2 = d2 * y2; double b1 = d2 * b; double y = xy1 - xy2; double c = a1 - b1; y = c / y; d1 = y2; d2 = y1; xx1 = d1 * x1; xy1 = d1 * y1; a1 = d1 * a; xx2 = d2 * x2; xy2 = d2 * y2; b1 = d2 * b; double x = xx1 - xx2; c = a1 - b1; x = c / x; if (x == 0) { x = 0; } if (y == 0) { y = 0; } printf("%.3lf %.3lf\n", x, y); } int main() { int x1, y1, a, x2, y2, b; while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) { calc(x1, y1, a, x2, y2, b); } return 0; }
a.cc: In function 'int main()': a.cc:44:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 44 | while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) | ^~~~~~~ | scanf
s531585373
p00004
C++
#include <iostream> #include <cstdio> using namespace std; void calc(double x1, double y1, double a, double x2, double y2, double b) { double d1 = x2; double d2 = x1; double xx1 = d1 * x1; double xy1 = d1 * y1; double a1 = d1 * a; double xx2 = d2 * x2; double xy2 = d2 * y2; double b1 = d2 * b; double y = xy1 - xy2; double c = a1 - b1; y = c / y; d1 = y2; d2 = y1; xx1 = d1 * x1; xy1 = d1 * y1; a1 = d1 * a; xx2 = d2 * x2; xy2 = d2 * y2; b1 = d2 * b; double x = xx1 - xx2; c = a1 - b1; x = c / x; if (x == 0) { x = 0; } if (y == 0) { y = 0; } printf("%.3lf %.3lf\n", x, y); } int main(int argc, char const *argv[]) { int x1, y1, a, x2, y2, b; while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) { calc(x1, y1, a, x2, y2, b); } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:44:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 44 | while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) | ^~~~~~~ | scanf
s933070385
p00004
C++
#include <cstdio> void calc(int x1, int y1, int a, int x2, int y2, int b) { double d1 = x2; double d2 = x1; double xx1 = d1 * x1; double xy1 = d1 * y1; double a1 = d1 * a; double xx2 = d2 * x2; double xy2 = d2 * y2; double b1 = d2 * b; double y = xy1 - xy2; double c = a1 - b1; y = c / y; d1 = y2; d2 = y1; xx1 = d1 * x1; xy1 = d1 * y1; a1 = d1 * a; xx2 = d2 * x2; xy2 = d2 * y2; b1 = d2 * b; double x = xx1 - xx2; c = a1 - b1; x = c / x; if (x == 0) { x = 0; } if (y == 0) { y = 0; } printf("%.3lf %.3lf\n", x, y); } int main(int argc, char const *argv[]) { int x1, y1, a, x2, y2, b; while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) { calc(x1, y1, a, x2, y2, b); } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:42:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 42 | while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF) | ^~~~~~~ | scanf
s217254233
p00004
C++
use std::io::{stdin, BufRead, BufReader}; fn main(){ let input = BufReader::new(stdin()); for line in input.lines(){ let v: Vec<f32> = line.unwrap().split_whitespace().filter_map(|x| x.parse::<f32>().ok()).collect(); println!("{:.3} {:.3}", (v[2]*v[4]-v[1]*v[5])/(v[0]*v[4]-v[1]*v[3]),(v[2]*v[3]-v[0]*v[5])/(v[1]*v[3]-v[0]*v[4])); } } // --- template --- #[allow(unused_imports)] use std::cmp::{max, min}; #[allow(unused_imports)] pub trait FromLn { fn fromln(s: &str) -> Self; } pub fn readln<T: FromLn>() -> T { let mut buf = String::new(); let _ = ::std::io::stdin().read_line(&mut buf).unwrap(); T::fromln(buf.trim()) } pub fn readlns<T: FromLn>(n: usize) -> Vec<T> { let mut vs = vec![]; for _ in 0..n { vs.push(readln()); } vs } macro_rules! fromln_primitives { ($($t:ty),*) => { $( impl FromLn for $t { fn fromln(s: &str) -> $t { s.parse().unwrap() } } )* } } fromln_primitives!( String, bool, f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64 ); impl<T> FromLn for Vec<T> where T: FromLn, { fn fromln(s: &str) -> Vec<T> { s.split_whitespace().map(T::fromln).collect() } } impl FromLn for Vec<char> { fn fromln(s: &str) -> Vec<char> { s.chars().collect() } } macro_rules! fromln_tuple { ($($t:ident),*) => { impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* { fn fromln(s: &str) -> ($($t),*) { let mut it = s.split_whitespace(); let t = ($($t::fromln(it.next().unwrap())),*); assert_eq!(it.next(), None); t } } } } fromln_tuple!(A, B); fromln_tuple!(A, B, C); fromln_tuple!(A, B, C, D); fromln_tuple!(A, B, C, D, E); fromln_tuple!(A, B, C, D, E, F);
a.cc:16:2: error: invalid preprocessing directive #[ 16 | #[allow(unused_imports)] | ^ a.cc:18:2: error: invalid preprocessing directive #[ 18 | #[allow(unused_imports)] | ^ a.cc:30:14: error: too many decimal points in number 30 | for _ in 0..n { | ^~~~ a.cc:1:1: error: 'use' does not name a type 1 | use std::io::{stdin, BufRead, BufReader}; | ^~~ a.cc:3:1: error: 'fn' does not name a type 3 | fn main(){ | ^~ a.cc:17:1: error: 'use' does not name a type 17 | use std::cmp::{max, min}; | ^~~ a.cc:20:1: error: 'pub' does not name a type 20 | pub trait FromLn { | ^~~ a.cc:23:1: error: 'pub' does not name a type 23 | pub fn readln<T: FromLn>() -> T { | ^~~ a.cc:28:1: error: 'pub' does not name a type 28 | pub fn readlns<T: FromLn>(n: usize) -> Vec<T> { | ^~~ a.cc:35:1: error: 'macro_rules' does not name a type 35 | macro_rules! fromln_primitives { | ^~~~~~~~~~~ a.cc:44:1: error: 'fromln_primitives' does not name a type 44 | fromln_primitives!( | ^~~~~~~~~~~~~~~~~ a.cc:60:1: error: 'impl' does not name a type 60 | impl<T> FromLn for Vec<T> | ^~~~ a.cc:68:1: error: 'impl' does not name a type 68 | impl FromLn for Vec<char> { | ^~~~ a.cc:73:1: error: 'macro_rules' does not name a type 73 | macro_rules! fromln_tuple { | ^~~~~~~~~~~ a.cc:85:1: error: 'fromln_tuple' does not name a type 85 | fromln_tuple!(A, B); | ^~~~~~~~~~~~ a.cc:86:1: error: 'fromln_tuple' does not name a type 86 | fromln_tuple!(A, B, C); | ^~~~~~~~~~~~ a.cc:87:1: error: 'fromln_tuple' does not name a type 87 | fromln_tuple!(A, B, C, D); | ^~~~~~~~~~~~ a.cc:88:1: error: 'fromln_tuple' does not name a type 88 | fromln_tuple!(A, B, C, D, E); | ^~~~~~~~~~~~ a.cc:89:1: error: 'fromln_tuple' does not name a type 89 | fromln_tuple!(A, B, C, D, E, F); | ^~~~~~~~~~~~
s139054421
p00004
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <sstream> using namespace std; using DataSet = vector<double>; void readInputData(vector<string>& input_data){ string buff; while(getline(cin, buff)){ input_data.push_back(buff); } } void _parseString(const string& input_data, DataSet& data_set) { data_set.resize(6); stringstream ss; ss << input_data; ss >> data_set[0] >> data_set[1] >> data_set[2] >> data_set[3] >> data_set[4] >> data_set[5]; } void parseString(const vector<string>& input_data, vector<DataSet>& data_set) { data_set.resize(input_data.size()); for(int i = 0; i < input_data.size(); ++i) { DataSet buff; _parseString(input_data[i], buff); data_set[i] = buff; } } double determinant2d(const DataSet& data){ return data[0] * data[4] - data[1] * data[3]; } void inverse2d(DataSet& data){ double t = data[0]; data[0] = data[4]; data[4] = t; data[1] = -data[1]; data[3] = -data[3]; } void calculateXY(const DataSet& data, double det, vector<double>& result){ result.resize(2); result[0] = (data[0] * data[2] + data[1] * data[5]) / det; result[1] = (data[3] * data[2] + data[4] * data[5]) / det; } void solve(vector<DataSet>& data_set){ cout << fixed; cout << setprecision(3); for(int i = 0; i < data_set.size(); ++i){ vector<double> buff; double det = determinant2d(data_set[i]); inverse2d(data_set[i]); calculateXY(data_set[i], det, buff); cout << buff[0] << " " << buff[1] << endl; } } void doAllProcess(){ vector<string> input_data; readInputData(input_data); vector<DataSet> data_set; parseString(input_data, data_set); solve(data_set); } } int main(){ doAllProcess(); return 0; }
a.cc:89:1: error: expected declaration before '}' token 89 | } | ^
s110627624
p00004
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <sstream> using namespace std; using DataSet = vector<double>; void readInputData(vector<string>& input_data){ string buff; while(getline(cin, buff)){ input_data.push_back(buff); } } void _parseString(const string& input_data, DataSet& data_set) { data_set.resize(6); stringstream ss; ss << input_data; ss >> data_set[0] >> data_set[1] >> data_set[2] >> data_set[3] >> data_set[4] >> data_set[5]; } void parseString(const vector<string>& input_data, vector<DataSet>& data_set) { data_set.resize(input_data.size()); for(int i = 0; i < input_data.size(); ++i) { DataSet buff; _parseString(input_data[i], buff); data_set[i] = buff; } } double determinant2d(const DataSet& data){ return data[0] * data[4] - data[1] * data[3]; } void inverse2d(DataSet& data){ double t = data[0]; data[0] = data[4]; data[4] = t; data[1] = -data[1]; data[3] = -data[3]; } void calculateXY(const DataSet& data, double det, vector<double>& result){ result.resize(2); result[0] = (data[0] * data[2] + data[1] * data[5]) / det; result[1] = (data[3] * data[2] + data[4] * data[5]) / det; } void solve(vector<DataSet>& data_set){ cout << fixed; cout << setprecision(3); for(int i = 0; i < data_set.size(); ++i){ vector<double> buff; double det = determinant2d(data_set[i]); inverse2d(data_set[i]); calculateXY(data_set[i], det, buff); cout << buff[0] << " " << buff[1] << endl; } } void doAllProcess(){ vector<string> input_data; readInputData(input_data); vector<DataSet> data_set; parseString(input_data, data_set); solve(data_set); } } int main(){ doAllProcess(); return 0; }
a.cc:89:1: error: expected declaration before '}' token 89 | } | ^
s401103982
p00004
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<vector> using namespace std; int main() { double a, b, c, d, e, f, xx, yy; while (cin >> a >> b >> c >> d >> e >> f) { double y = (a * f - c * d) / (a * e - b * d); double y = (c*d - a * f) / (b*d - a * e); cout << fixed << setprecision(3) << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:20: error: redeclaration of 'double y' 11 | double y = (c*d - a * f) / (b*d - a * e); | ^ a.cc:10:24: note: 'double y' previously declared here 10 | double y = (a * f - c * d) / (a * e - b * d); | ^ a.cc:12:53: error: 'x' was not declared in this scope 12 | cout << fixed << setprecision(3) << x << " " << y << endl; | ^
s435692860
p00004
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<vector> using namespace std; int main() { double a, b, c, d, e, f, xx, yy; while (cin >> a >> b >> c >> d >> e >> f) { double y = (a * f - c * d) / (a * e - b * d);    double y = (c*d - a * f) / (b*d - a * e); cout << fixed << setprecision(3) << x << " " << y << endl; } return 0; }
a.cc:11:12: error: extended character   is not valid in an identifier 11 |    double y = (c*d - a * f) / (b*d - a * e); | ^ a.cc:11:12: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:11:12: error: '\U00003000\U00003000' was not declared in this scope 11 |    double y = (c*d - a * f) / (b*d - a * e); | ^~~~ a.cc:12:53: error: 'x' was not declared in this scope 12 | cout << fixed << setprecision(3) << x << " " << y << endl; | ^
s289787855
p00004
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<vector> using namespace std; int main() { double a, b, c, d, e, f, xx, yy; while (cin >> a >> b >> c >> d >> e >> f) { double y = (a * f - c * d) / (a * e - b * d); double y = (c*d - a * f) / (b*d - a * e); cout << fixed << setprecision(3) << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:16: error: redeclaration of 'double y' 11 | double y = (c*d - a * f) / (b*d - a * e); | ^ a.cc:10:16: note: 'double y' previously declared here 10 | double y = (a * f - c * d) / (a * e - b * d); | ^ a.cc:12:45: error: 'x' was not declared in this scope 12 | cout << fixed << setprecision(3) << x << " " << y << endl; | ^
s803671869
p00004
C++
#include <stdio.h> #include <vector> #include <utility> #include <algorithm> #include <iostream> using namespace std; #define rep(i,n) for(int i=0;i<n;++i) #define ld long double ld a,b,c,d,e,f,x,y; ld shish(ld a) { a*=1000; a+=0.5; a=int(a); a/=1000; } int main(){ while(cin>>a>>b>>c>>d>>e>>f){ y=(a*f-c*d)/(ld)(a*e-b*d); x=(c*e-f*b)/(ld)(a*e-b*d); x=shish(x); y=sihsh(y); printf("%.3f " , x); printf("%.3f" , y); cout<<endl; } }
a.cc: In function 'long double shish(long double)': a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type] 16 | } | ^ a.cc: In function 'int main()': a.cc:22:7: error: 'sihsh' was not declared in this scope; did you mean 'shish'? 22 | y=sihsh(y); | ^~~~~ | shish
s624630243
p00004
C++
#include<iostream> #include<iomanip> using namespace std; int main() double a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { double y = (a * f - c * d) / (a * e - b * d); double x = (c - b * y) / a; cout << fixed << setprecision(3) << x << " " << y << endl; } return 0; }
a.cc:6:9: error: expected initializer before 'double' 6 | double a, b, c, d, e, f; | ^~~~~~ a.cc:7:9: error: expected unqualified-id before 'while' 7 | while (cin >> a >> b >> c >> d >> e >> f) { | ^~~~~ a.cc:12:9: error: expected unqualified-id before 'return' 12 | return 0; | ^~~~~~ a.cc:13:1: error: expected declaration before '}' token 13 | } | ^
s097861647
p00004
C++
using namespace std; int main(){ int a,b,c,d,e,f; double x,y; while(cin>>a>>b>>c>>d>>e>>f){ if(x != 0) x=(b*f-c*e)/(b*d-a*e); else x=0; if(y != 0)y = (a*f-c*d)/(a*e-b*d); else y = 0; cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:11: error: 'cin' was not declared in this scope 5 | while(cin>>a>>b>>c>>d>>e>>f){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:12:9: error: 'cout' was not declared in this scope 12 | cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl; | ^~~~ a.cc:12:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:15: error: 'fixed' was not declared in this scope 12 | cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl; | ^~~~~ a.cc:1:1: note: 'std::fixed' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>' +++ |+#include <ios> 1 | using namespace std; a.cc:12:22: error: 'setprecision' was not declared in this scope 12 | cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl; | ^~~~~~~~~~~~ a.cc:1:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' +++ |+#include <iomanip> 1 | using namespace std; a.cc:12:50: error: 'endl' was not declared in this scope 12 | cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s327481629
p00004
C++
#include<stdio.h> int main(void){ double a, b, c, d, e, f; double A,B; double x, y; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ if ( (a >= 0 && d < =0)|| (a >= 0 && d >= 0)) { A = c*d - f*a; B = b*d - e*a; y = A / B; } else if ((a < 0 && d > 0) || (a < 0 && d < 0)) { A = c*d + f*a; B = b*d + e*a; y = A / B; } x = (c - y * b) / a; printf("%.3f %.3f\n" ,x , y); } return 0; }
a.cc: In function 'int main()': a.cc:11:30: error: expected primary-expression before '=' token 11 | if ( (a >= 0 && d < =0)|| (a >= 0 && d >= 0)) { | ^
s184806801
p00004
C++
#include<stdio.h> int main(void){ double a, b, c, d, e, f; double A,B; double x, y; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ if ( (a >= 0 && d <= 0)|| (a >= 0 && d >= 0)) { A = c*d - f*a; B = b*d - e*a; y = A / B; } else if ((a < 0 && d > 0) || (a < 0 && d < 0)) { A = c*d + f*a; B = b*d + e*a; y = A / B; } x = (c - y * b) / a; printf("%.3f %.3f\n" ,x , y); } return 0; }
a.cc:11:30: error: extended character   is not valid in an identifier 11 | if ( (a >= 0 && d <= 0)|| (a >= 0 && d >= 0)) { | ^ a.cc: In function 'int main()': a.cc:11:30: error: '\U000030000' was not declared in this scope 11 | if ( (a >= 0 && d <= 0)|| (a >= 0 && d >= 0)) { | ^~~
s831388784
p00004
C++
#include<stdio.h> int main(void){ double a, b, c, d, e, f; double A,B; double x, y; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) { A = c*d - f*a; B = b*d - e*a; y = A / B; } else if ((a <= 0 && d >= 0) || (a <= 0 && d <= 0)) { A = c*d + f*a; B = b*d + e*a; y = A / B; } x = (c - y * b) / a; printf("%.3f %.3f\n" ,x , y); } return 0; }
a.cc:11:28: error: extended character   is not valid in an identifier 11 | if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) { | ^ a.cc: In function 'int main()': a.cc:11:28: error: '\U000030000' was not declared in this scope 11 | if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) { | ^~~
s465419448
p00004
C++
#include<stdio.h> int main(void){ double a, b, c, d, e, f; double A,B; double x, y; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) { A = c*d - f*a; B = b*d - e*a; y = A / B; } else { A = c*d + f*a; B = b*d + e*a; y = A / B; } x = (c - y * b) / a; printf("%.3f %.3f\n" ,x , y); } return 0; }
a.cc:11:28: error: extended character   is not valid in an identifier 11 | if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) { | ^ a.cc: In function 'int main()': a.cc:11:28: error: '\U000030000' was not declared in this scope 11 | if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) { | ^~~
s623349407
p00004
C++
#include <iostream> #include <iomanip> using namespace std; int main() { double a,b,c,d,e,f; double x,y; while(cin >> a >> b >> c >> d >> e >> f) { x = (c*e-b*f) / (a*e0d*b); y = (c-a*x) / c; cout << fixed << setprecision(3) << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: 'e0d' was not declared in this scope 9 | x = (c*e-b*f) / (a*e0d*b); | ^~~
s663341127
p00004
C++
def ans(a, b, c, d, e, f): x = ((e*c - b*f)/(a*e-b*d)) y = ((-d*x + f)/e) x = "%.3f" % x y = "%.3f" % y return x, y sets = [] while True: try: line = list(map(int, input().split())) if(line[0] == " "): break; else: sets.append(line) except IndexError: break for i in sets: x, y = ans(i[0],i[1],i[2],i[3],i[4],i[5]) print(x, y)
a.cc:2:1: error: 'def' does not name a type 2 | def ans(a, b, c, d, e, f): | ^~~ a.cc:17:9: error: expected unqualified-id before 'else' 17 | else: | ^~~~
s657822722
p00004
C++
#include<bits/stdc++.h> using namespace std; int main(){ double a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; double x, y; y = (a * f - d * c) / (a * e - d * b); x = (c - b * y) / a //小数点以下4桁で四捨五入して表示 cout << fixed << setprecision(3) << x << " " << y << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:28: error: expected ';' before 'cout' 9 | x = (c - b * y) / a | ^ | ; ...... 12 | cout << fixed << setprecision(3) << x << " " << y << endl; | ~~~~
s103089448
p00004
C++
import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; public class Main { private static FastScanner sc = new FastScanner(); public static void main(String[] args) { double a = sc.nextDouble(); double b = sc.nextDouble(); double c = sc.nextDouble(); double d = sc.nextDouble(); double e = sc.nextDouble(); double f = sc.nextDouble(); if(d != 0) { d = d * (a/d); e = e * (a/d); f = f * (a/d); double y = (c-f) / (b-e); double x = (e/d) * y - (f/d); } else { a = a * (d/a); b = b * (d/a); c = c * (d/a); double y = (c-f) / (b-e); double x = (b/a) * y - (c/a); } System.out.println(x + " " + y); } static class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if(ptr < buflen) { return true; } else { ptr = 0; try { buflen = in.read(buffer); } catch(IOException e) { e.printStackTrace(); } if(buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} public boolean hasNext() { skipUnprintable(); return hasNextByte();} public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { return Long.parseLong(next()); } public int nextInt(){ return Integer.parseInt(next()); } public double nextDouble(){ return Double.parseDouble(next()); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.IOException; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.InputStream; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.NoSuchElementException; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: expected unqualified-id before 'public' 5 | public class Main { | ^~~~~~
s840281308
p00004
C++
#include<iostream> using namespace std; int main() { int a,b,c,d,e,f; while(scanf(%d%d%d%d%d%d,&a,&b,&c,&d,&e,&f) ) { double y=(double)(c*d-a*f)/(double)(b*d-a*e); if(a!=0) printf("%.3f %.3f\n",(c-b*y)/a,y); else printf("%.3f %.3f\n",(f-e*y)/d,y); } } return 0; }
a.cc: In function 'int main()': a.cc:10:21: error: expected primary-expression before '%' token 10 | while(scanf(%d%d%d%d%d%d,&a,&b,&c,&d,&e,&f) ) | ^ a.cc: At global scope: a.cc:23:5: error: expected unqualified-id before 'return' 23 | return 0; | ^~~~~~ a.cc:25:5: error: expected declaration before '}' token 25 | } | ^
s957386995
p00004
C++
#include<iostream> using namespace std; int main() { int a,b,c,d,e,f; while (∼scanf( "%d%d%d%d%d%d" ,&a,&b,&c,&d,&e,&f) ) { double y=(double)(c*d-a*f)/(double)(b*d-a*e); if(a!=0) printf("%.3f %.3f\n",(c-b*y)/a,y); else printf("%.3f %.3f\n",(f-e*y)/d,y); } return 0; }
a.cc:10:16: error: extended character ∼ is not valid in an identifier 10 | while (∼scanf( "%d%d%d%d%d%d" ,&a,&b,&c,&d,&e,&f) ) | ^ a.cc: In function 'int main()': a.cc:10:16: error: '\U0000223cscanf' was not declared in this scope; did you mean 'wscanf'? 10 | while (∼scanf( "%d%d%d%d%d%d" ,&a,&b,&c,&d,&e,&f) ) | ^~~~~~ | wscanf
s077207473
p00004
C++
#include <iostream> #include <cstdlib> using namespace std; int main() { double a, b, c, d, e, f; while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){ double ans1 = (e*c-f*b)/(e*a-b*d); double ans2 = (d*c-f*a)/(b*d-a*e); ans1 = (fabs(ans1) < 1e-15) ? 0.0 : ans1; ans2 = (fabs(ans2) < 1e-15) ? 0.0 : ans2; printf("%.3lf %.3lf\n", ans1, ans2); } return 0; }
a.cc: In function 'int main()': a.cc:12:25: error: 'fabs' was not declared in this scope; did you mean 'labs'? 12 | ans1 = (fabs(ans1) < 1e-15) ? 0.0 : ans1; | ^~~~ | labs
s409909951
p00004
C++
import java.util.*; import java.lang.*; import java.math.*; public class Main { Scanner sc = new Scanner(System.in); void run() { int a,b,c,d,e,f; while ( sc.hasNext() ) { a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); d = sc.nextInt(); e = sc.nextInt(); f = sc.nextInt(); System.out.printf( "%.3f %.3f\n",(double)(e*c-b*f)/(a*e-b*d)+0.00005,(double)(a*f-c*d)/(a*e-b*d)+0.00005 ); } } public static void main(String[] args) { new Main().run(); } }
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.lang.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.math.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: expected unqualified-id before 'public' 6 | public class Main { | ^~~~~~
s547208471
p00004
C++
#include<iostream> #include<iomanip> double halfadjust(double x){ int tmp = (x*10000); tmp = tmp%10; double ans = static_cast<double>(static_cast<int>(x*1000)); ans = ans/1000; if(tmp >= 5) ans += 0.001; if(tmp <= -5) ans -= 0.001; return ans; } double a,b,c,d,e,f; void solve(){ using namespace std; double x = (c*e-b*f)/(a*e-b*d); double y = (c*d-a*f)/(b*d-a*e); cout << setprecision(3) << fixed << halfadjust(x) << ' '; cout << halfadjust(y) << endl; cout << setprecision(6); } int main(){ using std::cin while(cin >> a&& cin >> b&& cin >> c&& cin >> d&& cin >> e&& cin >> f){ solve(); } return 0; }
a.cc: In function 'int main()': a.cc:28:23: error: expected ';' before 'while' 28 | using std::cin | ^ | ; 29 | while(cin >> a&& cin >> b&& cin >> c&& cin >> d&& cin >> e&& cin >> f){ | ~~~~~
s493855952
p00004
C++
#include <iostream> using namespace std; int main() { float a[6]; float x,y; while(true) cin >> a[0]; cin >> a[1]; cin >> a[2]; cin >> a[3]; cin >> a[4]; cin >> a[5]; if(cin.eof()) break; x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]); y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]); cout.precision(3); cout << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:25: error: break statement not within loop or switch 15 | break; | ^~~~~ a.cc: At global scope: a.cc:23:9: error: expected unqualified-id before 'return' 23 | return 0; | ^~~~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s085463363
p00004
C++
#include <iostream> #include <iomanip> using namespace std; int main(){ double a[6]; double x,y; while(true){ cin >> a[0]; cin >> a[1]; cin >> a[2]; cin >> a[3]; cin >> a[4]; cin >> a[5]; if(cin.eof()) break; x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]); y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]); cout << setprecission(3) << x << " " <<setprecision(3) << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:25: error: 'setprecission' was not declared in this scope 21 | cout << setprecission(3) << x << " " <<setprecision(3) << y << endl; | ^~~~~~~~~~~~~
s669102994
p00004
C++
#include <iostream> #include <iomanip> using namespace std; int main(){ double a[6]; double x,y; while(true){ cin >> a[0]; cin >> a[1]; cin >> a[2]; cin >> a[3]; cin >> a[4]; cin >> a[5]; if(cin.eof()) break; x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]); y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]); cout << setprecission(3) << x << " " <<setprecision(3) << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:25: error: 'setprecission' was not declared in this scope 21 | cout << setprecission(3) << x << " " <<setprecision(3) << y << endl; | ^~~~~~~~~~~~~
s678810392
p00004
C++
#include <iostream> using namespace std; /* aX+bY=c dX+eY=f */ void solve(int a, int b, int c, int d, int e, int f) { int x = (f - ec/b) / (d - ec/b); int y = (c - ax) / b; cout << x << " " << y << endl; } int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { solve(a,b,c,d,e,f); } return 0; }
a.cc: In function 'void solve(int, int, int, int, int, int)': a.cc:11:22: error: 'ec' was not declared in this scope; did you mean 'c'? 11 | int x = (f - ec/b) / (d - ec/b); | ^~ | c a.cc:12:22: error: 'ax' was not declared in this scope; did you mean 'x'? 12 | int y = (c - ax) / b; | ^~ | x
s716782018
p00004
C++
#include <iostream.h> using namespace std; int main(){ int i; float x[6]; while(cin >> x[0]){ for(i=1; i<6; i++){ cin >> x[i]; } //normalize x[1]/=x[0]; x[2]/=x[1]; x[0]=1; //subtraction x[4]-=x[3]*x[1]; x[5]-=x[3]*x[2]; x[3]=0; //normalize x[5]/=x[4]; x[4]=1; //subtraction x[2]-=x[1]*x[5]; x[1]=0; printf("%f %f\n", x[2], x[5]); } return 0; }
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s712177371
p00004
C++
#include <iostream> using namespace std; { double a,b,c,d,e,f; double x,y; while (cin>>a>>b>>c>>d>>e>>f, cin.eof()) { y = (c * d - a * f) / (b * d - e * a); x = (c - (b * y)) / a; cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl; } return 0; }
a.cc:4:1: error: expected unqualified-id before '{' token 4 | { | ^
s599048001
p00004
C++
#include <iostream> #include <iomanip> using namespace std; { double a,b,c,d,e,f; double x,y; while (cin>>a>>b>>c>>d>>e>>f, cin.eof()) { y = (c * d - a * f) / (b * d - e * a); x = (c - (b * y)) / a; cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl; } return 0; }
a.cc:5:1: error: expected unqualified-id before '{' token 5 | { | ^
s970017391
p00004
C++
#include<stdio.h> int main(void){ double a,b,c,d,e,f,x,y; cin >> a >> b >> c >> d >> e >> f; y = (f-d*c/a)/(e-d*b/a); x = c/a-b/a*y; printf("%.4f",x); printf(" "); printf("%.4f\n",y); }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> a >> b >> c >> d >> e >> f; | ^~~
s453870850
p00004
C++
#include<stdio.h> #include<iostream> int main(void){ double a,b,c,d,e,f,x,y; cin >> a >> b >> c >> d >> e >> f; y = (f-d*c/a)/(e-d*b/a); x = c/a-b/a*y; printf("%.4f %.4f\n",x); return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> a >> b >> c >> d >> e >> f; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~
s253497081
p00004
C++
#include<stdio.h> int main(void) { double x=0 , y=0 ; int a , b , c , d , e , f , p=0 , r=0 , s=0 ; while(scanf("%d %d %d %d %d %d",&a ,&b ,&c ,&d ,&e ,&f) != EOF) { p=a*e-b*d ; q=c*e-b*f ; x=(double)q/p ; r=b*d-a*e ; s=c*d-a*f ; y=(double)s/r ; if(x==-0) x=0 ; if(y==-0) y=0 ; printf("%.3f %.3f\n",x ,y) ; } return 0; }
a.cc: In function 'int main()': a.cc:10:1: error: 'q' was not declared in this scope 10 | q=c*e-b*f ; | ^
s838764053
p00004
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #define EPS 1e-12; int main(void){ double a,b,c,d,e,f; double x,y; while(scanf("%lf %lf %lf %lf %lf %lf",&a ,&b ,&c ,&d ,&e ,&f) != EOF){ x=(c*e-b*f)/(a*e-b*d); y=(d*c-a*f)/(b*d-a*e); if(abs(x) < EPS) x = 0.000; if(abs(y) < EPS) y = 0.000; printf("%.3lf %.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:15:20: error: expected primary-expression before ')' token 15 | if(abs(x) < EPS) x = 0.000; | ^ a.cc:16:20: error: expected primary-expression before ')' token 16 | if(abs(y) < EPS) y = 0.000; | ^
s903547857
p00004
C++
#include<stdio.h> int main(void){ float a,b,c,d,e,f,x,y,i; while(scanf("%d %d %d %d %d %d",&a, &b,&c,&d,&e,&f)!=EOF){ x=(e*c-b*f)/(d*e-b*d); y=(a*f-c*d)/(d*e-b*d); printf(" %f %f\n",x,y);}1 return 0; }
a.cc: In function 'int main()': a.cc:7:30: error: expected ';' before 'return' 7 | printf(" %f %f\n",x,y);}1 | ^ | ; ...... 12 | return 0; | ~~~~~~
s189560244
p00004
C++
int main() { std::cout << std::setprecision(3); std::cout.setf(std::ios::fixed, std::ios::floatfield); double a, b, c, d, e, f; while( std::cin >> a >> b >> c >> d >> e >> f ) { const double x = (b*f-c*e) / (b*d-a*e); const double y = (c-a*x) / b; std::cout << ((-0.0005<=x && x<0.0005)?0.0:x) << " " << ((-0.0005<=y && y<0.0005)?0.0:y) << std::endl; } }
a.cc: In function 'int main()': a.cc:3:14: error: 'cout' is not a member of 'std' 3 | std::cout << std::setprecision(3); | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:3:27: error: 'setprecision' is not a member of 'std' 3 | std::cout << std::setprecision(3); | ^~~~~~~~~~~~ a.cc:1:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' +++ |+#include <iomanip> 1 | a.cc:4:14: error: 'cout' is not a member of 'std' 4 | std::cout.setf(std::ios::fixed, std::ios::floatfield); | ^~~~ a.cc:4:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:4:29: error: 'std::ios' has not been declared 4 | std::cout.setf(std::ios::fixed, std::ios::floatfield); | ^~~ a.cc:4:46: error: 'std::ios' has not been declared 4 | std::cout.setf(std::ios::fixed, std::ios::floatfield); | ^~~ a.cc:6:21: error: 'cin' is not a member of 'std' 6 | while( std::cin >> a >> b >> c >> d >> e >> f ) { | ^~~ a.cc:6:21: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:9:22: error: 'cout' is not a member of 'std' 9 | std::cout << ((-0.0005<=x && x<0.0005)?0.0:x) << " " << ((-0.0005<=y && y<0.0005)?0.0:y) << std::endl; | ^~~~ a.cc:9:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:9:114: error: 'endl' is not a member of 'std' 9 | std::cout << ((-0.0005<=x && x<0.0005)?0.0:x) << " " << ((-0.0005<=y && y<0.0005)?0.0:y) << std::endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 |
s024841428
p00004
C++
#include <iostream> #include <iomanip> using namespace std; int main() { double a, b, c, d, e, f, x, y; cin >> a >> b >> c >> d >> e >> f) y = ( c * d - a * f ) / ( b * d - a * e ); x = ( c - b * y ) / a; cout << showpoint << setprecision(3); cout << setiosflags( ios::fixed ); cout << ( x == -0.0 ? 0.0 : x ) << " " << ( y == -0.0 ? 0.0 : y ) << endl; }
a.cc: In function 'int main()': a.cc:8:42: error: expected ';' before ')' token 8 | cin >> a >> b >> c >> d >> e >> f) | ^ | ;
s442959964
p00004
C++
#include <iostream> #include <vector> #include <map> typedef vector< typedef pair<int,int> mat; using namespace std; int main() { int a,b,c,d,e,f; double A[2][2]; double B[2]; double inv_A[2][2]; scanf("%d %d %d %d %d %d",a&,&b,&c,&d,&e,&f); int det = a*e-b*d; A[0][0]=a; A[0][1] = b; A[1][0]=d; A[1][1] = e; B[0] = c; B[1] = f; inv_A[0][0]=1.0/(double)det *A[1][1]; inv_A[0][1]=1.0/(double)det *-A[1][1]; inv_A[1][0]=1.0/(double)det *-A[1][0]; inv_A[1][1]=1.0/(double)det *A[0][0]; double res[2]; res[0]=0; res[1]=0; for(int i=0;i<2;i++){ for(int j=0;j<2;j++){ for(int k=0;k<2;k++){ res[i]+=inv_A[j][k]*B[k]; } } } printf("%.3f %.3f\n",res[0],res[1]); }
a.cc:5:9: error: 'vector' does not name a type 5 | typedef vector< | ^~~~~~ a.cc: In function 'int main()': a.cc:14:29: error: expected primary-expression before ',' token 14 | scanf("%d %d %d %d %d %d",a&,&b,&c,&d,&e,&f); | ^
s776444671
p00004
C++
#include <iostream> #include <vector> #include <map> typedef pair<int,int> mat; using namespace std; int main() { int a,b,c,d,e,f; double A[2][2]; double B[2]; double inv_A[2][2]; scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f); int det = a*e-b*d; A[0][0]=a; A[0][1] = b; A[1][0]=d; A[1][1] = e; B[0] = c; B[1] = f; inv_A[0][0]=1.0/(double)det *A[1][1]; inv_A[0][1]=1.0/(double)det *-A[1][1]; inv_A[1][0]=1.0/(double)det *-A[1][0]; inv_A[1][1]=1.0/(double)det *A[0][0]; double res[2]; res[0]=0; res[1]=0; for(int i=0;i<2;i++){ for(int j=0;j<2;j++){ for(int k=0;k<2;k++){ res[i]+=inv_A[j][k]*B[k]; } } } printf("%.3f %.3f\n",res[0],res[1]); }
a.cc:5:9: error: 'pair' does not name a type 5 | typedef pair<int,int> mat; | ^~~~
s519842230
p00004
C++
#include <stdio.h> //#define DEBUGNOW #ifdef DEBUGNOW #define debug #else #define debug 1 ? (void)0 : #endif double sishagonyu(double num) { //int num2; if (num == 0) return num; if (num > 0) { num += 0.0005; } else { num -= 0.0005; } num = (double)(int)(num * 1000) / 1000; // num *= 1000; // num2 = (int)num; // num = num2; // num /= 1000; return num; } int main() { //printf("%.3lf", sishagonyu((double)-0.0015)); double a, b, c, d, e, f; double x, y; double n, m, h, i; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ //if (scanf("%lf %lf %lf %lf %lf %f", &a, &b, &c, &d, &e, &f) == EOF) break; debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f); //input if (a == 0) { y = c / b; } if (b == 0) { x = c / a; } if (d == 0) { y = f / e; } if (e == 0) { x = f / d; } n = a / d; //j = d * n; h = e * n; i = f * n; debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n); m = b - h; y = c - i; debug printf("%f %f\n", m, y); if(y <= 0.0004 && y >= -0.0005) { debug printf("y = 0\n"); y = 0; } else { y /= m; debug printf("%f\n", y); i = c - (b * y); x = i / a; debug printf("x = %f, y = %f\n", x, y); x = sishagonyu(x); y = sishagonyu(y); } //printf("%f %f\n", x, y); printf("%.3f %.3f\n", x, y); } return 0; } //2.2 3.3 22.24706 3.2 8.7 50.12932 //3.2777 4.5564 //1 2 3 4 5 6 //-1.000 2.000 //2 -1 -2 -1 -1 -5 //1.000 4.000 //2 -1 -3 1 -1 -3 //0.000 3.000 // 2 -1 -3 -9 9 27 // 0.000 3.000
a.cc: In function 'int main()': a.cc:44:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 44 | debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f); //input | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:57:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 57 | debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:61:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 61 | debug printf("%f %f\n", m, y); | ~~~~~~^~~~~~~~~~~~~~~~~ a.cc:65:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 65 | debug printf("y = 0\n"); | ~~~~~~^~~~~~~~~~~ a.cc:71:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 71 | debug printf("%f\n", y); | ~~~~~~^~~~~~~~~~~ a.cc:76:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 76 | debug printf("x = %f, y = %f\n", x, y); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
s121198726
p00004
C++
#include <stdio.h> //#define DEBUGNOW /* #ifdef DEBUGNOW #define debug #else */ #define debug 1 ? (void)0 : //#endif double sishagonyu(double num) { //int num2; if (num == 0) return num; if (num > 0) { num += 0.0005; } else { num -= 0.0005; } num = (double)(int)(num * 1000) / 1000; // num *= 1000; // num2 = (int)num; // num = num2; // num /= 1000; return num; } int main() { //printf("%.3lf", sishagonyu((double)-0.0015)); double a, b, c, d, e, f; double x, y; double n, m, h, i; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ //if (scanf("%lf %lf %lf %lf %lf %f", &a, &b, &c, &d, &e, &f) == EOF) break; debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f); //input if (a == 0) { y = c / b; } if (b == 0) { x = c / a; } if (d == 0) { y = f / e; } if (e == 0) { x = f / d; } n = a / d; //j = d * n; h = e * n; i = f * n; debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n); m = b - h; y = c - i; debug printf("%f %f\n", m, y); if(y <= 0.0004 && y >= -0.0005) { debug printf("y = 0\n"); y = 0; } else { y /= m; debug printf("%f\n", y); i = c - (b * y); x = i / a; debug printf("x = %f, y = %f\n", x, y); x = sishagonyu(x); y = sishagonyu(y); } //printf("%f %f\n", x, y); printf("%.3f %.3f\n", x, y); } return 0; } //2.2 3.3 22.24706 3.2 8.7 50.12932 //3.2777 4.5564 //1 2 3 4 5 6 //-1.000 2.000 //2 -1 -2 -1 -1 -5 //1.000 4.000 //2 -1 -3 1 -1 -3 //0.000 3.000 // 2 -1 -3 -9 9 27 // 0.000 3.000
a.cc: In function 'int main()': a.cc:45:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 45 | debug printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f); //input | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:58:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 58 | debug printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:62:29: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 62 | debug printf("%f %f\n", m, y); | ~~~~~~^~~~~~~~~~~~~~~~~ a.cc:66:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 66 | debug printf("y = 0\n"); | ~~~~~~^~~~~~~~~~~ a.cc:72:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 72 | debug printf("%f\n", y); | ~~~~~~^~~~~~~~~~~ a.cc:77:37: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 77 | debug printf("x = %f, y = %f\n", x, y); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
s528872431
p00004
C++
import java.io.*; import java.text.DecimalFormat; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br =new BufferedReader(new InputStreamReader(System.in)); String buf; double[][] data=new double[2][3]; double x,y; while((buf=br.readLine()) != null){ String[] buf2=buf.split(" "); for(int i=0;i<data.length;i++){ for(int j=0;j<data[i].length;j++){ data[i][j]=Double.parseDouble(buf2[i*3+j]); } } double a,b,c,d; a=(data[0][2] * data[1][1] - data[0][1] * data[1][2]); b=(data[0][0] * data[1][1] - data[1][0] * data[0][1]); c=(data[0][2] * data[1][0] - data[1][2] * data[0][0]); System.out.println(c); d=(data[0][1] * data[1][0] - data[0][0] * data[1][1]); System.out.println(d); x = a / b; y = c / d; DecimalFormat decimalFormat1 = new DecimalFormat("#.000"); System.out.print(decimalFormat1.format(x)); System.out.print("\t"); System.out.println(decimalFormat1.format(y)); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.text.DecimalFormat; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:11: error: expected ':' before 'static' 5 | public static void main(String[] args)throws IOException{ | ^~~~~~~ | : a.cc:5:29: error: 'String' has not been declared 5 | public static void main(String[] args)throws IOException{ | ^~~~~~ a.cc:5:38: error: expected ',' or '...' before 'args' 5 | public static void main(String[] args)throws IOException{ | ^~~~ a.cc:5:42: error: expected ';' at end of member declaration 5 | public static void main(String[] args)throws IOException{ | ^ | ; a.cc:5:43: error: 'throws' does not name a type 5 | public static void main(String[] args)throws IOException{ | ^~~~~~ a.cc:32:2: error: expected ';' after class definition 32 | } | ^ | ;
s180772415
p00004
C++
#include<iostream> using namespace std; double round(double source, int precision) { // 四捨五入 return floor((fabs(source) * pow(10, (double)precision) + 0.5)) / pow(10, (double)precision) * (source < 0 ? -1 : 1); } int main() { double a, b, c, d, e, f, x, y; while (cin >> a >> b >> c >> d >> e >> f) { x = (c * e - b * f) / (a * e - b * d); y = (a * f - c * d) / (a * e - b * d); cout.precision(3); cout << fixed << round(x, 3) << " " << round(y, 3) << endl; //cout << fixed << x + 1e-10 << " " << y + 1e-10 << endl; } return 0; }
a.cc: In function 'double round(double, int)': a.cc:6:23: error: 'fabs' was not declared in this scope; did you mean 'labs'? 6 | return floor((fabs(source) * pow(10, (double)precision) + 0.5)) / pow(10, (double)precision) * (source < 0 ? -1 : 1); | ^~~~ | labs a.cc:6:38: error: 'pow' was not declared in this scope 6 | return floor((fabs(source) * pow(10, (double)precision) + 0.5)) / pow(10, (double)precision) * (source < 0 ? -1 : 1); | ^~~ a.cc:6:16: error: 'floor' was not declared in this scope 6 | return floor((fabs(source) * pow(10, (double)precision) + 0.5)) / pow(10, (double)precision) * (source < 0 ? -1 : 1); | ^~~~~
s082466261
p00004
C++
#include<stdio.h> int main() { double a,b, c, d, e, f, x,y; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF) { y=(a*f-c*d)/(a*e-d*b); x=(c-b*y)/a: printf("%.3f %.3f\n",x,y); } }
a.cc: In function 'int main()': a.cc:8:28: error: found ':' in nested-name-specifier, expected '::' 8 | x=(c-b*y)/a: | ^ | :: a.cc:8:27: error: 'a' is not a class, namespace, or enumeration 8 | x=(c-b*y)/a: | ^
s692965816
p00004
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ double a,b,c,d,e,f; double x,y; while(cin>>a){ cin>>b; cin>>c; cin>>d; cin>>e; cin>>f; x = (e * c + (-b)*f)/(a*e-b*d); y = (-d * c + a * f)/(a*e-b*d); if(fabs(x)<1e-3 && fabs(y)<1e-3){ printf("%.3f %.3f\n",fabs(x),fabs(y)); } else if(fabs(x)<1e-3){ printf("%.3f %.3f\n",fabs(x),y); } else if(fabs(y)<1e-3){ printf("%.3f %.3f\n",x,fabs(y)); } else{ printf("%.3f %.3f\n",x,y); } } return 0; }
a.cc: In function 'int main()': a.cc:21:20: error: 'fabs' was not declared in this scope; did you mean 'labs'? 21 | if(fabs(x)<1e-3 && fabs(y)<1e-3){ | ^~~~ | labs
s536146575
p00004
C++
#include <conio.h> #include <iostream> #include <iomanip> using namespace std; int main() { int a,b,c,d,e,f; double x,y; while(cin>>a>>b>>c>>d>>e>>f) { -1000 <= a, b, c, d, e, f <= 1000; x= (c*e-b*f)/(a*e-b*d); y= (c*d-a*f)/(b*d-a*e); if(x == -0.00){x=0.00;} if(y == -0.00){y=0.00;} cout<<setprecision(3)<<fixed; cout<<x<<" "<<y<<endl; } cin.get(); getch(); return 0; }
a.cc:1:10: fatal error: conio.h: No such file or directory 1 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s773512845
p00004
C++
#include <conio.h> #include <iostream> #include <iomanip> using namespace std; int main() { int a,b,c,d,e,f; double x,y; while(cin>>a>>b>>c>>d>>e>>f) { -1000 <= a, b, c, d, e, f <= 1000; x= (c*e-b*f)/(a*e-b*d); y= (c*d-a*f)/(b*d-a*e); if(x == -0.00){x=0.00;} if(y == -0.00){y=0.00;} cout<<setprecision(3)<<fixed; cout<<x<<" "<<y<<endl; } cin.get(); getch(); return 0; }
a.cc:1:10: fatal error: conio.h: No such file or directory 1 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s293365523
p00004
C++
#include <conio.h> #include <iostream> #include <iomanip> #include <math.h> using namespace std; int main() { int a,b,c,d,e,f; double x,y; while(cin>>a>>b>>c>>d>>e>>f) { -1000 <= a, b, c, d, e, f <= 1000; x= (c*e-b*f)/(a*e-b*d); y= (c*d-a*f)/(b*d-a*e); cout<<setprecision(3)<<fixed; cout<<x<<" "<<y<<endl; } cin.get(); getch(); return 0; }
a.cc:1:10: fatal error: conio.h: No such file or directory 1 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s205103402
p00004
C++
#include <conio.h> #include <iostream> #include <iomanip> #include <math.h> using namespace std; int main() { int a,b,c,d,e,f; double x,y; while(cin>>a>>b>>c>>d>>e>>f) { -1000 <= a, b, c, d, e, f <= 1000; x= (c*e-b*f)/(a*e-b*d); y= (c*d-a*f)/(b*d-a*e); cout<<setprecision(3)<<fixed; cout<<x<<" "<<y<<endl; } cin.get(); return 0; }
a.cc:1:10: fatal error: conio.h: No such file or directory 1 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s497053480
p00004
C++
#include <iostream> #include <iomanip> using namespace std; int main() { int a,b,c,d,e,f; double x,y; cin>>a>>b>>c>>d>>e>>f -1000 <= a, b, c, d, e, f <= 1000; x= (c*e-b*f)/(a*e-b*d); y= (c*d-a*f)/(b*d-a*e); if(x == -0.00){x=0.00;} if(y == -0.00){y=0.00;} cout<<setprecision(3)<<fixed; cout<<x<<" "<<y<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:27: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 9 | cin>>a>>b>>c>>d>>e>>f | ~~~~~~~~~~~~~~~~~~^~~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ~~~~~ | | | int In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'int' 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:11:17: error: invalid conversion from 'int' to 'void*' [-fpermissive] 9 | cin>>a>>b>>c>>d>>e>>f | ~ 10 | | 11 | -1000 <= a, b, c, d, e, f <= 1000; | ^~~~~ | | | int a.cc:11:17: error: cannot bind rvalue '(void*)((long int)(f - 1000))' to '
s201675965
p00004
C++
#include<iostream> using namespace std; int main(){ double a,b,c,d,e,f,x,y; while(cin>>a>>b>>c>>d>>e>>f){ x=(c-f*b/e)/(a-d*b/e)+0.0005; y=(c-a*x)/b+0.0005; x-=x%0.001; y-=y%0.001; cout<<x<<" "<<y<<endl;}}
a.cc: In function 'int main()': a.cc:9:5: error: invalid operands of types 'double' and 'double' to binary 'operator%' 9 | x-=x%0.001; | ~^~~~~~ | | | | | double | double a.cc:10:5: error: invalid operands of types 'double' and 'double' to binary 'operator%' 10 | y-=y%0.001; | ~^~~~~~ | | | | | double | double
s072000289
p00004
C++
#include<stdio.h> #include<math.h> int main(){ double A[2][3],x,y,i; /* printf("6つの実数を入力してください 例:6 3 4 8 9 1\n"); scanf("%lf%lf%lf%lf%lf%lf",&A[0][0],&A[0][1],&A[0][2],&A[1][0],&A[1][1],&A[1][2]); printf("連立方程式%lfx+%lfy=%lf,%lfx+%lfy=%lfを解きます\n",A[0][0],A[0][1],A[0][2],A[1][0],A[1][1],A[1][2]); */ while(scanf("%lf%lf%lf%lf%lf%lf",&A[0][0],&A[0][1],&A[0][2],&A[1][0],&A[1][1],&A[1][2]) != EOF){ //掃き出し法で for(i=2;i>=0;i--){ A[0][i] /= A[0][0]; } for(int i=2;i>=0;i--){ A[1][i] -= A[0][i] * A[1][0]; } if(A[1][1] == 0){ if(A[1][2] == 0){ printf("解はすべての実数\n"); }else{ printf("解無し\n"); } return 0; } y = A[1][2] / A[1][1]; x = A[0][2] - A[0][1]*y; printf("x = %lf ,y = %lf\n",x,y); x *= 1e+3; y *= 1e+3; //切上げ処理 x = floor(x+0.5)*(1e-3); y = floor(y+0.5)*(1e-3); printf("x = %.3lf ,y = %.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:18:29: error: invalid types 'double [3][double]' for array subscript 18 | A[0][i] /= A[0][0]; | ^
s840039380
p00004
C++
#include<stdio.h> int a ; int b ; int c ; int d ; int e ; int f ; double x ; double y ; int main() { while ( scanf ( "%d %d %d %d %d %d" , &a , &b , &c , &d , &e , & ) == 6 ) { y = (c*a-f*a)/(b*a-e*a) ; x = ( c - b*(c*a-f*a)/(b*a-e*a) ) / a ; printf ( "%.3llf %.3llf\n" , x , y ) ; } return 0 ; }
a.cc: In function 'int main()': a.cc:14:74: error: expected primary-expression before ')' token 14 | while ( scanf ( "%d %d %d %d %d %d" , &a , &b , &c , &d , &e , & ) == 6 ) { | ^
s000690822
p00004
C++
#include<stdio.h> void printFunc(int a,int b,int c,int d,int e,int f); int main(){ int a,b,c,d,e,f; float ansX,ansY; scanf ("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f); printFunc(a,b,c,d,e,f); scanf ("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f); printFunc(a,b,c,d,e,f); return 0; } void printFunc(int a,int b,int c,int d,int e,int f){ if(b == 0 || e == 0){ ansY = 0; } else{ ansY = (float)(b*f - e*c)/(float)(b*d - e*a); } if(a == 0 || d == 0){ ansX = 0; } else{ ansX = (float)(c*e - f*b)/(float)(a*e - d*b); } printf("%.3f %.3f\n",ansX,ansY); }
a.cc: In function 'void printFunc(int, int, int, int, int, int)': a.cc:19:5: error: 'ansY' was not declared in this scope 19 | ansY = 0; | ^~~~ a.cc:22:5: error: 'ansY' was not declared in this scope 22 | ansY = (float)(b*f - e*c)/(float)(b*d - e*a); | ^~~~ a.cc:26:5: error: 'ansX' was not declared in this scope 26 | ansX = 0; | ^~~~ a.cc:29:5: error: 'ansX' was not declared in this scope 29 | ansX = (float)(c*e - f*b)/(float)(a*e - d*b); | ^~~~ a.cc:32:24: error: 'ansX' was not declared in this scope 32 | printf("%.3f %.3f\n",ansX,ansY); | ^~~~ a.cc:32:29: error: 'ansY' was not declared in this scope 32 | printf("%.3f %.3f\n",ansX,ansY); | ^~~~
s670533548
p00004
C++
#include <iostream> #include <cstdio> using namespace std; int main(int argc, char *argv[]) { double a, b, c, d, e, f; while (true) { cin >> a >> b >> c >> d >> e >> f; if (cin.eof()) break; a -= d * b / e; c -= f * b / e; double x = c / a; if (x >= 0) x = (int)(x * 100 + 0.5); else x = (int)(x * 100 - 0.5); x /= 100; double y = (f - d * x) / e; if (y >= 0) y = (int)(y * 100 + 0.5); else x = (int)(y * 100 - 0.5); y /= 100; printf("%.3lf %.3lf\n", x, y; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:27:33: error: expected ')' before ';' token 27 | printf("%.3lf %.3lf\n", x, y; | ~ ^ | ) a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:6:34: note: to match this '{' 6 | int main(int argc, char *argv[]) { | ^
s097751164
p00004
C++
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include <iostream> using namespace std; int main(int argc, char **argv) { double a, b, c, d, e, f, tmp, s, t; while((cin >> a >> b >> c >> d >> e >> f)){ tmp = (a*e-b*d); s = ((e*c-b*f)/tmp); t = ((a*f-d*c)/tmp); if(s == -0.0){ s = 0.0; } if(t == -0.0){ t = 0.0; } printf("%.3f %.3f\n", s, t); } return 0; }
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:22: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /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/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /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/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /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/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /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/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 179 | _GLIBCXX_NODI
s034620067
p00004
C++
(function set_utils(undefined){ this.print_float = function print_float(val, base, pad, prec) { var p10=Math.pow(10,prec); var ival=""+Math.round(val*p10); if ( ival === '0' ) return '0.'+Array(prec+1).join('0'); var ilen=ival.length-prec; if(ilen===0) return "0."+ival.substr(ilen,prec); return ival.substr(0,ilen)+"."+ival.substr(ilen,prec); }; }).call(global); (function(undefined){ 'use strict'; (function init() { this.output = function() { console.log.apply( console, arguments ); }; this.stdin = process.openStdin(); stdin.setEncoding('utf8'); this.input_list = []; stdin.on('data', function(chunk){ var result = chunk.match(/[-]?\d+/g); input_list = input_list.concat(result); }); stdin.on('end', function(){ fire(); }); this.input_number = function() { return parseInt( input_list.splice(0,1)[0] ); }; this.has_next = function() { return ! input_list.length; }; }).call( this ); (function solver(){ function sq(x) { return x * x; } function check(v) { } this.fire = function() { setTimeout( function solve() { var a = input_number(); var b = input_number(); var c = input_number(); var d = input_number(); var e = input_number(); var f = input_number(); var delta = 1.0 / ( a*e - b*d ); var x = ( e * c - b * f ) * delta; var y = ( a * f - d * c ) * delta; output( print_float(x,10,3,3) + ' ' + print_float(y,10,3,3) ); if ( ! has_next() ) setTimeout( solve, 0, this ); }, 0, this ); }; }).call(this); }).call(global);
a.cc:6:32: warning: multi-character character constant [-Wmultichar] 6 | return '0.'+Array(prec+1).join('0'); | ^~~~ a.cc:15:9: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 15 | 'use strict'; | ^~~~~~~~~~~~ a.cc:22:35: warning: multi-character character constant [-Wmultichar] 22 | stdin.setEncoding('utf8'); | ^~~~~~ a.cc:24:26: warning: multi-character character constant [-Wmultichar] 24 | stdin.on('data', function(chunk){ | ^~~~~~ a.cc:25:55: error: stray '\' in program 25 | var result = chunk.match(/[-]?\d+/g); | ^ a.cc:28:26: warning: multi-character character constant [-Wmultichar] 28 | stdin.on('end', function(){ | ^~~~~ a.cc:1:10: error: expected ')' before 'set_utils' 1 | (function set_utils(undefined){ | ~ ^~~~~~~~~~ | ) a.cc:12:2: error: expected unqualified-id before ')' token 12 | }).call(global); | ^ a.cc:14:10: error: expected ')' before '(' token 14 | (function(undefined){ | ~ ^ | ) a.cc:63:2: error: expected unqualified-id before ')' token 63 | }).call(global); | ^
s351450421
p00004
C++
#include<iostream> #include<iomanip> using namespace std; double a,b,c,d,e,f; int main(void){ //cin>>a>>b>>c>>d>>e>>f; while(cin>>a>>b>>c>>d>>e>>f){ double x,y; /* ax+by=c; dx+ey=f; ax=c-by; x=(c-by)/a; d(c-by)/a+ey=f; dc/a-dby/a+ey=f; -dby/a+ey=f-dc/a; (e-db/a)y=f-dc/a; y=(f-dc/a)/(e-db/a); y=(fa-dc)/(ae-db) x=(c-by)/a; */ y=(f*a-d*c)/(a*e-d*b); x=(c-b*y)/a; cout<<fixed<<setprecision(3); cout<<x<<" "<<y<<endl; //} //cin>>a; }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:7:15: note: to match this '{' 7 | int main(void){ | ^
s665085412
p00004
C++
#include<stdio.h> void main() { float a,b,c,d,e,f; float x,y; scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f); y=(c*d-a*f)/(b*d-a*e); x=(c-b*y)/a; printf("x=%f,y=%f",x,y); }
a.cc:2:1: error: '::main' must return 'int' 2 | void main() | ^~~~
s020815547
p00004
C++
#include <iostream> #include <iomanip> using namespace std; double* solve_equations(int *a) { // クラメルの公式を用いる int data_size=sizeof(a[0]); /*cout << "data_size=" << data_size << endl; cout << "a=" << a << endl; cout << "*(a + data_size*1)=" << *(a + 1) << endl; cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */ int z = *(a + 0) * *(a + 4) - *(a + 1) * *(a + 3); int x = *(a + 2) * *(a + 4) - *(a + 1) * *(a + 5); int y = *(a + 0) * *(a + 5) - *(a + 2) * *(a + 3); double ax,ay; /*cout << "x=" << x << endl; cout << "y=" << y << endl;*/ ax = pow(z,-1)*x; ay = pow(z,-1)*y; /* cout << ax << endl; cout << ay << endl; */ double ans[2] = {ax,ay}; return ans; } int main() { int *p; int a[6] = {1,2,3,4,5,6}; /* p = solve_equations(a); cout << *p << *(p + 1) << endl;*/ int n[6]; while (cin){ for (int i=0;i<=5;i++) { if(!(cin >> n[i])) break; } double *ans; ans = solve_equations(n); cout << setprecision(3) << ans[0] << ' '<< ans[1] << endl; } // cout << l[0] endl; }
a.cc: In function 'double* solve_equations(int*)': a.cc:22:14: error: 'pow' was not declared in this scope 22 | ax = pow(z,-1)*x; | ^~~ a.cc:28:16: warning: address of local variable 'ans' returned [-Wreturn-local-addr] 28 | return ans; | ^~~ a.cc:27:16: note: declared here 27 | double ans[2] = {ax,ay}; | ^~~
s739261715
p00004
C++
#include <iostream> #include <iomanip> using namespace std; double* solve_equations(int *a) { // クラメルの公式を用いる int data_size=sizeof(a[0]); /*cout << "data_size=" << data_size << endl; cout << "a=" << a << endl; cout << "*(a + data_size*1)=" << *(a + 1) << endl; cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */ int z = *(a + 0) * *(a + 4) - *(a + 1) * *(a + 3); int x = *(a + 2) * *(a + 4) - *(a + 1) * *(a + 5); int y = *(a + 0) * *(a + 5) - *(a + 2) * *(a + 3); double ax,ay; /*cout << "x=" << x << endl; cout << "y=" << y << endl;*/ ax = pow(z,-1)*x; ay = pow(z,-1)*y; /* cout << ax << endl; cout << ay << endl; */ double ans[2] = {ax,ay}; return ans; } int main() { int *p; int a[6] = {1,2,3,4,5,6}; /* p = solve_equations(a); cout << *p << *(p + 1) << endl;*/ int n[6]; while (cin){ for (int i=0;i<=5;i++) { if(!(cin >> n[i])) break; } double *ans; ans = solve_equations(n); cout << fixed << setprecision(3) << ans[0] << ' '<< ans[1] << endl; } // cout << l[0] endl; }
a.cc: In function 'double* solve_equations(int*)': a.cc:22:14: error: 'pow' was not declared in this scope 22 | ax = pow(z,-1)*x; | ^~~ a.cc:28:16: warning: address of local variable 'ans' returned [-Wreturn-local-addr] 28 | return ans; | ^~~ a.cc:27:16: note: declared here 27 | double ans[2] = {ax,ay}; | ^~~
s961881270
p00004
C++
#include <iostream> #include <iomanip> #include <stdio.h> using namespace std; double* solve_equations(int *a) { // クラメルの公式を用いる int data_size=sizeof(a[0]); /*cout << "data_size=" << data_size << endl; cout << "a=" << a << endl; cout << "*(a + data_size*1)=" << *(a + 1) << endl; cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */ int z = *(a + 0) * *(a + 4) - *(a + 1) * *(a + 3); int x = *(a + 2) * *(a + 4) - *(a + 1) * *(a + 5); int y = *(a + 0) * *(a + 5) - *(a + 2) * *(a + 3); double ax,ay; /*cout << "x=" << x << endl; cout << "y=" << y << endl;*/ ax = pow(z,-1)*x; ay = pow(z,-1)*y; /* cout << ax << endl; cout << ay << endl; */ double ans[2] = {ax,ay}; return ans; } int main() { int n[6]; int s; int i=0; while (cin >> s){ if (i == 5){ n[i]=s; /* for (int j=0;j<=5;j++) { cout << "n[" << j << "]=" << n[j] << endl; }*/ double* an; an = solve_equations(n); /* printf("%.3lf",*(an+0)); cout << " " << endl; printf("%.3lf",*(an+1)); */ if (an[1] == 0) cout << fixed << setprecision(3) << an[0] << " " << 0.000 << endl; else if(an[0] == 0) cout << fixed << setprecision(3) << 0.000 << " " << an[1] << endl; else cout << fixed << setprecision(3) << an[0] << " " << an[1] << endl; i = 0;} else{ n[i]=s; i++; } } return 0; // cout << l[0] endl; }
a.cc: In function 'double* solve_equations(int*)': a.cc:23:14: error: 'pow' was not declared in this scope 23 | ax = pow(z,-1)*x; | ^~~ a.cc:29:16: warning: address of local variable 'ans' returned [-Wreturn-local-addr] 29 | return ans; | ^~~ a.cc:28:16: note: declared here 28 | double ans[2] = {ax,ay}; | ^~~
s645833809
p00004
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int t; double a, b, c, d, e, f, x, y; cin >> t; while(t--){ cin >> a >> b >> c >> d >> e >> f; y = (c/(d)a - f/d)/(b/a - e/d); x = (c-b*y)/a; cout << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: expected ')' before 'a' 12 | y = (c/(d)a - f/d)/(b/a - e/d); | ~ ^ | )
s890643635
p00004
C++
#include<iostream> #include<vector> #include<iomanip> using namespace std; typedef struct Shiki{ double a,b,c;//ax+by=c double x,y; }; Shiki Equation (Shiki, Shiki); main(){ Shiki shiki1,shiki2; vector<Shiki> ans; int i=0; while(cin){ cin>>shiki1.a>>shiki1.b>>shiki1.c>>shiki2.a>>shiki2.b>>shiki2.c; ans.push_back(Equation(shiki1,shiki2)); i++; } cout<<"hogee"<<endl; for(int j=0;j<i;j++){ cout<< fixed << setprecision(4) << ans[j].x << " " << ans[j].y << endl; } } Shiki Equation (Shiki A, Shiki B){ Shiki ans,preA; int x,y,aa,ba; preA = A; aa = A.a; ba = B.a; A.a *= ba; A.b *= ba; A.c *= ba; B.a *= aa; B.b *= aa; B.c *= aa; ans.a = 0; ans.b = A.b - B.b; ans.c = A.c - B.c; ans.y = ans.c / ans.b; ans.x = (preA.c - preA.b*ans.y)/preA.a; if((ans.y*1000)%10 >= 5)ans.y += 0.0001; if((ans.y*1000)%10 >= 5)ans.x += 0.0001; return ans; }
a.cc:7:1: warning: 'typedef' was ignored in this declaration 7 | typedef struct Shiki{ | ^~~~~~~ a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 14 | main(){ | ^~~~ a.cc: In function 'Shiki Equation(Shiki, Shiki)': a.cc:55:18: error: invalid operands of types 'double' and 'int' to binary 'operator%' 55 | if((ans.y*1000)%10 >= 5)ans.y += 0.0001; | ~~~~~~~~~~~~^~~ | | | | double int a.cc:56:18: error: invalid operands of types 'double' and 'int' to binary 'operator%' 56 | if((ans.y*1000)%10 >= 5)ans.x += 0.0001; | ~~~~~~~~~~~~^~~ | | | | double int
s205889333
p00004
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a = sc.nextDouble(); double b = sc.nextDouble(); double c = sc.nextDouble(); double d = sc.nextDouble(); double e = sc.nextDouble(); double f = sc.nextDouble(); b = b*d; c = c*d; e = e*a; f = f*a; double y = (c-f)/(b-e); double x = (c-(b*y))/(a*d); x = (int)((x * 1000)+0.5); y = (int)((y * 1000)+0.5); System.out.println((double)x/1000 +" "+ (double)y/1000); } }
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s774739020
p00004
C++
#include<iostream> #include <iomanip.h> using namespace std; int main() { double a,b,c,d,e,f; double n; double x,y,ty,tc; while( cin>>a>>b>>c>>d>>e>>f ) { n=(a/d); d = d * n; e = e * n; f = f * n; ty = b-e; tc = c-f; y = tc/ty; tc = c - (b*y); x = tc/a; cout << setiosflags(ios::fixed); cout << setprecision(3); cout << x <<" "<< y <<endl; } }
a.cc:2:10: fatal error: iomanip.h: No such file or directory 2 | #include <iomanip.h> | ^~~~~~~~~~~ compilation terminated.
s814293818
p00004
C++
#include <stdio.h> void Renritsu(double a,double b,double c,double d,double e,double f){ double ta = a * d; double tb = b * d; double tc = c * d; double td = d * a; double te = e * a; double tf = f * a; td -= ta; te -= tb; tf -= tc; double y = tf / te; ta = a * e; tb = b * e; tc = c * e; td = d * b; te = e * b; tf = f * b; td -= ta; te -= tb; tf -= tc; double x = tf / td; printf("%.3lf %.3lf \n",x,y); } void main() { Renritsu(1,2,3,4,5,6); Renritsu(2,-1,-2,-1,-1,-5); }
a.cc:28:1: error: '::main' must return 'int' 28 | void main() | ^~~~
s130743288
p00004
C++
int gcm(int a,int b){ int c=a%b; while(c!=0){ a=b; b=c; c=a%b; } return b; } int main(){ int x[2],y[3],sum[3]; double ans[2]; while(cin>>x[0]>>y[0]>>sum[0]>>x[1]>>y[1]>>sum[1]){ if(x[0]==0){ ans[1]=(double)sum[0]/y[0]; ans[0]=(sum[1]-y[1]*ans[1])/x[1]; }else if(x[1]==0){ ans[1]=(double)sum[1]/y[1]; ans[0]=(sum[0]-y[0]*ans[1])/x[0]; }else if(y[0]==0){ ans[0]=(double)sum[0]/x[0]; ans[1]=(sum[1]-x[1]*ans[0])/y[1]; }else if(y[1]==0){ ans[0]=(double)sum[1]/x[1]; ans[1]=(sum[0]-x[0]*ans[0])/y[0]; }else{ y[2]=y[0]*x[1]-y[1]*x[0]; sum[2]=sum[0]*x[1]-sum[1]*x[0]; ans[1]=(double)sum[2]/y[2]; ans[0]=(sum[0]-y[0]*ans[1]); } printf("%.3f %.3f\n",ans[0],ans[1]); } return 0; }
a.cc: In function 'int main()': a.cc:14:15: error: 'cin' was not declared in this scope 14 | while(cin>>x[0]>>y[0]>>sum[0]>>x[1]>>y[1]>>sum[1]){ | ^~~ a.cc:33:17: error: 'printf' was not declared in this scope 33 | printf("%.3f %.3f\n",ans[0],ans[1]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int gcm(int a,int b){
s073445997
p00004
C++
#include<stdio.h> int main(){ double x1,y1,z1,x2,y2,z2,num1=0,x=0,y=0,z=0,sum1=0,sum2=0,vx=0,vy=0,vz=0; scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&z1,&x2,&y2,&z2); if((x1>0&&x2>0)||(x1<0&&x2>0)){ num1=x2/x1*-1; } else if((x1>0&&x2<0)||(x1<0&&x2<0)){ num1=x2/x1; } else if() vx=x1*num1; vy=y1*num1; vz=z1*num1; x=vx+x2; y=vy+y2; z=vz+z2; sum2=z/y; sum1=(z2-y2*sum2)/x2; if(sum1>=0){ sum1=(int)(sum1*1000+0.5); sum1=(double)(sum1/1000); } else if(sum1<0){ sum1=(int)(sum1*1000-0.5); sum1=(double)(sum1/1000); } if(sum2>=0){ sum2=(int)(sum2*1000+0.5); sum2=(double)(sum2/1000); } else if(sum2<0){ sum2=(int)(sum2*1000-0.5); sum2=(double)(sum2/1000); } printf("%.3f %.3f\n",sum1,sum2); return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: expected primary-expression before ')' token 17 | else if() | ^
s797626289
p00004
C++
while line = gets (a, b, c, d, e, f) = line.split(" ").map{|str|Integer str} z = a*e - b*d x = (c*e-f*b)/z + 0.000 y = (f*a-c*d)/z + 0.000 puts sprintf("%.3f %.3f", x, y) end
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while line = gets | ^~~~~ a.cc:3:3: error: 'z' does not name a type 3 | z = a*e - b*d | ^
s067320971
p00004
C++
try : while True : (a,b,c,d,e,f) = map(int, raw_input().split()) print "%.3f %.3f"%((c*e-b*f)/(a*e-b*d), (a*f-c*d)/(a*e-b*d)) except EOFError : pass
a.cc:1:1: error: expected unqualified-id before 'try' 1 | try : | ^~~
s896810196
p00004
C++
#include<iostream> #include<iomanip> #include<stdio.h> using namespace std; int main() { double a,b,c,d,e,f; double x,y; while(true){ cin >> a >> b >> c >> d >> e >> f; double tempb = b; a*=e;b*=e;c*=e; d*=tempb;e*=tempb;f*=tempb; a-=d;b-=e;c-=f; x = c/a; y = (f-(d*x))/e; if(x == -0) x = 0; if(y == -0) y = 0; x = floor((x+0.0005)*1000)/1000; y = floor((y+0.0005)*1000)/1000; printf("%0.3lf %0.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:28:21: error: 'floor' was not declared in this scope 28 | x = floor((x+0.0005)*1000)/1000; | ^~~~~
s347577792
p00004
C++
#include "iostream" #include "iomanip" using namespace std; double main() { double a,b,c,d,e,f,x,y; while(cin>>a>>b>>c>>d>>e>>f) { y=(a*f-c*d)/(a*e-b*d); x=(c*e-b*f)/(a*e-b*d); cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl; } return 0; }
a.cc:5:1: error: '::main' must return 'int' 5 | double main() | ^~~~~~
s961706788
p00004
C++
#include<bits/stdc++.h> #include<cstdio> #include<sstream> #include<cstdlib> #include<cctype> #include<cmath> #include<algorithm> #include<set> #include<queue> #include<stack> #include<list> #include<iostream> #include<fstream> #include<numeric> #include<string> #include<vector> #include<cstring> #include<map> #include<iterator> using namespace std; #define EPS 1e-9 #define MAX 505 #define pb push_back #define mp make_pair #define ins insert #define fi first #define se second #define pi acos(-1.0) #define mod 100000007 #define inf 2147483647 #define ll long long int #define sss stringstream #define oss ostringstream #define iss istringstream #define llu long long unsigned #define _sq(a) (a)*(a) #define sz(a) ((int)a.size()) #define gcd(a,b) __gcd(a,b) #define lcm(a,b) ((a)*((b)/gcd(a,b))) #define _max3(a,b,c) max(a, max(b,c)) #define _min3(a,b,c) min(a, min(b,c)) #define FOR(i, n) for(i=0; i<(int)n; i++) #define FOR1(i, n) for(i=1; i<=(int)n; i++) #define mem(a) memset(a, 0, sizeof(a)) #define _set(a) memset(a,-1,sizeof(a)) #define FORI(i, a, b) for(i=a; i>=(int)b; i--) #define FORab(i, a, b) for(i=a; i<=(int)b; i++) #define popcount(n) __builtin_popcount(n) #define popcountl(n) __builtin_popcountll(n) #define sort_rev(a) sort(a.rbegin(), a.rend()) #define sort_all(a) sort(a.begin(), a.end()) #define dis_twopoints(x1,y1,x2,y2) sqrt(_sq(x1-x2) + _sq(y1-y2)) #define foreach(i,n) for(__typeof((n).begin())i =(n).begin();i!=(n).end();i++) //If Long Long (mask & (1LL << k)) #define check(mask, k) (mask & (1 << k)) #define set1(mask, k) (mask | (1 << k)) #define set0(mask ,k) (mask & (~(1<<k))) #define SD(a) scanf("%d",&a) #define SLF(a) scanf("%lf",&a) #define SC(a) scanf("%c",&a) #define SS(a) scanf("%s",a) #define SLLD(a) scanf("%lld", &a) #define Si64(a) scanf("%I64d", &a) #define READ(f) freopen(f, "r", stdin) #define WRITE(f) freopen(f, "w", stdout) int main() { double a,b,c,d,e,f,x,y,fl,clx,cly; while((cin>>a>>b>>c>>d>>e>>f)!=EOF) { fl=(e*a-b*d); clx=c*e-b*f; if(clx==0) x=0.0; else x=clx/fl; cly=f*a-c*d; if(cly==0) y=0.0; else y=cly/fl; printf("%.3lf %.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:74:34: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ~~~~~~~~~~~~~~~~~~~~~~~^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:74:34: note: candidate: 'operator!=(int, int)' (built-in) 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^ a.cc:74:34: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1132 | operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1132:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:1212:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1212 | operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1212:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:1305:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1305 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1305:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1379 | operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1379:5: note: template argument deduction/substitution failed: a.cc:74:36: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1473 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1473:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1547 | operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1547:5: note: template argument deduction/substitution failed: a.cc:74:36: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1647 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1647:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2213 | operator!=(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2213:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:74:36: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 74 | while((cin>>a>>b>>c>>d>>e>>f)!=EOF) | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitu
s283383731
p00004
C++
#include <iostream> using namespace std; int main(){ double a,b,c,d,e,f,x,y; while(cin>>a>>b>>c>>d>>e>>f){ y=(c*d-f*e)/(b*d-a*e); x=(c-b*y)/a; cout<<setprecision(3)<<x<<y<<endl;} return 0;}
a.cc: In function 'int main()': a.cc:8:7: error: 'setprecision' was not declared in this scope 8 | cout<<setprecision(3)<<x<<y<<endl;} | ^~~~~~~~~~~~ a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 1 | #include <iostream> +++ |+#include <iomanip> 2 | using namespace std;
s897626898
p00004
C++
#include<iostream> using namespace std; int main(){ double a, b, c, d, e, f, x, y; double thousand = 1000.000; cin >> a >> b >> c >> d >> e >> f; x = (c*e - f*b) / (a*e - b*d); y = (d*c - f*a) / (b*d - a*e); x = x * pow(10.0, 3.0); x += 0.5; x = (int)x; x = (double)x/thousand; y = y * pow(10.0, 3.0); y += 0.5; y = (int)y; y = (double)y/thousand; cout << x << " " << y << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'pow' was not declared in this scope 17 | x = x * pow(10.0, 3.0); | ^~~
s544626246
p00004
C++
#include<cstdio> #include<cmath> #include<algorithm> #define rep(i,a,b) for(int i = (a); i<=(b); i++) using namespace std; const int num = 100; double matrix[num][num + 1]; //邉サ謨ー遏ゥ髦オ?御サ?蠑?ァ?double ans[num]; //扈捺棡謨ー扈? void exchange_col(int p1,int p2,int n) //莠、謐「p1陦悟柱p2陦檎噪謇?怏謨ー謐ョ { double t; int i; for(i = 0 ; i <= n ; i++) t = matrix[p1][i],matrix[p1][i] = matrix[p2][i],matrix[p2][i] = t; } bool gauss(int n) //豎りァ」邉サ謨ー遏ゥ髦オ荳コn逧?コソ諤ァ譁ケ遞狗サ?{ int i,j,k; int p; double r; for(i = 0 ; i < n - 1 ; i++) { p = i; for(j = i + 1 ; j < n ; j++) //蟇サ謇セi蛻玲怙螟ァ蛟シ菴咲スョ { if(matrix[j][i] > matrix[p][i]) p = j; } if(matrix[p][i] == 0) return false; if(p != i) exchange_col(i,p,n); for(j = i + 1 ; j < n ; j++) //蜑ゥ菴吝?霑幄。梧カ亥? { r = matrix[j][i] / matrix[i][i]; for(k = i ; k <= n ; k++) matrix[j][k] -= r * matrix[i][k]; } } for(i = n - 1 ; i >= 0 ; i--) //闔キ蠕礼サ捺棡 { ans[i] = matrix[i][n]; for(j = n - 1 ; j > i ; j--) ans[i] -= matrix[i][j] * ans[j]; ans[i] /= matrix[i][i]; } return true; } int main() { int i,j,t; while(scanf("%lf",&matrix[0][0])!=-1) { rep(i,1,2) scanf("%lf",&matrix[0][i]); rep(i,0,2) scanf("%lf",&matrix[1][i]); gauss(2); printf("%.3lf %.3lf\n",ans[0],ans[1]); } return 0; }
a.cc:17:5: error: expected initializer before 'int' 17 | int i,j,k; | ^~~ a.cc:21:5: error: expected unqualified-id before 'for' 21 | for(i = 0 ; i < n - 1 ; i++) | ^~~ a.cc:21:17: error: 'i' does not name a type 21 | for(i = 0 ; i < n - 1 ; i++) | ^ a.cc:21:29: error: 'i' does not name a type 21 | for(i = 0 ; i < n - 1 ; i++) | ^ a.cc:38:5: error: expected unqualified-id before 'for' 38 | for(i = n - 1 ; i >= 0 ; i--) //闔キ蠕礼サ捺棡 | ^~~ a.cc:38:21: error: 'i' does not name a type 38 | for(i = n - 1 ; i >= 0 ; i--) //闔キ蠕礼サ捺棡 | ^ a.cc:38:30: error: 'i' does not name a type 38 | for(i = n - 1 ; i >= 0 ; i--) //闔キ蠕礼サ捺棡 | ^ a.cc:45:5: error: expected unqualified-id before 'return' 45 | return true; | ^~~~~~ a.cc:46:1: error: expected declaration before '}' token 46 | } | ^ a.cc: In function 'int main()': a.cc:54:9: error: 'gauss' was not declared in this scope 54 | gauss(2); | ^~~~~ a.cc:55:32: error: 'ans' was not declared in this scope; did you mean 'abs'? 55 | printf("%.3lf %.3lf\n",ans[0],ans[1]); | ^~~ | abs
s232849636
p00004
C++
z = [] while True: try: a, b, c, d, e, f = map(float, raw_input().split()) x = (c * e - b * f) / (a * e - d * b) y = (c * d - f * a) / (b * d - e * a) z.append([x, y]) except: break for i in z: print("{:.3f} {:.3f}".format(i[0] + 0, i[1] + 0))
a.cc:1:1: error: 'z' does not name a type 1 | z = [] | ^
s350026996
p00004
C++
#include <iostream> #include <cstdio> using namespace std; int main() { double a,b,c,d,e,f; double x,y; while(cin>>a>>b>>c>>d>>e>>f) { x=(b*f-c*e)/(b*d-a*e); y=(a*f-c*d)/(a*e-b*d); if(x*10000%10>=5) x=x+0.001; if(y*10000%10>=5) y=y+0.001; printf("%.3lf %.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:13:27: error: invalid operands of types 'double' and 'int' to binary 'operator%' 13 | if(x*10000%10>=5) x=x+0.001; | ~~~~~~~^~~ | | | | double int a.cc:14:27: error: invalid operands of types 'double' and 'int' to binary 'operator%' 14 | if(y*10000%10>=5) y=y+0.001; | ~~~~~~~^~~ | | | | double int