submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s924409300
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){ x=(c*e-f*b)/(a*e-d*b); y=(c*d-f*a)/(b*d-e*a); if((int)(x==0)x=0; if((int)(y==0)y=0; printf("%.3f %.3f\n",x,y); } return 0; }
main.c: In function 'main': main.c:7:15: error: expected ')' before 'x' 7 | if((int)(x==0)x=0; | ~ ^ | ) main.c:12:1: error: expected expression before '}' token 12 | } | ^ main.c:12:1: error: expected declaration or statement at end of input
s988823342
p00004
C
float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0}
main.c:1:19: error: return type defaults to 'int' [-Wimplicit-int] 1 | float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0} | ^~~~ main.c: In function 'main': main.c:1:19: error: type of 'X' defaults to 'int' [-Wimplicit-int] main.c:1:28: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0} main.c:1:28: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0} | ^~~~~ main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:60: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0} | ^~~~~~ main.c:1:60: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:60: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:60: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:115: error: expected ';' before '}' token 1 | float d,b,f,e,c,a;main(X){~scanf("%f",&a+--X)?main(X+5?X:!!printf("%.3f %.3f\n",(e-c*d)/a,d/=a*b-c*f,d=a*d-f*e)):0} | ^ | ;
s150070895
p00004
C
#include<stdio.h> int main(void){ int a,b,c,d,e,f; double ansx,ansy; scanf("%d %d %d %d %d %d",a,b,c,d,e,f); ansy = (b*f-c*e)/(a*f-c*d); ansx = (f - e*ansy)/d; printf("%f %f\n" ,anx,ansy); return 0; }
main.c: In function 'main': main.c:11:20: error: 'anx' undeclared (first use in this function); did you mean 'ansx'? 11 | printf("%f %f\n" ,anx,ansy); | ^~~ | ansx main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
s944365407
p00004
C
#include<stdio.h> double determinant(double a, double b, double c, double d) { return (a * d) - (b * c); } int main(void) { double a, b, c, d, e, f; double A, D1, D2; double x, y, X, Y; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);) { A = determinant(a, b, d, e); D1 = determinant(c, b, f, e); D2 = determinant(a, c, d, f); x = D1 / A; y = D2 / A; if(x >= 0 && y >= 0) { printf("%.3f %.3f", (x + 0.0005), (y + 0.0005)); } else if(x < 0 && y >= 0) { printf("%.3f %.3f", (x - 0.0005), (y - 0.0005)); } else if(x >= 0 && y < 0) { printf("%.3f %.3f", (x + 0.0005), (y - 0.0005)); } else { printf("%.3f %.3f", (x + 0.0005), (y + 0.0005)); } } return 0; }
main.c: In function 'main': main.c:13:71: error: expected ')' before ';' token 13 | while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);) | ~ ^ | )
s283407271
p00004
C
#include<stdio.h> int main(){ 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=(c*d-a*f)/(b*d-a*e); printf("%lf %lf\n",x,y); } return 0;
main.c: In function 'main': main.c:16:1: error: expected declaration or statement at end of input 16 | return 0; | ^~~~~~
s572301668
p00004
C
#include<stdio.h> #include<math.h> float round_f(float x) { if ( x > 0.0 ) { return floor(x + 0.005); } else { return -1.0 * floor(fabs(x) + 0.005); } } int main(){ float a,b,c,d,e,f,x,y; while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){ x=(bf-ce)/(bd-ae); x=round_f(x); y=(af-cd)/(ae-bd); y=roundf_(y); printf("%.3f %.3f",x,y); } return 0; }
main.c: In function 'main': main.c:15:4: error: 'bf' undeclared (first use in this function); did you mean 'f'? 15 | x=(bf-ce)/(bd-ae); | ^~ | f main.c:15:4: note: each undeclared identifier is reported only once for each function it appears in main.c:15:7: error: 'ce' undeclared (first use in this function); did you mean 'e'? 15 | x=(bf-ce)/(bd-ae); | ^~ | e main.c:15:12: error: 'bd' undeclared (first use in this function); did you mean 'd'? 15 | x=(bf-ce)/(bd-ae); | ^~ | d main.c:15:15: error: 'ae' undeclared (first use in this function); did you mean 'e'? 15 | x=(bf-ce)/(bd-ae); | ^~ | e main.c:17:4: error: 'af' undeclared (first use in this function); did you mean 'f'? 17 | y=(af-cd)/(ae-bd); | ^~ | f main.c:17:7: error: 'cd' undeclared (first use in this function); did you mean 'd'? 17 | y=(af-cd)/(ae-bd); | ^~ | d main.c:18:3: error: implicit declaration of function 'roundf_'; did you mean 'round_f'? [-Wimplicit-function-declaration] 18 | y=roundf_(y); | ^~~~~~~ | round_f
s920046105
p00004
C
#include<stdio.h> #include<math.h> float round_f(float x) { if ( x > 0.0 ) { return floor(x + 0.005); } else { return -1.0 * floor(fabs(x) + 0.005); } } int main(){ float a,b,c,d,e,f,x,y; while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){ x=(b*f-ce)/(b*d-a*e); x=round_f(x); y=(a*f-c*d)/(a*e-b*d); y=roundf_(y); printf("%.3f %.3f",x,y); } return 0; }
main.c: In function 'main': main.c:15:8: error: 'ce' undeclared (first use in this function); did you mean 'e'? 15 | x=(b*f-ce)/(b*d-a*e); | ^~ | e main.c:15:8: note: each undeclared identifier is reported only once for each function it appears in main.c:18:3: error: implicit declaration of function 'roundf_'; did you mean 'round_f'? [-Wimplicit-function-declaration] 18 | y=roundf_(y); | ^~~~~~~ | round_f
s242234966
p00004
C
#include<stdio.h> #include<math.h> float round_f(float x) { if ( x > 0.0 ) { return floor(x + 0.005); } else { return -1.0 * floor(fabs(x) + 0.005); } } int main(){ float a,b,c,d,e,f,x,y; while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){ x=(b*f-c*e)/(b*d-a*e); x=round_f(x); y=(a*f-c*d)/(a*e-b*d); y=roundf_(y); printf("%.3f %.3f",x,y); } return 0; }
main.c: In function 'main': main.c:18:3: error: implicit declaration of function 'roundf_'; did you mean 'round_f'? [-Wimplicit-function-declaration] 18 | y=roundf_(y); | ^~~~~~~ | round_f
s290051549
p00004
C
#include <stdio.h> #include <math.h> double round_d(double x) { if ( x >= 0.0 ) { return floor(x + 0.5); } else { return -1.0 * floor(fabs(x) + 0.5); } } #include <stdio.h> #include <math.h> double round_d(double x) { if ( x >= 0.0 ) { return floor(x + 0.5); } else { return -1.0 * floor(fabs(x) + 0.5); } } int main(){ double num1[100],num2[100],num3[100],num4[100],num5[100],num6[100],x=0.0,y=0.0; int i,count=0; for(i=0;i<2;i++){ if(scanf("%lf %lf %lf %lf %lf %lf",&num1[i],&num2[i],&num3[i],&num4[i],&num5[i],&num6[i])==EOF)break; count++; } for(i=0;i<count;i++){ if((num1[i]==0&&num4[i]==0)!=1&&(num2[i]==0&&num5[i])!=1&&(num1[i]==0&&num2[i]==0)!=1&&(num4[i]==0&&num5[i]==0)!=1&&(num2[i]*num4[i]-num1[i]*num5[i])!=0.0){ if(num1[i]==0.0){y=num3[i]/num2[i];x=num6[i]/num4[i]-num3[i]*num5[i]/num2[i]*num4[i];} else if(num2[i]==0.0){x=num3[i]/num1[i];y=num6[i]/num5[i]-num3[i]*num4[i]/num1[i]*num5[i];} else if(num4[i]==0.0){y=num6[i]/num5[i];x=num3[i]/num1[i]-num2[i]*num6[i]/num1[i]*num5[i];} else if(num5[i]==0.0){x=num6[i]/num4[i];y=num3[i]/num2[i]-num1[i]*num6[i]/num2[i]*num4[i];} else{ x=(num2[i]*num6[i]-num3[i]*num5[i])/(num2[i]*num4[i]-num1[i]*num5[i]); x=round_d(x*1000.0)/1000.0; y=(num1[i]*num6[i]-num3[i]*num4[i])/(num1[i]*num5[i]-num2[i]*num4[i]); y=round_d(y*1000.0)/1000.0; } } printf("%.3f %.3f\n",x,y); } return 0; }
main.c:15:8: error: redefinition of 'round_d' 15 | double round_d(double x) { | ^~~~~~~ main.c:4:8: note: previous definition of 'round_d' with type 'double(double)' 4 | double round_d(double x) { | ^~~~~~~
s050832046
p00004
C
#include <stdio.h> #include <math.h> double round_d(double x) { if ( x >= 0.0 ) { return floor(x + 0.5); } else { return -1.0 * floor(fabs(x) + 0.5); } } int main(){ double num1[10000],num2[10000],num3[10000],num4[10000],num5[10000],num6[10000],x=0.0,y=0.0; while(scanf("%lf %lf %lf %lf %lf %lf",&num1[i],&num2[i],&num3[i],&num4[i],&num5[i],&num6[i])!=EOF){ if((num1[i]==0&&num4[i]==0)!=1&&(num2[i]==0&&num5[i])!=1&&(num1[i]==0&&num2[i]==0)!=1&&(num4[i]==0&&num5[i]==0)!=1&&(num2[i]*num4[i]- num1[i]*num5[i])!=0.0){ if(num1[i]==0.0){y=num3[i]/num2[i];x=num6[i]/num4[i]-num3[i]*num5[i]/num2[i]*num4[i];} else if(num2[i]==0.0){x=num3[i]/num1[i];y=num6[i]/num5[i]-num3[i]*num4[i]/num1[i]*num5[i];} else if(num4[i]==0.0){y=num6[i]/num5[i];x=num3[i]/num1[i]-num2[i]*num6[i]/num1[i]*num5[i];} else if(num5[i]==0.0){x=num6[i]/num4[i];y=num3[i]/num2[i]-num1[i]*num6[i]/num2[i]*num4[i];} else{ x=(num2[i]*num6[i]-num3[i]*num5[i])/(num2[i]*num4[i]-num1[i]*num5[i]); x=round_d(x*1000.0)/1000.0; y=(num1[i]*num6[i]-num3[i]*num4[i])/(num1[i]*num5[i]-num2[i]*num4[i]); y=round_d(y*1000.0)/1000.0; } } printf("%.3f %.3f\n",x,y); } return 0; }
main.c: In function 'main': main.c:14:45: error: 'i' undeclared (first use in this function) 14 | while(scanf("%lf %lf %lf %lf %lf %lf",&num1[i],&num2[i],&num3[i],&num4[i],&num5[i],&num6[i])!=EOF){ | ^ main.c:14:45: note: each undeclared identifier is reported only once for each function it appears in
s003459638
p00004
C
#include <stdio.h> #include <math.h> double round_d(double x) { if ( x >= 0.0 ) { return floor(x + 0.5); } else { return -1.0 * floor(fabs(x) + 0.5); } } int main(){ double num1,num2,num3,num4,num5,num6,x=0.0,y=0.0; while(scanf("%lf %lf %lf %lf %lf %lf",&num1,&num2,&num3,&num4,&num5,&num6)!=EOF){ if((num1==0&&num4==0)!=1&&(num2==0&&num5)!=1&&(num1==0&&num2==0)!=1&&(num4==0&&num5==0)!=1&&(num2*num4-num1*num5)!=0.0){ if(num1==0.0){y=num3/num2;x=num6/num4-num3*num5/num2*num4;} else if(num2==0.0){x=num3/num1;y=num6/num5-num3*num4/num1*num5;} else if(num4==0.0){y=num6/num5;x=num3/num1-num2*num6/num1*num5;} else if(num5==0.0){x=num6/num4;y=num3/num2-num1*num6/num2*num4;} else{ x=(num2*num6-num3*num5)/(num2*num4-num1*num5); x=round_d(x*1000.0)/1000.0; y=(num1*num6-num3*num4)/(num1*num5-num2*num4); y=round_d(y*1000.0)/1000.0; } else{break;} } printf("%.3f %.3f\n",x,y); } return 0; }
main.c: In function 'main': main.c:26:1: error: expected '}' before 'else' 26 | else{break;} | ^~~~ main.c: At top level: main.c:30:1: error: expected identifier or '(' before 'return' 30 | return 0; | ^~~~~~ main.c:31:1: error: expected identifier or '(' before '}' token 31 | } | ^
s308696349
p00004
C
#include <stdio.h> int main(void) { double a, b, c, d, e, f; double x, y; while(scanf(buff,("%lf %lf %lf %lf %lf %lf"), &a, &b, &c, &d, &e, &f) != 6){ x = (c*e - f*b) / (a*e - b*d); y = (c*d - f*a) / (b*d - a*e); printf("%.3f %.3f\n",x ,y); } return 0; }
main.c: In function 'main': main.c:7:21: error: 'buff' undeclared (first use in this function) 7 | while(scanf(buff,("%lf %lf %lf %lf %lf %lf"), &a, &b, &c, &d, &e, &f) != 6){ | ^~~~ main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
s729536932
p00004
C
#include <stdio.h> 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) == 6) { if( a < -1000 || a > 1000 || b < -1000 || b > 1000 || c < -1000 || d > 1000 || d < -1000 || d > 1000 || e < -1000 || e > 1000 || f < -1000 || f > 1000 ) break; x = (c*e - f*b) / (a*e - b*d); y = (c*d - f*a) / (b*d - a*e); printf("%.3f %.3f\n",x ,y); } } return 0; }
main.c:23:5: error: expected identifier or '(' before 'return' 23 | return 0; | ^~~~~~ main.c:24:1: error: expected identifier or '(' before '}' token 24 | } | ^
s770257613
p00004
C
#include <stdio.h> 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) == 6) { x = (c*e - f*b) / (a*e - b*d); y = (c*d - f*a) / (b*d - a*e); printf("%.3f %.3f\n",x ,y); } } return 0; }
main.c:13:5: error: expected identifier or '(' before 'return' 13 | return 0; | ^~~~~~ main.c:14:1: error: expected identifier or '(' before '}' token 14 | } | ^
s507643540
p00004
C
#include<stdio.h> int det(int a00, int a01, int a10, int a11) { return a00*a11 - a01*a10; } int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { int t = det(a, b, d, e); printf("%.3f %.3f\n", (double)det(c, b, f, e) / t, (double)det(a, c, d, f) / t); } return 0; }
main.c: In function 'main': main.c:11:16: error: 'cin' undeclared (first use in this function) 11 | while (cin >> a >> b >> c >> d >> e >> f) | ^~~ main.c:11:16: note: each undeclared identifier is reported only once for each function it appears in
s722565038
p00004
C
#include<stdio.h> int main(void){ int a,b,c,d,e,f; int num1=0,num2=0; int x=0,y=0; while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &by, &c, &dx, &ey, &f) != EOF) { y = (c * dx - ax * f) / (by * dx - ax * ey); x = (c - by * y) / ax; printf("%.3lf %.3lf\n", x, y); } return 0; }
main.c: In function 'main': main.c:9:51: error: 'ax' undeclared (first use in this function); did you mean 'x'? 9 | while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &by, &c, &dx, &ey, &f) != EOF) { | ^~ | x main.c:9:51: note: each undeclared identifier is reported only once for each function it appears in main.c:9:56: error: 'by' undeclared (first use in this function); did you mean 'y'? 9 | while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &by, &c, &dx, &ey, &f) != EOF) { | ^~ | y main.c:9:65: error: 'dx' undeclared (first use in this function); did you mean 'x'? 9 | while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &by, &c, &dx, &ey, &f) != EOF) { | ^~ | x main.c:9:70: error: 'ey' undeclared (first use in this function); did you mean 'y'? 9 | while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &by, &c, &dx, &ey, &f) != EOF) { | ^~ | y
s099566501
p00004
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(void) { int a,b,c,d,e,f; double x,y,det; while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF){ det=(double)(a*e-b*ds); x=(double)(c*e-b*f)/det; y=(double)(-d*c+a*f)/det; printf("%.3lf %.3lf\n",x,y); } return 0; }
main.c: In function 'main': main.c:10:24: error: 'ds' undeclared (first use in this function); did you mean 'd'? 10 | det=(double)(a*e-b*ds); | ^~ | d main.c:10:24: note: each undeclared identifier is reported only once for each function it appears in
s666333632
p00004
C
#include<stdio.h> int main(void) { double a,b,c,d,e,f,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 = (c-a*x)/b; if(x == -0.0) x = 0; if(y == -0.0) y = 0; printf("%.3lf %.3lf\n",x,y); } return 0;
main.c: In function 'main': main.c:15:5: error: expected declaration or statement at end of input 15 | return 0; | ^~~~~~
s392770034
p00004
C
#include<stdio.h> int main(void){ double a,b,c,d,e,f,g,x,y; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){ y=(f-c*d/a)/(e-b*d/a); x=(f-c*e/b)/(d-a*e/b); if(-0.0004<x&&x<=0)x=0; if(-0.0004<y&&y<=0)y=0; printf("%.3f %.3f\n",x,y); } return 0;
main.c: In function 'main': main.c:17:5: error: expected declaration or statement at end of input 17 | return 0; | ^~~~~~
s159612838
p00004
C
include <stdio.h> #include <stdlib.h> #include <string.h> #define DBG 0 #define BUFSIZE 40 static short h[6]; // return 0 : EOF // 1 : read success int getSimEq() { char buf[BUFSIZE] = {0}; char *p; int i, j; if (NULL == fgets(buf, BUFSIZE, stdin)) { if (DBG) { fprintf (stderr, "EOF\n"); } return 0; } buf[strlen(buf)-1] = 0; if (DBG) { fprintf(stderr, "input=%s\n", buf); } for (i=0, j=0, p = buf; j<6; j++, p = p+strlen(p)+1) { for (; buf[i] != ' ' && i<BUFSIZE; i++); buf[i] = 0; h[j] = atoi(p); } if (DBG) { fprintf(stderr, "h[*] =%d %d %d %d %d %d\n", h[0], h[1], h[2], h[3], h[4], h[5]); } return 1; } int main (void) { float x, y, detr; while (getSimEq()) { // (h[0], h[1]) (x) = (h[2]) // (h[3], h[4]) (y) (h[5]) // (x) = 1/(h[0]*h[4]-h[1]*h[3]) (h[4], -h[1]) (h[2]) // (y) (-h[3], h[0]) (h[5]) // (x) = 1/(h[0]*h[4]-h[1]*h[3]) * ( h[4]*h[2] - h[1]*h[5]) // (y) = 1/(h[0]*h[4]-h[1]*h[3]) * (-h[3]*h[2] + h[0]*h[5]) detr = 1.0/(h[0]*h[4]-h[1]*h[3]); x = detr * ( h[4]*h[2] - h[1]*h[5]); y = detr * (-h[3]*h[2] + h[0]*h[5]); // for negative 0 if (x == 0) x = 0; if (y == 0) y = 0; printf ("%.3f %.3f\n", x, y); if (DBG) { fprintf (stderr, "%f %f\n", x, y); } } return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^ In file included from main.c:2: /usr/include/stdlib.h:98:8: error: unknown type name 'size_t' 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ^~~~~~ /usr/include/stdlib.h:57:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 56 | #include <bits/floatn.h> +++ |+#include <stddef.h> 57 | /usr/include/stdlib.h:531:25: error: unknown type name 'size_t' 531 | size_t __statelen) __THROW __nonnull ((2)); | ^~~~~~ /usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:561:25: error: unknown type name 'size_t' 561 | size_t __statelen, | ^~~~~~ /usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:661:42: error: unknown type name 'size_t' 661 | extern void arc4random_buf (void *__buf, size_t __size) | ^~~~~~ /usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:672:22: error: unknown type name 'size_t' 672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:672:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:675:22: error: unknown type name 'size_t' 675 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:675:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:675:38: error: unknown type name 'size_t' 675 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:675:38: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:683:36: error: unknown type name 'size_t' 683 | extern void *realloc (void *__ptr, size_t __size) | ^~~~~~ /usr/include/stdlib.h:683:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:695:41: error: unknown type name 'size_t' 695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:695:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:695:57: error: unknown type name 'size_t' 695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:695:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:701:41: error: unknown type name 'size_t' 701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:701:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:701:57: error: unknown type name 'size_t' 701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:701:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/stdlib.h:706: /usr/include/alloca.h:32:22: error: unknown type name 'size_t' 32 | extern void *alloca (size_t __size) __THROW; | ^~~~~~ /usr/include/alloca.h:25:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 24 | #include <stddef.h> +++ |+#include <stddef.h> 25 | /usr/include/stdlib.h:712:22: error: unknown type name 'size_t' 712 | extern void *valloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:712:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:718:45: error: unknown type name 'size_t' 718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:718:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:718:65: error: unknown type name 'size_t' 718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:718:65: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:724:29: error: unknown type name 'size_t' 724 | extern void *aligned_alloc (size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:724:29: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:724:49: error: unknown type name 'size_t' 724 | extern void *aligned_alloc (size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:724:49: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:961:23: error: unknown type name 'size_t' 961 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | ^~~~~~ /usr/include/stdlib.h:961:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:961:39: error: unknown type name 'size_t' 961 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | ^~~~~~ /usr/include/stdlib.h:961:39: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:970:34: error: unknown type name 'size_t' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~~ /usr/include/stdlib.h:970:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:970:50: error: unknown type name 'size_t' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~~ /usr/include/stdlib.h:970:50: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1044:20: error: unknown type name 'size_t' 1044 | size_t __len) __THROW __nonnull ((3, 4, 5)); | ^~~~~~ /usr/include/stdlib.h:1044:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1047:20: error: unknown type name 'size_t' 1047 | size_t __len) __THROW __nonnull ((3, 4, 5)); | ^~~~~~ /usr/include/stdlib.h:1047:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1051:45: error: unknown type name 'size_t' 1051 | char *__restrict __buf, size_t __len) | ^~~~~~ /usr/include/stdlib.h:1051:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1055:45: error: unknown type name 'size_t' 1055 | char *__restrict __buf, size_t __len) | ^~~~~~ /usr/include/stdlib.h:1055:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1062:36: error: unknown type name 'size_t' 1062 | extern int mblen (const char *__s, size_t __n) __THROW; | ^~~~~~ /usr/include/stdlib.h:1062:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1066:48: error: unknown type name 'size_t' 1066 | const char *__restrict __s, size_t __n) __THROW; | ^~~~~~ /usr/include/stdlib.h:1066:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1073:8: error: unknown type name 'size_t' 1073 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, | ^~~~~~ /usr/include/stdlib.h:1073:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1074:53: error: unknown type name 'size_t' 1074 | const char *__restrict __s, size_t __n) __THROW | ^~~~~~ /usr/include/stdlib.h:1074:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1077:8: error: unknown type name 'size_t' 1077 | extern size_t wcstombs (char *__restrict __s, | ^~~~~~ /usr/include/stdlib.h:1077:8: note: 'size_t' is defined in header '<stddef.h>'; this is probab
s094860594
p00004
C
#include <stdio.h> int main(void) { int a, b, c, d, e, f; while(scanf("%d %d %d %d %d %d"), &a, &b, &c, &d, &e, &f) == 6) { printf("%5.3f %5.3f\n", (c*e-b*f)/(a*e-b*d)+0.0005, (d*a-c*b)/(a*e-d*b)+0.0005); } return 0; }
main.c: In function 'main': main.c:5:67: error: expected expression before '==' token 5 | while(scanf("%d %d %d %d %d %d"), &a, &b, &c, &d, &e, &f) == 6) { | ^~ main.c:5:71: error: expected statement before ')' token 5 | while(scanf("%d %d %d %d %d %d"), &a, &b, &c, &d, &e, &f) == 6) { | ^
s074954683
p00004
C
#include <stdio.h> #include <math.h> int main(void) { int A1, B1, E1, A2, B2, E2; double x, y; while(scanf("%d %d %d %d %d %d", &A1, &B1, &E1, &A2, &B2, &E2) == 6) { x = round(1.0*(E1*B2-B1*E2)/(A1*B2-B1*A2), 3); y = round(1.0*(E2*A1-E1*A2)/(A1*B2-A2*B1), 3); printf("%.3f %3f", x, y); } return 0; } double round(double src, int n) { double dst; dst = src * pow(10, -n - 1); dst = (double)(int)(dst + 0.5); return dst * pow(10, n + 1); }
main.c: In function 'main': main.c:8:21: error: too many arguments to function 'round' 8 | x = round(1.0*(E1*B2-B1*E2)/(A1*B2-B1*A2), 3); | ^~~~~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/stdio.h:28, from main.c:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: declared here 334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); | ^~~~~~~~~~~ main.c:9:21: error: too many arguments to function 'round' 9 | y = round(1.0*(E2*A1-E1*A2)/(A1*B2-A2*B1), 3); | ^~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: declared here 334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); | ^~~~~~~~~~~ main.c: At top level: main.c:17:8: error: conflicting types for 'round'; have 'double(double, int)' 17 | double round(double src, int n) { | ^~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: previous declaration of 'round' with type 'double(double)' 334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); | ^~~~~~~~~~~
s199734089
p00004
C
#include <stdio.h> int main (void) { double a[6],b; int i,c[2]; for(i=0;i<6;i++){ scanf("%lf",&a[i]); } if(a[0]==0) { b=a[3]; a[3]=a[0]; a[0]=b; } b=a[0]; a[0]/=b a[1]/=b; a[2]/=b; // b=a[3]; a[3]-=a[0]*b; a[4]-=a[1]*b; a[5]-=a[2]*b; // b=a[4]; a[4]*=1/b; a[5]*=1/b; // b=a[1]; a[1]-=a[4]*b; a[2]-=a[5]*b; // a[2]*=1000; c[0]=a[2]; a[2]=c[0]; a[2]/=1000; a[5]*=1000; c[1]=a[5]; a[5]=c[1]; a[5]/=1000; printf("%.3lf %.3lf\n",a[2],a[5]); return 0; }
main.c: In function 'main': main.c:16:12: error: expected ';' before 'a' 16 | a[0]/=b | ^ | ; 17 | a[1]/=b; | ~
s341975355
p00004
C
#include <stdio.h> int main(void){ int a, b, c, d, e, f, t; unsigned double x, y; while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){ t = 1.0*a*e - 1.0*b*d; x = (1.0*e*c - 1.0*b*f)/t + 0.0001; y = (1.0*a*f - 1.0*d*c)/t + 0.0001; printf("%.3f %.3f\n", x, y); } return 0; }
main.c: In function 'main': main.c:5:18: error: both 'unsigned' and 'double' in declaration specifiers 5 | unsigned double x, y; | ^~~~~~
s861100533
p00004
C
#include <stdio.h> int func(int a ,int b,int c,int d,int e,int f){ return (c*e-b*f)/(a*e-b*d); } int main(int argc, const char * argv[]) { double ax, by, c, dx, ey, f; double x, y; while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &by, &c, &dx, &ey, &f) != EOF) { x=func(a,b,c,d,e,f); y=((c-(ax*x))/by); printf("%.3lf %.3lf\n", x, y); } return 0; }
main.c: In function 'main': main.c:14:16: error: 'a' undeclared (first use in this function) 14 | x=func(a,b,c,d,e,f); | ^ main.c:14:16: note: each undeclared identifier is reported only once for each function it appears in main.c:14:18: error: 'b' undeclared (first use in this function) 14 | x=func(a,b,c,d,e,f); | ^ main.c:14:22: error: 'd' undeclared (first use in this function) 14 | x=func(a,b,c,d,e,f); | ^ main.c:14:24: error: 'e' undeclared (first use in this function) 14 | x=func(a,b,c,d,e,f); | ^
s639775772
p00004
C
#include <stdio.h> int func(int a ,int b,int c,int d,int e,int f){ return (c*e-b*f)/(a*e-b*d); } int main(void){/* double a,b,c,d,e,f,x,y; while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){ x=func(a,b,c,d,e,f); y=((c-(a*x))/b); x = (double)((long)(x * 1000)) / 1000; y = (double)((long)(y * 1000)) / 1000; printf("%.3lf %.3lf\n",x,y); } return 0; }
main.c: In function 'main': main.c:7:16: error: unterminated comment 7 | int main(void){/* | ^ main.c:7:1: error: expected declaration or statement at end of input 7 | int main(void){/* | ^~~
s234827860
p00004
C
#include <stdio.h> int func(int a ,int b,int c,int d,int e,int f){ return (c*e-b*f)/(a*e-b*d); } int main(void){/* double a,b,c,d,e,f,x,y; while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){ x=func(a,b,c,d,e,f); y=((c-(a*x))/b); x = ((long)(x * 1000)) / 1000; y = ((long)(y * 1000)) / 1000; printf("%.3lf %.3lf\n",x,y); } return 0; }
main.c: In function 'main': main.c:7:16: error: unterminated comment 7 | int main(void){/* | ^ main.c:7:1: error: expected declaration or statement at end of input 7 | int main(void){/* | ^~~
s642864555
p00004
C
int main(void){ 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=(c*d-a*f)/(b*d-a*e)+0.00001; x=(c-b*y)/a+0.00001; printf("%.3lf %.3lf\n",x,y); } return 0; }
main.c: In function 'main': main.c:3:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | while((scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)) != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:3:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | while((scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)) != EOF){ | ^~~~~ main.c:3:16: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:3:71: error: 'EOF' undeclared (first use in this function) 3 | while((scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)) != EOF){ | ^~~ main.c:3:71: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:3:71: note: each undeclared identifier is reported only once for each function it appears in main.c:6:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%.3lf %.3lf\n",x,y); | ^~~~~~ main.c:6:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:17: note: include '<stdio.h>' or provide a declaration of 'printf'
s352852622
p00004
C
#include <stdio.h> int func(double a ,double b,double c,double d,double e,double f){ int y; y=(c*d-a*f)/(b*d-a*e)+0.00001 return y; } int main(void){ 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=func(a,b,c,d,e,f); x=(c-b*y)/a+0.00001; printf("%.3lf %.3lf\n",x,y); } return 0; }
main.c: In function 'func': main.c:5:38: error: expected ';' before 'return' 5 | y=(c*d-a*f)/(b*d-a*e)+0.00001 | ^ | ; 6 | return y; | ~~~~~~
s713232986
p00004
C
#include <stdio.h> void func(double a ,double b,double c,double d,double e,double f,double* x,double* y){ *y=(c*d-a*f)/(b*d-a*e)+0.00001; *x=(c-b*(*y))/a+0.00001; } 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){ //y=func(a,b,c,d,e,f); //x=(c-b*y)/a+0.00001; printf("%.3lf %.3lf\n",*x,*y); } return 0; }
main.c: In function 'main': main.c:14:43: error: invalid type argument of unary '*' (have 'double') 14 | printf("%.3lf %.3lf\n",*x,*y); | ^~
s585426359
p00004
C
#include <stdio.h> double func(double a ,double b,double c,double d,double e,double f){ return (c*d-a*f)/(b*d-a*e); } int main(void){ 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=func(a,b,c,d,e,f); x=(c-b*y)/a; //func(a,b,c,d,e,f,x,y); printf("%.3lf %.3lf\n",*x,*y); } return 0; }
main.c: In function 'main': main.c:13:40: error: invalid type argument of unary '*' (have 'double') 13 | printf("%.3lf %.3lf\n",*x,*y); | ^~ main.c:13:43: error: invalid type argument of unary '*' (have 'double') 13 | printf("%.3lf %.3lf\n",*x,*y); | ^~
s148108360
p00004
C
#include <stdio.h> int main(int argc, const char * argv[]) { double a, b, c, d, e, f; double x, y; while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != -1) { if (-1000 > a || a < 1000 || -1000 > b || b < 1000 || -1000 > c || c < 1000 || -1000 > d || d < 1000 || -1000 > e || e < 1000 || ||-1000 > f || f < 1000) { exit(0); } x = (c*e-b*f)/(a*e-b*d); y = (c*d-a*f)/(b*d-a*e); printf("%.3lf %.3lf", x, y); } return 0; }
main.c: In function 'main': main.c:8:138: error: expected expression before '||' token 8 | if (-1000 > a || a < 1000 || -1000 > b || b < 1000 || -1000 > c || c < 1000 || -1000 > d || d < 1000 || -1000 > e || e < 1000 || ||-1000 > f || f < 1000) { | ^~ main.c:9:13: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 9 | exit(0); | ^~~~ main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit' 1 | #include <stdio.h> +++ |+#include <stdlib.h> 2 | main.c:9:13: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 9 | exit(0); | ^~~~ main.c:9:13: note: include '<stdlib.h>' or provide a declaration of 'exit'
s771967946
p00004
C++
#include<iostream> #include<cmath> #include<string> int main(int, char**) { double a, b, c, d, e, f = 0; while (std::cin >> a >> b >> c >> d >> e >> f) { double y = (c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e)); printf_s("%.3f %.3f\n", ((c - f) - (b - e) * y) / (a - d), y); } }
a.cc: In function 'int main(int, char**)': a.cc:11:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'? 11 | printf_s("%.3f %.3f\n", ((c - f) - (b - e) * y) / (a - d), y); | ^~~~~~~~ | printf
s088769076
p00004
C++
#include<iostream> #include<cmath> #include<string> int main(int, char**) { double a, b, c, d, e, f = 0; while (std::cin >> a >> b >> c >> d >> e >> f) { double y = (c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e)); printf_s("%.3f %.3f\n", ((c - f) - (b - e) * y) / (a - d), y); } }
a.cc: In function 'int main(int, char**)': a.cc:11:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'? 11 | printf_s("%.3f %.3f\n", ((c - f) - (b - e) * y) / (a - d), y); | ^~~~~~~~ | printf
s509253494
p00004
C++
#include<iostream> int main(int, char**) { double a, b, c, d, e, f = 0; while (std::cin >> a >> b >> c >> d >> e >> f) { double y = std::roundl((c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e)) * 1000.0) / 1000.0; double x = std::roundl(((c - f) - (b - e) * y) / (a - d) * 1000.0) / 1000.0; printf("%.3f %.3f\n", x + 0, y + 0); } }
a.cc: In function 'int main(int, char**)': a.cc:8:33: error: 'roundl' is not a member of 'std' 8 | double y = std::roundl((c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e)) * 1000.0) / 1000.0; | ^~~~~~ a.cc:9:33: error: 'roundl' is not a member of 'std' 9 | double x = std::roundl(((c - f) - (b - e) * y) / (a - d) * 1000.0) / 1000.0; | ^~~~~~
s190980864
p00004
C++
#include<cmath #include<iostream> int main(int, char**) { double a, b, c, d, e, f = 0; while (std::cin >> a >> b >> c >> d >> e >> f) { double y = std::roundl((c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e)) * 1000.0) / 1000.0; double x = std::roundl(((c - f) - (b - e) * y) / (a - d) * 1000.0) / 1000.0; printf("%.3f %.3f\n", x + 0, y + 0); } }
a.cc:1:15: error: missing terminating > character 1 | #include<cmath | ^
s658367747
p00004
C++
using System; // ガウス・ジョルダン法 // https://www.mk-mode.com/blog/2013/09/20/cpp-simultaneous-equation-by-gauss-jorden/# namespace Prob0004 { class Program { static void Main(string[] args) { const int COLUMN = 2; const int ROW = 3; string line; while((line = Console.ReadLine()) != null) { // a[0][0]x + a[0][1]y = a[0][2] // a[1][0]x + a[1][1]y = a[1][2] string[] tokens = line.Split(' '); double[,] a = new double[COLUMN, ROW]; for(int y = 0; y < COLUMN; y++) { for (int x = 0; x < ROW; x++) { a[y, x] = double.Parse(tokens[y * ROW + x]); } } for(int y = 0; y < COLUMN; y++) { for (int x = 0; x < ROW; x++) { Console.Write("{0} ", a[y, x]); } Console.WriteLine(""); } // pivot = (p, p) double coef; for (int p = 0; p < ROW - 1; p++) { // ピボットのある行要素への処理 coef = a[p, p]; for (int x = p; x < ROW; x++) { a[p, x] /= coef; } // ピボット以外の行要素への処理 for (int y = 0; y < COLUMN; y++) { if(p == y) { continue; } coef = a[y, p]; for (int x = p; x < ROW; x++) { a[y, x] -= a[p, x] * coef; } } /* Console.WriteLine(""); for (int y = 0; y < COLUMN; y++) { for (int x = 0; x < ROW; x++) { Console.Write("{0} ", a[y, x]); } Console.WriteLine(""); } Console.WriteLine(""); */ } // outputs for (int y = 0; y < COLUMN; y++) { Console.Write("{0} ", a[y, ROW - 1].ToString("F3")); } Console.WriteLine(); } } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:10:26: error: 'string' has not been declared 10 | static void Main(string[] args) | ^~~~~~ a.cc:10:35: error: expected ',' or '...' before 'args' 10 | static void Main(string[] args) | ^~~~ a.cc:95:6: error: expected ';' after class definition 95 | } | ^ | ; a.cc: In static member function 'static void Prob0004::Program::Main(int*)': a.cc:16:13: error: 'string' was not declared in this scope 16 | string line; | ^~~~~~ a.cc:17:20: error: 'line' was not declared in this scope 17 | while((line = Console.ReadLine()) != null) | ^~~~ a.cc:17:27: error: 'Console' was not declared in this scope 17 | while((line = Console.ReadLine()) != null) | ^~~~~~~ a.cc:17:50: error: 'null' was not declared in this scope 17 | while((line = Console.ReadLine()) != null) | ^~~~ a.cc:21:24: error: expected primary-expression before ']' token 21 | string[] tokens = line.Split(' '); | ^ a.cc:22:24: error: expected identifier before ',' token 22 | double[,] a = new double[COLUMN, ROW]; | ^ a.cc:22:24: error: expected ']' before ',' token a.cc:22:23: error: structured binding declaration cannot have type 'double' 22 | double[,] a = new double[COLUMN, ROW]; | ^ a.cc:22:23: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:22:23: error: empty structured binding declaration a.cc:22:27: error: expected initializer before 'a' 22 | double[,] a = new double[COLUMN, ROW]; | ^ a.cc:27:25: error: 'a' was not declared in this scope 27 | a[y, x] = double.Parse(tokens[y * ROW + x]); | ^ a.cc:27:35: error: expected primary-expression before 'double' 27 | a[y, x] = double.Parse(tokens[y * ROW + x]); | ^~~~~~ a.cc:36:47: error: 'a' was not declared in this scope 36 | Console.Write("{0} ", a[y, x]); | ^ a.cc:48:28: error: 'a' was not declared in this scope 48 | coef = a[p, p]; | ^ a.cc:86:43: error: 'a' was not declared in this scope 86 | Console.Write("{0} ", a[y, ROW - 1].ToString("F3")); | ^
s819337258
p00004
C++
#include<iostream> #include<iomanip> using namespace std; int main() { double x, y; double a, b, c, d, e, f; int J = 1; while (J){ J = cin >> a >> b >> c >> d >> e >> f; if ( J == 0) break; y = ((d * c) - (a * f)) / ((b * d) - (e * a)); x = (c - b * y) / a; x *= 10000; x = x + 0.5 - (x < 0); x = (int)x; x /= 10000; y *= 10000; y = y + 0.5 - (y < 0); y = (int)y; y /= 10000; cout << setprecision(4) << showpoint << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:50: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' in assignment 13 | J = cin >> a >> b >> c >> d >> e >> f; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
s915775773
p00004
C++
#include<iostream> #include<iomanip> using namespace std; int main() { double x, y; double a, b, c, d, e, f; int J = 1; while (J){ J = (int)(cin >> a >> b >> c >> d >> e >> f); if (J == 0) break; y = ((d * c) - (a * f)) / ((b * d) - (e * a)); x = (c - b * y) / a; x *= 10000; x = x + 0.5 - (x < 0); x = (int)x; x /= 10000; y *= 10000; y = y + 0.5 - (y < 0); y = (int)y; y /= 10000; cout << setprecision(4) << showpoint << x << " " << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:21: error: invalid cast from type 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to type 'int' 13 | J = (int)(cin >> a >> b >> c >> d >> e >> f); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s273797082
p00004
C++
#include <iostream> #include <iomanip> #include <cstdio> using namespace std; int main() { int a, b, c, d, e, f; cout << showpoint << setprecision(3); while (cin >> a >> b >> c >> d >> e >> f){ double x = ((double)(b*f - c*e)) / (double)(b*d - a*e); double y = ((double)(c*d - a*f)) / (double)(b*d - a*e); printf(".3f .3f", &x, &y) } cout.flush(); }
a.cc: In function 'int main()': a.cc:13:34: error: expected ';' before '}' token 13 | printf(".3f .3f", &x, &y) | ^ | ; 14 | } | ~
s882238251
p00004
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int a, b, c, d, e, f; cout << showpoint << setprecision(3); while (cin >> a >> b >> c >> d >> e >> f){ double x = ((double)(b*f - c*e)) / (double)(b*d - a*e); double y = ((double)(c*d - a*f)) / (double)(b*d - a*e); //cout << x << ' ' << y << "\n"; //cout << ((double)(b*f - c*e)) / (double)(b*d - a*e) << ' ' << ((double)(c*d - a*f)) / (double)(b*d - a*e) << "\n"; printf("%.3f %.3f\n", x, y); } cout.flush(); }
a.cc: In function 'int main()': a.cc:8:30: error: 'setprecision' was not declared in this scope 8 | cout << showpoint << setprecision(3); | ^~~~~~~~~~~~ a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 2 | #include <cstdio> +++ |+#include <iomanip> 3 | using namespace std;
s732201011
p00004
C++
#include<cstdio> int main(void) { int a,b,c,d,e,f; double x,y; while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f))!=EOF) { y=(a*f-d*c)/(-(d*b)+a*e); x=(c-b*y)/a; printf("%.3lf %.3lf\n",x,y); } return 0; } /* ax=c-by ->x=(c-by)/a d((c-by)/a)+ey=f (dc-dby)/a+ey=f (dc-dby)+aey=af -dby+aey=af-dc y(-db+ae)=af-dc ->y=(af-dc)/(-db+ae) */
a.cc: In function 'int main()': a.cc:6:60: error: expected primary-expression before '!=' token 6 | while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f))!=EOF) | ^~
s126360129
p00004
C++
#include <iostream> #include <cstdio> #ifndef repeat #define repeat(i,n) for (int i = 0; i < (n); ++i) #endif #ifndef repeat_from #define repeat_from(i,m,n) for (int i = (m); i < (n); ++i) #endif #ifndef repeat_one #define repeat_one(i,n) for (int i = 1; i <= (n); ++i) #endif #ifndef repeat_rev #define repeat_rev(i,n) for (int i = (n)-1; 0 <= i; --i) #endif #ifndef foreach #define foreach(it, cont) for (typeof(cont.begin()) it = cont.begin(); it != cont.end(); ++it) #endif #include <vector> #include <cmath> #ifndef repeat #define repeat(i,n) for (int i = 0; i < (n); ++i) #endif #ifndef repeat_from #define repeat_from(i,m,n) for (int i = (m); i < (n); ++i) #endif #ifndef repeat_one #define repeat_one(i,n) for (int i = 1; i <= (n); ++i) #endif #ifndef repeat_rev #define repeat_rev(i,n) for (int i = (n)-1; 0 <= i; --i) #endif #ifndef foreach #define foreach(it, cont) for (typeof(cont.begin()) it = cont.begin(); it != cont.end(); ++it) #endif #ifndef LIB_DEBUG_HPP #define LIB_DEBUG_HPP #ifdef DEBUG #include <cassert> #define debug(a) a #else #define debug(a) #endif #endif #include <iostream> // a11x1 + a12x2 + ... + a1m-1xm-1 = a1m // a21x1 + a22x2 + ... + a2m-1xm-1 = a2m // ... ... ... // an1x1 + an2x2 + ... + anm-1xm-1 = anm std::vector<double> gaussian_elim(std::vector<std::vector<double> > a) { const int n = a.size(); #ifdef DEBUG assert (0 < n); #endif const int m = a[0].size(); #ifdef DEBUG repeat (i, n) assert ((int)a[i].size() == m); assert (n == m-1); #endif // make an upper diagonal matrix repeat (i, n) { { int pivot = -1; repeat_from (j, i, n) { const double eps = 1e-16; if (eps < std::abs(a[j][i])) { pivot = j; break; } } #ifdef debug assert (pivot != -1); #endif if (pivot != i) std::swap(a[i], a[pivot]); } repeat_from (j, i+1, m) a[i][j] /= a[i][i]; a[i][i] = 1; repeat_from (j, i+1, n) { repeat_from (k, i+1, m) { a[j][k] -= a[j][i] * a[i][k]; } a[j][i] = 0; } } // gather the solutions std::vector<double> result(n); repeat_rev (i, n) { result[i] = a[i][m-1]; repeat_from (j, i+1, n) { result[i] -= a[i][j] * result[j]; } } return result; } using namespace std; int main() { // ax + by = c // dx + ey = f vector<vector<double> > v(2, vector<double>(3)); vector<double> w; while (true) { repeat (i,2) repeat (j,3) cin >> v[i][j]; if (cin.fail()) break; w = gaussian_elim(v); printf("%.3lf %.3lf\n", w[0], w[1]); } return 0; }
a.cc: In function 'std::vector<double> gaussian_elim(std::vector<std::vector<double> >)': a.cc:69:13: error: 'assert' was not declared in this scope 69 | assert (pivot != -1); | ^~~~~~ a.cc:20:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 19 | #include <cmath> +++ |+#include <cassert> 20 | #ifndef repeat
s415730743
p00004
C++
using namespace std; int main(void){ int a,b,c,d,e,f; double x,y; while( cin>>a >>b >>c >>d >>e >>f){ x =(double) (e*c-b*f)/(a*e-b*d); y =(double) (a*f-d*c)/(a*e-b*d); if(x==0) x=0; if(y==0) y=0; printf("%.3f %.3f\n",x,y); } }
a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | 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:11:5: error: 'printf' was not declared in this scope 11 | printf("%.3f %.3f\n",x,y); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | using namespace std;
s351891037
p00004
C++
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) x = (c * e - b * f)/(a * e - b * d) y = (a * f - c * d)/(a * e - b * d) print '%f %f' % (x, y)
a.cc:8:11: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 8 | print '%f %f' % (x, y) | ^~~~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s354926497
p00004
C++
#include <iostream> #include <iomanip> using namespace std; 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 = (c*d - a*f) / (b*d - a*e); if( fabs(x) < 0.0005 ) x = 0.0; if( fabs(y) < 0.0005 ) y = 0.0; cout << fixed << std::setprecision(3) << x << " " << y << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:10:21: error: 'fabs' was not declared in this scope; did you mean 'labs'? 10 | if( fabs(x) < 0.0005 ) x = 0.0; | ^~~~ | labs a.cc:11:21: error: 'fabs' was not declared in this scope; did you mean 'labs'? 11 | if( fabs(y) < 0.0005 ) y = 0.0; | ^~~~ | labs
s492779244
p00004
C++
#include<queue> #include<stack> #include<cstdio> using namespace std; double a,b,c,d,e,f,x,y; int main(){ while(cin>>a>>b>>c>>d>>e>>f){ x=(c*e-f*b)/(a*e-d*b); y=(c-a*x)/b; printf("%.3f %.3f\n",x+(1e-10),y+(1e-10)); } return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: 'cin' was not declared in this scope 7 | while(cin>>a>>b>>c>>d>>e>>f){ | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<cstdio> +++ |+#include <iostream> 4 | using namespace std;
s338667327
p00004
C++
#include <iostream> using namespace std; int main(){ float a,b,c,d,e,f; float 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:7:16: error: expected primary-expression before '>>' token 7 | while(cin >> >> a >> b >> c >> d >> e >> f){ | ^~
s066815990
p00004
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define it ::iterator #define all(in) in.begin(),in.end() const double PI=acos(-1); const double ESP=1e-10; using namespace std; int main(){ double a,b,c,d,e,f; while(cin>>a>>b>>c>>d>>e>>f){ double x=(c*e-b*f)/(a*e-b*d); double y=(c-a*x)/b; if( printf("%.3f %.3f\n",x,y); } }
a.cc: In function 'int main()': a.cc:26:3: error: expected primary-expression before '}' token 26 | } | ^ a.cc:25:31: error: expected ')' before '}' token 25 | printf("%.3f %.3f\n",x,y); | ^ | ) 26 | } | ~ a.cc:24:7: note: to match this '(' 24 | if( | ^ a.cc:26:3: error: expected primary-expression before '}' token 26 | } | ^
s895257228
p00004
C++
module Input def numread() s = gets().split() p = Array.new() for i in 0...s.size() p[i] = s[i].to_i() end return p end module_function:numread end include Input loop{ if(STDIN.eof()) break end w = numread() x = (w[2] * w[4] - w[1] * w[5]).to_f / (w[0] * w[4] - w[1] * w[3]) y = (w[2] * w[3] - w[0] * w[5]).to_f / (w[1] * w[3] - w[0] * w[4]) print(sprintf("%.3f %.3f\n",x,y)) }
a.cc:5:26: error: too many decimal points in number 5 | for i in 0...s.size() | ^~~~~~~~~~ a.cc:1:1: error: 'module' does not name a type 1 | module Input | ^~~~~~ a.cc:1:1: note: C++20 'module' only available with '-fmodules-ts'
s504962544
p00004
C++
#include <stdio.h> #include <math.h> int main(){ double a,b,c,e,f,y,x; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ y=((c*e)-(a*f))/((b*d)-(a*e)); x=(c*e)-(b*f)/((a*e)-(b*d)); printf("%.3lf %.3lf\n", x,y); } return 0; }
a.cc: In function 'int main()': a.cc:5:44: error: 'd' was not declared in this scope 5 | while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ | ^
s478082847
p00004
C++
#include <stdio.h> #include <math.h> int main(){ double a,b,c,d,e,f,y[10000],x[10000]; int i=0,n; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ y[i]=((c*d)-(a*f))/((b*d)-(a*e)); x[i]=((c*e)-(b*f))/((a*e)-(b*d)); i++; } n=i; for(i=0;i < n; i++){ if(x == 0){x = 0;} if(y == 0){y = 0;} printf("%.3lf %.3lf\n", x[i],y[i]); } return 0; }
a.cc: In function 'int main()': a.cc:13:16: error: incompatible types in assignment of 'int' to 'double [10000]' 13 | if(x == 0){x = 0;} | ~~^~~ a.cc:14:16: error: incompatible types in assignment of 'int' to 'double [10000]' 14 | if(y == 0){y = 0;} | ~~^~~
s700170436
p00004
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ double a,b,c,d,e,f,y[10000],x[10000]; int i=0,n; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ y[i]=((c*d)-(a*f))/((b*d)-(a*e)); x[i]=((c*e)-(b*f))/((a*e)-(b*d)); i++; } n=i; for(i=0;i < n; i++){ if(x == 0){x = 0;} if(y == 0){y = 0;} printf("%.3lf %.3lf\n", x[i],y[i]); } return 0; }
a.cc: In function 'int main()': a.cc:14:16: error: incompatible types in assignment of 'int' to 'double [10000]' 14 | if(x == 0){x = 0;} | ~~^~~ a.cc:15:16: error: incompatible types in assignment of 'int' to 'double [10000]' 15 | if(y == 0){y = 0;} | ~~^~~
s868967948
p00004
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ double a,b,c,d,e,f,y[1000],x[1000]; int i=0,n; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ y[i]=((c*d)-(a*f))/((b*d)-(a*e)); x[i]=((c*e)-(b*f))/((a*e)-(b*d)); i++; } n=i; for(i=0;i < n; i++){ if(x == 0){x = 0;} if(y == 0){y = 0;} printf("%.3lf %.3lf\n", x[i],y[i]); } return 0; }
a.cc: In function 'int main()': a.cc:14:16: error: incompatible types in assignment of 'int' to 'double [1000]' 14 | if(x == 0){x = 0;} | ~~^~~ a.cc:15:16: error: incompatible types in assignment of 'int' to 'double [1000]' 15 | if(y == 0){y = 0;} | ~~^~~
s492290961
p00004
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ double a,b,c,d,e,f,y,x; int i=0,n; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ y=((c*d)-(a*f))/((b*d)-(a*e)); x=((c*e)-(b*f))/((a*e)-(b*d)); if(x == 0){x = 0;} if(y == 0){y = 0;} printf("%.3lf %.3lf\n", x,y); } i++; } return 0; }
a.cc:16:3: error: expected unqualified-id before 'return' 16 | return 0; | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s486214465
p00004
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ double a,b,c,d,e,f,y,x; int i=0,n; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) != EOF){ y=((c*d)-(a*f))/((b*d)-(a*e)); x=((c*e)-(b*f))/((a*e)-(b*d)); if(x == 0){x = 0;} if(y == 0){y = 0;} printf("%.3lf %.3lf\n", x,y); } i++; } return 0; }
a.cc:16:3: error: expected unqualified-id before 'return' 16 | return 0; | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s415741036
p00004
C++
#include <iostream> #include <cstdio> #include <vector> int main() { std::vector<int> x, y; int a, b, c, d, p, q; while (scanf_s("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF) { x.push_back(d*p - b*q / (a*d - b*c)); y.push_back(p*c - a*q / (b*c - a*d)); } for (int i = 0; i < x.size(); ++i) std::cout << x[i] << " " << y[i] << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while (scanf_s("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF) | ^~~~~~~ | scanf
s770342694
p00004
C++
#include <iostream> #include <cstdio> #include <vector> int main() { std::vector<int> x, y; int a, b, c, d, p, q; while (scanf_s("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF) { x.push_back(d*p - b*q / (a*d - b*c)); y.push_back(p*c - a*q / (b*c - a*d)); } for (int i = 0; i < x.size(); ++i) std::cout << x[i] << " " << y[i] << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while (scanf_s("%d %d %d %d %d %d", &a, &b, &p, &c, &d, &q) != EOF) | ^~~~~~~ | scanf
s703285238
p00004
C++
include <stdio.h> int main() { 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 = (a*f-c*d)/(a*e-b*d); printf("%.3lf %.3lf\n", x, y); } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~
s153745130
p00004
C++
package task0004; import java.util.Scanner; public class Main { void run() { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { double a = sc.nextInt(); double b = sc.nextInt(); double c = sc.nextInt(); double d = sc.nextInt(); double e = sc.nextInt(); double f = sc.nextInt(); // 連立方程式の解 double x = (b * f - c * e) / (b * d - a * e); double y = (c * d - a * f) / (b * d - a * e); if (x == 0) x = 0; if (y == 0) y = 0; System.out.printf("%.3f %.3f\n", x, y); // BigDecimal ax = new BigDecimal(x); // BigDecimal ay = new BigDecimal(y); // // // 小数第4位を四捨五入 // ax = ax.setScale(3, BigDecimal.ROUND_HALF_UP); // ay = ay.setScale(3, BigDecimal.ROUND_HALF_UP); // // System.out.println(ax + " " + ay); } sc.close(); } void run1() { Scanner sc = new Scanner(System.in); double[] a = new double[6]; while (sc.hasNext()) { for (int i = 0; i < 6; i++) { a[i] = sc.nextDouble(); } double d = a[0] * a[4] - a[1] * a[3]; double x = (a[4] * a[2] - a[1] * a[5]) / d; double y = (a[0] * a[5] - a[3] * a[2]) / d; if (x == 0) x = 0; if (y == 0) y = 0; System.out.printf("%.3f %.3f", x, y); } sc.close(); } public static void main(String[] args) { new Main().run1(); } }
a.cc:1:1: error: 'package' does not name a type 1 | package task0004; | ^~~~~~~ a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Scanner; | ^~~~~~ 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 { | ^~~~~~
s888780805
p00004
C++
#include<iostream> #include<iomanip> using namespace std; int main(){ double a11,a12,c,a21,a22,f; while(cin>>a11>>a12>>c>>a21>>a22>>f){ double x,y,delta=((double)a11*a22-(double)a12*a21); x=((double)a22*c-(double)a12*f)/delta; y=((double)a11*f-(double)c*a21)/delta; if(x>0){x=(double)(((int)((x*1000)+0.5))/1000); }else if{x=(double)(((int)((x*1000)-0.5))/1000);}else{x=0;} if(y>0){y=(double)(((int)((y*1000)+0.5))/1000); }else if{y=(double)(((int)((y*1000)-0.5))/1000);}else{y=0;} cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:25: error: expected '(' before '{' token 12 | }else if{x=(double)(((int)((x*1000)-0.5))/1000);}else{x=0;} | ^ | ( a.cc:12:66: error: 'else' without a previous 'if' 12 | }else if{x=(double)(((int)((x*1000)-0.5))/1000);}else{x=0;} | ^~~~ a.cc:14:25: error: expected '(' before '{' token 14 | }else if{y=(double)(((int)((y*1000)-0.5))/1000);}else{y=0;} | ^ | ( a.cc:14:66: error: 'else' without a previous 'if' 14 | }else if{y=(double)(((int)((y*1000)-0.5))/1000);}else{y=0;} | ^~~~
s185030721
p00004
C++
#include<stdio.h> int main(){ double a,b,c,d,e,f,x,y,dd; y=0;x=0; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){ dd=e*a-b*d; if(dd!=0;){ y=(d*c-a*f)/(b*d-a*e); x=(e*c-b*f)/(e*a-b*d); x=(x==fabs(x))?fabs(x):x; y=(y==fabs(y))?fabs(y):y; printf("%.3f %.3f\n",x,y); } } return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: expected primary-expression before ')' token 8 | if(dd!=0;){ | ^ a.cc:11:7: error: 'fabs' was not declared in this scope 11 | x=(x==fabs(x))?fabs(x):x; | ^~~~
s789643354
p00004
C++
import java.text.DecimalFormat; import java.util.Scanner; class Main { public static void main(String[] args){ Scanner scan = new Scanner(System.in); double a = Double.parseDouble(scan.next()); double b = Double.parseDouble(scan.next()); double c = Double.parseDouble(scan.next()); double d = Double.parseDouble(scan.next()); double e = Double.parseDouble(scan.next()); double f = Double.parseDouble(scan.next()); DecimalFormat df = new DecimalFormat("0.000"); double x =(c*e-b*f)/(a*e-b*d); double y = (a*f-c*d)/(a*e-b*d); x = Math.floor((x+0.5)*1000)/1000; x = Math.ceil((x-0.5)*1000)/1000; y = Math.floor((y+0.5)*1000)/1000; y = Math.ceil((y-0.5)*1000)/1000; System.out.println(df.format(x)+" "+df.format(y) ); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.text.DecimalFormat; | ^~~~~~ 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.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:7: error: expected ':' before 'static' 5 | public static void main(String[] args){ | ^~~~~~~ | : a.cc:5:25: error: 'String' has not been declared 5 | public static void main(String[] args){ | ^~~~~~ a.cc:5:34: error: expected ',' or '...' before 'args' 5 | public static void main(String[] args){ | ^~~~ a.cc:25:2: error: expected ';' after class definition 25 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:6:9: error: 'Scanner' was not declared in this scope 6 | Scanner scan = new Scanner(System.in); | ^~~~~~~ a.cc:7:20: error: 'Double' was not declared in this scope; did you mean 'double'? 7 | double a = Double.parseDouble(scan.next()); | ^~~~~~ | double a.cc:7:39: error: 'scan' was not declared in this scope 7 | double a = Double.parseDouble(scan.next()); | ^~~~ a.cc:13:9: error: 'DecimalFormat' was not declared in this scope 13 | DecimalFormat df = new DecimalFormat("0.000"); | ^~~~~~~~~~~~~ a.cc:16:13: error: 'Math' was not declared in this scope 16 | x = Math.floor((x+0.5)*1000)/1000; | ^~~~ a.cc:21:9: error: 'System' was not declared in this scope 21 | System.out.println(df.format(x)+" "+df.format(y) ); | ^~~~~~ a.cc:21:28: error: 'df' was not declared in this scope; did you mean 'f'? 21 | System.out.println(df.format(x)+" "+df.format(y) ); | ^~ | f
s963301811
p00004
C++
#include <cstdio> using namespace std; int main() { 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) { y = (c*d-f*a) / (b*d-e*a); if (isnan(y)) y=0; x = (c-b*y) / a; if (isnan(x)) x=0; printf("%.3f %.3f\n", x, y); } }
a.cc: In function 'int main()': a.cc:10:13: error: 'isnan' was not declared in this scope 10 | if (isnan(y)) y=0; | ^~~~~ a.cc:12:13: error: 'isnan' was not declared in this scope 12 | if (isnan(x)) x=0; | ^~~~~
s258550098
p00004
C++
int main(void){ double a,b,c,d,e,f,i,j,x,y; while (scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF) { i=(c*e-f*b)/(a*e-d*b); j=(c*d-f*a)/(b*d-e*a); x=i+0.0005; y=j+0.0005; printf("%.3f %.3f\n",x,y); return 0; }
a.cc: In function 'int main()': a.cc:3:8: error: 'scanf' was not declared in this scope 3 | while (scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF) { | ^~~~~ a.cc:3:56: error: 'EOF' was not declared in this scope 3 | while (scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF) { | ^~~ a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(void){ a.cc:8:1: error: 'printf' was not declared in this scope 8 | printf("%.3f %.3f\n",x,y); | ^~~~~~ a.cc:8:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:10:2: error: expected '}' at end of input 10 | } | ^ a.cc:1:15: note: to match this '{' 1 | int main(void){ | ^
s463679628
p00004
C++
#include<iostream> #include<cstdio> using namespace std; double A,B,C,D,E,F; int main() { while(cin >> A >> B >> C >> D >> E >> F){ printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); } return 0; }
a.cc: In function 'int main()': a.cc:8:25: error: 'c' was not declared in this scope 8 | printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); | ^ a.cc:8:27: error: 'e' was not declared in this scope 8 | printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); | ^ a.cc:8:29: error: 'b' was not declared in this scope 8 | printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); | ^ a.cc:8:31: error: 'f' was not declared in this scope 8 | printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); | ^ a.cc:8:35: error: 'a' was not declared in this scope 8 | printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); | ^ a.cc:8:39: error: 'd' was not declared in this scope 8 | printf("%.3f %.3f\n",(c*e-b*f)/(a*e-d*b),(c*d-f*a)/(b*d-a*e)); | ^
s610060839
p00004
C++
#include <iostream> #include <iomanip> using namespace std; float a,b,c,d,e,f; float findoutx,findouty; float x,y,yadd; float Timers1,Timers2; int main() { while((cin >> a >> b >> c >> d >> e >> f)!=EOF) { Timers1 = a; Timers2 = d; a=a*Timers2; b=b*Timers2; c=c*Timers2; d=d*Timers1; e=e*Timers1; f=f*Timers1; findouty=b-e; yadd = c-f; findouty = yadd/findouty; b = b*findouty; findoutx=(c-b)/a; if(findoutx==0)findoutx=0; if(findouty==0)findouty=0; cout<<fixed<<setprecision(3)<<findoutx << " "<<findouty<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:46: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:11:46: note: candidate: 'operator!=(int, int)' (built-in) 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^ a.cc:11:46: 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/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h: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/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/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/string:48: /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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | 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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | 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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | 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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | 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/string: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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:11:48: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:11:48: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/
s904344991
p00004
C++
#include <iostream> #include <iomanip> #include <algorithm> using namespace std; float a,b,c,d,e,f; float findoutx,findouty; float x,y,yadd; float Timers1,Timers2; int main() { while((cin >> a >> b >> c >> d >> e >> f)!=EOF) { Timers1 = a; Timers2 = d; a=a*Timers2; b=b*Timers2; c=c*Timers2; d=d*Timers1; e=e*Timers1; f=f*Timers1; findouty=b-e; yadd = c-f; findouty = yadd/findouty; b = b*findouty; findoutx=(c-b)/a; if(findoutx==0)findoutx=0; if(findouty==0)findouty=0; cout<<fixed<<setprecision(3)<<findoutx << " "<<findouty<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:46: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:11:46: note: candidate: 'operator!=(int, int)' (built-in) 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^ a.cc:11:46: 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/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h: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/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/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/string:48: /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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | 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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | 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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | 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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | 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/string: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:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:11:48: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:11:48: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:11:48: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF) | ^~~ In file included from /usr/include/c++/14/
s204554495
p00004
C++
#include <iostream> #include <array> #include <vector> #include <cmath> #include <iomanip> using namespace std; //?????¨?????\ double round_four(double value){ value *= 1000; value += (value / fabs(value)) * 0.5; int nValue = static_cast<int>(value); value = static_cast<double>(nValue) / 1000; return value; } //????¬?????¨?????§£ array<double, 2> comp_linear_equation(int a, int b, int c, int d, int e, int f){ array<double, 2> result; result[0] = static_cast<double>(e * c - (f * b)); result[1] = static_cast<double>(-(d * c) + a * f); double num = 1.0 / ((a * e) - (b * d)); result[0] *= num; result[1] *= num; result[0] = round_four(result[0]); result[1] = round_four(result[1]); return result; } //????????? int main(){ int a, b, c, d, e, f; vector<array<double, 2>> result; while (cin >> a >> b >> c >> d >> e >> f){ result.push_back(comp_linear_equation(a, b, c, d, e, f)); } for (const auto& element : result){ for (auto num : element){ cout << fixed << setprecision(3) << num << " "; } cout << endl; } return 0; }
a.cc:11:5: error: 'value' does not name a type 11 | value *= 1000; | ^~~~~ a.cc:12:5: error: 'value' does not name a type 12 | value += (value / fabs(value)) * 0.5; | ^~~~~ a.cc:13:35: error: 'value' was not declared in this scope; did you mean 'nValue'? 13 | int nValue = static_cast<int>(value); | ^~~~~ | nValue a.cc:14:5: error: 'value' does not name a type 14 | value = static_cast<double>(nValue) / 1000; | ^~~~~ a.cc:15:5: error: expected unqualified-id before 'return' 15 | return value; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^ a.cc: In function 'std::array<double, 2> comp_linear_equation(int, int, int, int, int, int)': a.cc:26:17: error: 'round_four' was not declared in this scope 26 | result[0] = round_four(result[0]); | ^~~~~~~~~~
s130817449
p00004
C++
#include <iostream> #include <cstdio> #define N 2 using namespace std; class Calc{ public: double A[N][N+1]; int i, j, k; void calcSi(); void printSi(); } void Calc::calcSi(){ for(i=0;i<N-1;i++){ for(j=i+1;j<N;j++){ int tmp = A[j][i] / A[i][i]; for(k=i+1; k<=N; k++) A[j][k] -= A[i][k] * tmp; } } for(i=N-1; i>=0; i--){ tmp = A[i][N]; for(j=i+1;j<N;j++) tmp -= A[i][j] * A[j][N]; A[i][N] = tmp / A[i][i]; } } void Calc::printSi(){ for(i=0;i<N;i++){ printf("%.3f",A[i][N]); if(i != N) { cout << " "; } } cout << endl; } int main(void){ Calc c; int i; while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) { c.calcSi(); c.printSi(); } return 0; }
a.cc:13:2: error: expected ';' after class definition 13 | } | ^ | ; a.cc: In member function 'void Calc::calcSi()': a.cc:25:9: error: 'tmp' was not declared in this scope; did you mean 'tm'? 25 | tmp = A[i][N]; | ^~~ | tm a.cc: In function 'int main()': a.cc:45:16: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'double') 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ~~~~ ^~ ~~~~~~~~~ | | | | | double | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ 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:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:45:11: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:45:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = double&]': a.cc:45:27: required from here 45 | while(cout >> c.A[0][0] >> c.A[0][1] >> c.A[0][2] >> c.A[1][0] >> c.A[1][1] >> c.A[1][2]) | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s930165571
p00004
C++
#include <iostream> #include <cstdio> #define N 2 using namespace std; class Calc{ private: double A[N][N+1]; int i, j, k; double tmp; public: void setNum(double**); void calcSi(); void printSi(); }; void Calc::setNum(double** A){ for(i=0;i<N;i++){ for(j=0;j<N+1;j++){ this->A[i][j] = A[i][j]; } } } void Calc::calcSi(){ for(i=0;i<N-1;i++){ for(j=i+1;j<N;j++){ tmp = A[j][i] / A[i][i]; for(k=i+1; k<=N; k++) A[j][k] -= A[i][k] * tmp; } } for(i=N-1; i>=0; i--){ tmp = A[i][N]; for(j=i+1;j<N;j++) tmp -= A[i][j] * A[j][N]; A[i][N] = tmp / A[i][i]; } } void Calc::printSi(){ for(i=0;i<N;i++){ printf("%.3f",A[i][N]); if(i != N) { cout << " "; } } cout << endl; } int main(void){ Calc c; double A[N][N+1]; while(cin >> A[0][0] >> A[0][1] >> A[0][2] >> A[1][0] >> A[1][1] >> A[1][2]){ c.setNum(A); c.calcSi(); c.printSi(); } return 0; }
a.cc: In function 'int main()': a.cc:56:18: error: cannot convert 'double [2][3]' to 'double**' 56 | c.setNum(A); | ^ | | | double [2][3] a.cc:17:28: note: initializing argument 1 of 'void Calc::setNum(double**)' 17 | void Calc::setNum(double** A){ | ~~~~~~~~~^
s572929741
p00004
C++
require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(z){i=z.split(' ');console.log(x=((i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])).toFixed(3),((i[2]-i[0]*x)/i[1]).toFixed(3))})
a.cc:1:8: error: expected constructor, destructor, or type conversion before '(' token 1 | require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(z){i=z.split(' ');console.log(x=((i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])).toFixed(3),((i[2]-i[0]*x)/i[1]).toFixed(3))}) | ^ a.cc:1:203: error: expected unqualified-id before ')' token 1 | require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(z){i=z.split(' ');console.log(x=((i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])).toFixed(3),((i[2]-i[0]*x)/i[1]).toFixed(3))}) | ^
s008927566
p00004
C++
#include <iostream> #include <cstdio> using namespace std; int main(){ double a , b , c , d , e , f ,ans1 , ans2; while(cin>>a>>b>>c>>d>>e>>f){ ans1=(double)((c*e-b*f)/(a*e-b*d)); ans2=(double)((c*d-a*f)/(b*d-a*e)); if (x==0) x=0; if (y==0) y=0; printf("%.3f %.3f\n" , ans1 , ans2); } return 0; }
a.cc: In function 'int main()': a.cc:10:21: error: 'x' was not declared in this scope 10 | if (x==0) x=0; | ^ a.cc:11:21: error: 'y' was not declared in this scope 11 | if (y==0) y=0; | ^
s813219757
p00004
C++
#include <math.h> #include <iostream> #include <ios> #include <iomanip> #include <algorithm> #include <functional> #include <string> #define YES "YES" #define NO "NO" #define space ' ' using namespace std; void func(); int main(void) { func(); return 0; } // using matrix ?????????????????´?????? void func() { int a, b, c, d, e, f; double x, y; while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()){ // if ((a*e - d*b) == 0) { // cout << 0 << space << 0 << endl; } else { x = (e*c - b*f) / (a*e - d*b); y = (-d*c + a*f) / (a*e - d*b); cout << fixed << setprecision(3); cout << x*0.0005 << space << y+0.0005 << endl; cout << dec; } } }
a.cc: In function 'void func()': a.cc:38:17: error: 'else' without a previous 'if' 38 | else | ^~~~
s108665222
p00004
C++
#include <iostream> using namespace std; int main() { float a,b,c,d,e,f,x,y=0; while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ x = (c*e - b*f)/(a*e - b*d); y = (c*d - a*f)/(b*d - a*e); printf("%.3f %.3f\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:8:50: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:8:50: note: candidate: 'operator!=(int, int)' (built-in) 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^ a.cc:8:50: 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/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h: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/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/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ In file included from /usr/include/c++/14/string:48: /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:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | 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:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | 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:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | 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:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | 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/string: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:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:8:52: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:8:52: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:8:52: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:8:52: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 8 | while((cin >> a >> b >> c >> d >> e >> f)!=EOF){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:8:52: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 8 | while((cin >> a >> b >> c >
s322446223
p00004
C++
#include<iostream> #include<cstdio> /* * Wrong Answer * 2015-06-26 02:00 */ int main(void) { int a. b. c. d. e. f; double x, y; while( std::cin >> a >> b >> c >> d >> e >> f ){ y = ( a * f - c * d ) / ( a * e - b * d ); x = ( c - b * y ) / a; printf("%.3f %.3f\n", x, y ); } return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: expected initializer before '.' token 11 | int a. b. c. d. e. f; | ^ a.cc:14:28: error: 'a' was not declared in this scope 14 | while( std::cin >> a >> b >> c >> d >> e >> f ){ | ^ a.cc:14:33: error: 'b' was not declared in this scope 14 | while( std::cin >> a >> b >> c >> d >> e >> f ){ | ^ a.cc:14:38: error: 'c' was not declared in this scope 14 | while( std::cin >> a >> b >> c >> d >> e >> f ){ | ^ a.cc:14:43: error: 'd' was not declared in this scope 14 | while( std::cin >> a >> b >> c >> d >> e >> f ){ | ^ a.cc:14:48: error: 'e' was not declared in this scope 14 | while( std::cin >> a >> b >> c >> d >> e >> f ){ | ^ a.cc:14:53: error: 'f' was not declared in this scope 14 | while( std::cin >> a >> b >> c >> d >> e >> f ){ | ^
s929745264
p00004
C++
int main(){ float a,b,c,d,e,f,x,y; while(scanf("%f",&a)){ scanf("%f%f%f%f%f",&b,&c,&d,&e,&f); x=(c*e-b*f)/(a*e-b*d); y=(c*d-a*f)/(b*d-a*e); printf("%.3f %.3f",x,y); std::cout<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:3:15: error: 'scanf' was not declared in this scope 3 | while(scanf("%f",&a)){ | ^~~~~ a.cc:7:9: error: 'printf' was not declared in this scope 7 | printf("%.3f %.3f",x,y); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(){ a.cc:8:14: error: 'cout' is not a member of 'std' 8 | std::cout<<std::endl; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int main(){ a.cc:8:25: error: 'endl' is not a member of 'std' 8 | std::cout<<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 | int main(){
s385285737
p00004
C++
#include<iostream> #include<iomanip> int main(){ float a, b, c, d, e, f; float x, y; while (std::cin >> a >> b >> c >> d >> e >> f){ if (a*d<0){ d = -d; e = -e; f = -f; } x = (c - b*(c - f*a / d) / (b - e*a / d)) / a; y = (c - f*a / d) / (b - e*a / d); if (x == 0)x = 0; if (y == 0)y = 0; x = round(x); y = round(y); std::cout<<std::fixed<<std::setprecision(4) << x << " " << y << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:21: error: 'round' was not declared in this scope 17 | x = round(x); | ^~~~~
s117432345
p00004
C++
#include<iostream> #include<iomanip> #include <math.h> int main(){ float a, b, c, d, e, f; float x, y; while (std::cin >> a >> b >> c >> d >> e >> f){ if (a*d<0){ d = -d; e = -e; f = -f; } x = (c - b*(c - f*a / d) / (b - e*a / d)) / a; y = (c - f*a / d) / (b - e*a / d); if (x == 0)x = 0; if (y == 0)y = 0; round(x, 4); round(y, 4); std::cout<<std::fixed<<std::setprecision(4) << x << " " << y << std::endl; } return 0; } double round(double src, int n){ double dst; dst = src * pow(10, -n - 1); dst = (double)(int)(dst + 0.5); return dst * pow(10, n + 1); }
a.cc: In function 'int main()': a.cc:18:22: error: no matching function for call to 'round(float&, int)' 18 | round(x, 4); | ~~~~~^~~~~~ In file included from /usr/include/c++/14/math.h:36, from a.cc:3: /usr/include/c++/14/cmath:2699:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::round(_Tp)' 2699 | round(_Tp __x) | ^~~~~ /usr/include/c++/14/cmath:2699:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: candidate: 'double round(double)' 334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); | ^~~~~~~~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/cmath:2691:3: note: candidate: 'constexpr long double std::round(long double)' 2691 | round(long double __x) | ^~~~~ /usr/include/c++/14/cmath:2691:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/cmath:2687:3: note: candidate: 'constexpr float std::round(float)' 2687 | round(float __x) | ^~~~~ /usr/include/c++/14/cmath:2687:3: note: candidate expects 1 argument, 2 provided a.cc:19:22: error: no matching function for call to 'round(float&, int)' 19 | round(y, 4); | ~~~~~^~~~~~ /usr/include/c++/14/cmath:2699:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::round(_Tp)' 2699 | round(_Tp __x) | ^~~~~ /usr/include/c++/14/cmath:2699:5: note: candidate expects 1 argument, 2 provided /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: candidate: 'double round(double)' 334 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); | ^~~~~~~~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:334:1: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/cmath:2691:3: note: candidate: 'constexpr long double std::round(long double)' 2691 | round(long double __x) | ^~~~~ /usr/include/c++/14/cmath:2691:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/cmath:2687:3: note: candidate: 'constexpr float std::round(float)' 2687 | round(float __x) | ^~~~~ /usr/include/c++/14/cmath:2687:3: note: candidate expects 1 argument, 2 provided
s954293414
p00004
C++
#include<iostream> #include<cstdio> using namespace std; 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){ x = (c-b*(c*d-a*f)/(b*d-a*e))/a; y = (c*d-a*f)/(b*d-a*e); if(x == -0)x = 0; if(y == -0)y = 0; pirntf("%3f %3f",x,y); } }
a.cc: In function 'int main()': a.cc:12:5: error: 'pirntf' was not declared in this scope; did you mean 'printf'? 12 | pirntf("%3f %3f",x,y); | ^~~~~~ | printf
s112577034
p00004
C++
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <cassert> #include <iomanip> #define EPS (1e-6) void solveSimultaneousEquation(double a, double b, double c, double d, double e, double f, std::pair<double, double>* pResult) { assert(b * d - a * e != 0); std::pair<double, double>& result = *pResult; result.first = (b * f - c * e) / (b * d - a * e); result.second = (c * d - a * f) / (b * d - a * e); if (fabs(result.first) < EPS) { result.first = 0.0; } if (fabs(result.second) < EPS) { result.first = 0.0; } } int main(void) { double a, b, c, d, e, f; while (std::cin >> a >> b >> c >> d >> e >> f) { std::pair<double, double> result; solveSimultaneousEquation(a, b, c, d, e, f, &result); std::cout << std::fixed << std::setprecision(3) << result.first << " " << result.second << std::endl; } return 0; }
a.cc: In function 'void solveSimultaneousEquation(double, double, double, double, double, double, std::pair<double, double>*)': a.cc:19:7: error: 'fabs' was not declared in this scope; did you mean 'labs'? 19 | if (fabs(result.first) < EPS) { | ^~~~ | labs a.cc:22:7: error: 'fabs' was not declared in this scope; did you mean 'labs'? 22 | if (fabs(result.second) < EPS) { | ^~~~ | labs
s138652878
p00004
C++
#include <cstdio> #include <iostream> using namespace std; int main(){ double x,y,a,b,c,d,e,f; while(){ cin>>a>>b>>c>>d>>e>>f; if(a=="\n") break; x=(c*e-f*b)/(a*e-d*b); y=(a*f-d*c)/(a*e-d*b); printf("%.3lf %.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: expected primary-expression before ')' token 8 | while(){ | ^ a.cc:10:7: error: invalid operands of types 'double' and 'const char [2]' to binary 'operator==' 10 | if(a=="\n") break; | ~^~~~~~ | | | | | const char [2] | double
s676539222
p00004
C++
#include <cstdio> #include <iostream> using namespace std; int main(){ double x,y,a,b,c,d,e,f; while(1){ cin>>a>>b>>c>>d>>e>>f; if(a=="\n") break; x=(c*e-f*b)/(a*e-d*b); y=(a*f-d*c)/(a*e-d*b); printf("%.3lf %.3lf\n",x,y); } return 0; }
a.cc: In function 'int main()': a.cc:10:7: error: invalid operands of types 'double' and 'const char [2]' to binary 'operator==' 10 | if(a=="\n") break; | ~^~~~~~ | | | | | const char [2] | double
s248216108
p00004
C++
#include<stdio.h> int main(void){ double a, b, c,d,e,f,x,y; while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)\=EOF){ y=(a*f-c)/(e-d*b); x=(f-e*y)/a; printf("%-3f %-3f", x, y); } return 0; }
a.cc:6:51: error: stray '\' in program 6 | while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)\=EOF){ | ^ a.cc: In function 'int main()': a.cc:6:12: error: lvalue required as left operand of assignment 6 | while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)\=EOF){ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s543178957
p00004
C++
from sympy import * a, b, c, d, e, f = map(int, raw_input().strip().split(' ')) x, y = symbols('x y') # ax + by = c # dx + ey = f res = solve((a*x+b*y - c , d*x+e*y - f), x, y) x = res[x] y = res[y] x = float(str(x)) y = float(str(y)) print "%.3f %.3f" % (x, y)
a.cc:5:16: warning: multi-character character constant [-Wmultichar] 5 | x, y = symbols('x y') | ^~~~~ a.cc:7:3: error: invalid preprocessing directive #ax 7 | # ax + by = c | ^~ a.cc:8:3: error: invalid preprocessing directive #dx 8 | # dx + ey = f | ^~ a.cc:1:1: error: 'from' does not name a type 1 | from sympy import * | ^~~~
s055132922
p00004
C++
#include <iostream> #include <iomanip> #include <cstdio> #include <math.h> using namespace std; int main() { double A, B, C, D, E, F, X, Y, G , H; while(cin >> A >> B >> C >> D >> E >> F) { G = A / D; D *= G; E *= G; F *= G; Y = (F-C) / (E-B); D /= G; E /= G; F /= G; H = B / E; D *= H; E *= H; F *= H; X = (F-C) / (D-A); 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:29:29: error: expected ';' before '}' token 29 | if(X==0){X=0}; | ^ | ; a.cc:30:29: error: expected ';' before '}' token 30 | if(Y==0){Y=0}; | ^ | ;
s084990453
p00004
C++
#include <iostream> #include <cstdlib> using namespace std; struct vector2{ float x, y; vector2() : x(0), y(0){} vector2(float x, float y) : x(x), y(y){} }; struct sim_elem{ float a, b, c, d, e, f; sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){} sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){} }; // a / d * d // ey - by = f - c // y / y = (f - c) / y // ax = -by + c // ax / a = -(by + c) / a vector2 sim_equ(sim_elem elem){ float dx = elem.a / elem.d * elem.d; float ey = elem.a / elem.d * elem.e; float f = elem.a / elem.d * elem.f; float y = ey - elem.b; float yr = f - elem.c; y = yr / y; float ax = -elem.b * y + elem.c; float x = ax / elem.a; return vector2(x, y); } // sprintf float placement4(float val){ char ret[128]; sprintf_s(ret, "%.3f", val); return (float)atof(ret); } int main(){ sim_elem elem; while (cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f){ vector2 ret; ret = sim_equ(elem); printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) ); } return 0; }
a.cc: In function 'float placement4(float)': a.cc:43:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 43 | sprintf_s(ret, "%.3f", val); | ^~~~~~~~~ | sprintf
s421886151
p00004
C++
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; struct vector2{ float x, y; vector2() : x(0), y(0){} vector2(float x, float y) : x(x), y(y){} }; struct sim_elem{ float a, b, c, d, e, f; sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){} sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){} }; // a / d * d // ey - by = f - c // y / y = (f - c) / y // ax = -by + c // ax / a = -(by + c) / a vector2 sim_equ(sim_elem elem){ float dx = elem.a / elem.d * elem.d; float ey = elem.a / elem.d * elem.e; float f = elem.a / elem.d * elem.f; float y = ey - elem.b; float yr = f - elem.c; y = yr / y; float ax = -elem.b * y + elem.c; float x = ax / elem.a; return vector2(x, y); } // sprintf float placement4(float val){ char ret[128]; sprintf_s(ret, "%.3f", val); return (float)atof(ret); } int main(){ sim_elem elem; while (cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f){ vector2 ret; ret = sim_equ(elem); printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) ); } return 0; }
a.cc: In function 'float placement4(float)': a.cc:44:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 44 | sprintf_s(ret, "%.3f", val); | ^~~~~~~~~ | sprintf
s104334143
p00004
C++
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; struct vector2{ float x, y; vector2() : x(0), y(0){} vector2(float x, float y) : x(x), y(y){} }; struct sim_elem{ float a, b, c, d, e, f; sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){} sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){} }; // a / d * d // ey - by = f - c // y / y = (f - c) / y // ax = -by + c // ax / a = -(by + c) / a vector2 sim_equ(sim_elem elem){ float dx = elem.a / elem.d * elem.d; float ey = elem.a / elem.d * elem.e; float f = elem.a / elem.d * elem.f; float y = ey - elem.b; float yr = f - elem.c; y = yr / y; float ax = -elem.b * y + elem.c; float x = ax / elem.a; return vector2(x, y); } // sprintf float placement4(float val){ char ret[128]; sprintf_s(ret, sizeof(ret), "%.3f", val); return (float)atof(ret); } int main(){ sim_elem elem; while (cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f){ vector2 ret; ret = sim_equ(elem); printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) ); } return 0; }
a.cc: In function 'float placement4(float)': a.cc:44:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 44 | sprintf_s(ret, sizeof(ret), "%.3f", val); | ^~~~~~~~~ | sprintf
s090588006
p00004
C++
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; struct vector2{ float x, y; vector2() : x(0), y(0){} vector2(float x, float y) : x(x), y(y){} }; struct sim_elem{ float a, b, c, d, e, f; sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){} sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){} }; // a / d * d // ey - by = f - c // y / y = (f - c) / y // ax = -by + c // ax / a = -(by + c) / a vector2 sim_equ(sim_elem elem){ float dx = elem.a / elem.d * elem.d; float ey = elem.a / elem.d * elem.e; float f = elem.a / elem.d * elem.f; float y = ey - elem.b; float yr = f - elem.c; y = yr / y; float ax = -elem.b * y + elem.c; float x = ax / elem.a; return vector2(x, y); } // sprintf float placement4(float val){ char ret[128]; sprintf_s(ret, sizeof(ret), "%.3f", val); return (float)atof(ret); } int main(){ sim_elem elem; while (1){ cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f; if (cin.eof())break; vector2 ret; ret = sim_equ(elem); printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) ); } return 0; }
a.cc: In function 'float placement4(float)': a.cc:44:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 44 | sprintf_s(ret, sizeof(ret), "%.3f", val); | ^~~~~~~~~ | sprintf
s832140375
p00004
C++
#include <iostream> #include <cstdio> using namespace std; void solve(int a, int b, int c, int d, int e, int f) { double???y=(a*f-c*d)/(a*e-b*d);; double???x=(c-b*y)/a;; print("%.3f %.3f\n",x,y);; } 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:7:15: error: expected unqualified-id before '?' token 7 | double???y=(a*f-c*d)/(a*e-b*d);; | ^ a.cc:8:15: error: expected unqualified-id before '?' token 8 | double???x=(c-b*y)/a;; | ^ a.cc:10:29: error: 'x' was not declared in this scope 10 | print("%.3f %.3f\n",x,y);; | ^ a.cc:10:31: error: 'y' was not declared in this scope 10 | print("%.3f %.3f\n",x,y);; | ^ a.cc:10:9: error: 'print' was not declared in this scope; did you mean 'printf'? 10 | print("%.3f %.3f\n",x,y);; | ^~~~~ | printf
s469402754
p00004
C++
import sys x = 0 y = 0 while True: try: a,b,c,d,e,f = map(float,raw_input().split()) if a == 0: y = c / b x = (f - e * c / b) / d elif b == 0: x = c / a y = (f - d * c / a) / e elif d == 0: y = f / e x = (c - a * f / e) / a elif e == 0: x = f / d y = (c - a * f / d) / b else: x = (c*e - b*f) / (a*e - b*d) y = (c*d - a*f) / (b*d - a*e) if x == 0: x = 0.0 if y == 0: y = 0.0 print "%f %f" % (x,y) except EOFError: break
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s403918577
p00004
C++
#include <iostream> #include <iomanip> using namespace std; double delta(double o, double p, double q , double r, double s, double t) { //cout << "o=" << o << "s=" << s << "v=" << "r=" << "o*s-p*r=" << (o*s-p*r) << endl; // |o p ||x| |q| // |r s ||y| = |t| return (o*s-p*r);//a???o b???p c???q d???r e???s f???t } double deltacfbe(double o, double p, double q , double r, double s, double t) { //cout << "o=" << o<< "s=" << s << "p=" << "r=" << "q*s-p*t=" << q*s-p*t << endl; // x = |q p | /delta // |t s | return (q*s-p*t); } double deltaadcf(double o, double p, double q , double r, double s, double t) { //cout << "o=" << o<< "s=" << s << "p=" << "r=" << "o*t-q*r=" << o*t-q*r << endl; // y = |o q | /delta // |r t | return (o*t-q*r); } int main() { double a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f){ cout.showpoint; cout << fixed << setprecision(3) << (deltacfbe(a,b,c,d,e,f)/delta(a,b,c,d,e,f)) , (deltaadcf(a,b,c,d,e,f)/delta(a,b,c,d,e,f)) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:46:135: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<' 46 | cout << fixed << setprecision(3) << (deltacfbe(a,b,c,d,e,f)/delta(a,b,c,d,e,f)) , (deltaadcf(a,b,c,d,e,f)/delta(a,b,c,d,e,f)) << endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
s043645527
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){ cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d)) << "???" << (a*f-c*d)/((a*e-b*d)) << endl; } return 0;
a.cc: In function 'int main()': a.cc:16:18: error: expected '}' at end of input 16 | return 0; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s247294801
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){ cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d)) << " " << (a*f-c*d)/((a*e-b*d)) << endl; } return 0;
a.cc: In function 'int main()': a.cc:16:18: error: expected '}' at end of input 16 | return 0; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s387619606
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){ cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d)) << " " << ((a*f-c*d)/(a*e-b*d)) << endl; } return 0;
a.cc: In function 'int main()': a.cc:16:18: error: expected '}' at end of input 16 | return 0; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s107226466
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){ cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d)) << " " << ((a*f-c*d)/(a*e-b*d)) << endl; } return 0;
a.cc: In function 'int main()': a.cc:16:14: error: expected '}' at end of input 16 | return 0; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s897740603
p00004
C++
#include <iostream> #include <iomanip> using namespace std; int main(void){ double a,b,c,d,e,f; //int X[2][2]={ {c,b}, {f,e} }; //int Y[2][2]={ {a,c}, {d,f} }; double x,y; double A,X,Y; while(cin>>a>>b>>c>>d>>e>>f){ A=a*e-b*d; X=c*e-b*f; Y=a*f-c*d; x=(1/A)*X; y=(1/A)*Y; cout << fixed << setprecision(3) << x << ' ' << y } return 0; }
a.cc: In function 'int main()': a.cc:17:66: error: expected ';' before '}' token 17 | cout << fixed << setprecision(3) << x << ' ' << y | ^ | ; 18 | } | ~
s060420043
p00004
C++
import numpy #while True: # try: # a,b,c,d,e,f = (int(i) for i in input().split()) # x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]] # print("{0:.3f} {1:.3f}".format(x,y)) # except EOFError: # break
a.cc:2:2: error: invalid preprocessing directive #while 2 | #while True: | ^~~~~ a.cc:3:5: error: invalid preprocessing directive #try 3 | # try: | ^~~ a.cc:4:9: error: invalid preprocessing directive #a 4 | # a,b,c,d,e,f = (int(i) for i in input().split()) | ^ a.cc:5:10: error: invalid preprocessing directive #x 5 | # x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]] | ^ a.cc:6:10: error: invalid preprocessing directive #print 6 | # print("{0:.3f} {1:.3f}".format(x,y)) | ^~~~~ a.cc:7:5: error: invalid preprocessing directive #except 7 | # except EOFError: | ^~~~~~ a.cc:8:9: error: invalid preprocessing directive #break 8 | # break | ^~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import numpy | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s527334263
p00004
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<sstream> #include<iomanip> using namespace std; int main() { double a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f) { double x = (c*e - b*f) / (a*e - b*d); double y = (c*d - a*f) / (b*d - a*e); if (x == 0)x = fabs(x); if (y == 0)y = fabs(y); cout << fixed << setprecision(3) << x << " "; cout << fixed << setprecision(3) << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:32: error: 'fabs' was not declared in this scope; did you mean 'labs'? 16 | if (x == 0)x = fabs(x); | ^~~~ | labs a.cc:17:32: error: 'fabs' was not declared in this scope; did you mean 'labs'? 17 | if (y == 0)y = fabs(y); | ^~~~ | labs