submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s393233992 | p00423 | Java | import java.io.*;
public class Program0500 {
public static void main(String[] args){
int scores[] = new int[2];
try{
BufferedReader std = new BufferedReader(new InputStreamReader(System.in));
int len = Integer.parseInt(std.readLine());
for(int i=0; i<len; i++){
String num[] = std.readLine().split(" ");
if(num[0].compareTo(num[1]) > 0){ scores[0] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
else if(num[0].compareTo(num[1]) < 0){ scores[1] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
}
}catch(IOException | NumberFormatException e){}
System.out.println(scores[0] + " " + scores[1]);
}
} | Main.java:2: error: class Program0500 is public, should be declared in a file named Program0500.java
public class Program0500 {
^
1 error
|
s724222438 | p00423 | Java | import java.io.*;
public class Program0500 {
public static void main(String[] args){
int scores[] = new int[2];
try{
BufferedReader std = new BufferedReader(new InputStreamReader(System.in));
int len = Integer.parseInt(std.readLine());
for(int i=0; i<len; i++){
String num[] = std.readLine().split(" ");
if(num[0].compareTo(num[1]) > 0){ scores[0] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
else if(num[0].compareTo(num[1]) < 0){ scores[1] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
}
}
catch(IOException e){}
catch(NumberFormatException e){}
System.out.println(scores[0] + " " + scores[1]);
}
} | Main.java:2: error: class Program0500 is public, should be declared in a file named Program0500.java
public class Program0500 {
^
1 error
|
s737040870 | p00423 | Java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args){
ArrayList<Integer[]> resultList = new ArrayList<>();
try{
BufferedReader std = new BufferedReader(new InputStreamReader(System.in));
int len;
while( (len = Integer.parseInt(std.readLine())) != 0){
Integer scores[] = {0, 0};
for(int i=0; i<len; i++){
String num[] = std.readLine().split(" ");
if(num[0].compareTo(num[1]) > 0){ scores[0] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
else if(num[0].compareTo(num[1]) < 0){ scores[1] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
else{ scores[0] += Integer.parseInt(num[0]); scores[1] += Integer.parseInt(num[1]); }
}
resultList.add(scores);
}
}
catch(IOException e){}
catch(NumberFormatException e){}
for(Integer result[] : resultList)
System.out.println(result[0] + " " + result[1]);
}
}
}
catch(IOException e){}
catch(NumberFormatException e){}
System.out.println(scores[0] + " " + scores[1]);
}
} | Main.java:27: error: class, interface, enum, or record expected
}
^
Main.java:31: error: class, interface, enum, or record expected
}
^
2 errors
|
s636742207 | p00423 | Java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args){
ArrayList<Integer[]> resultList = new ArrayList<Integer[]>();
try{
BufferedReader std = new BufferedReader(new InputStreamReader(System.in));
int len;
while( (len = Integer.parseInt(std.readLine())) != 0){
Integer scores[] = {0, 0};
for(int i=0; i<len; i++){
String num[] = std.readLine().split(" ");
if(num[0].compareTo(num[1]) > 0){ scores[0] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
else if(num[0].compareTo(num[1]) < 0){ scores[1] += Integer.parseInt(num[0]) + Integer.parseInt(num[1]); }
else{ scores[0] += Integer.parseInt(num[0]); scores[1] += Integer.parseInt(num[1]); }
}
resultList.add(scores);
}
}
catch(IOException e){}
catch(NumberFormatException e){}
for(Integer result[] : resultList)
System.out.println(result[0] + " " + result[1]);
}
}
}
catch(IOException e){}
catch(NumberFormatException e){}
System.out.println(scores[0] + " " + scores[1]);
}
} | Main.java:27: error: class, interface, enum, or record expected
}
^
Main.java:31: error: class, interface, enum, or record expected
}
^
2 errors
|
s098774334 | p00423 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class mountain{
public static void main(String args[]){
try{
while(true){
// まずカードの枚数を入力
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int cardnum = Integer.parseInt(br.readLine());
if(cardnum == 0) break; // 0が入力されたら修了
int scoreA = 0, scoreB = 0;
for(int i = 0; i < cardnum; i++){
// スペースで文字を区切る
String read_str = br.readLine();
String[] cards_str = read_str.split(" ");
//System.out.println(cards_str[0]);
//System.out.println(cards_str[1]);
int cardA = Integer.parseInt(cards_str[0]);
int cardB = Integer.parseInt(cards_str[1]);
if(cardA > cardB){
scoreA += (cardA + cardB);
}else if(cardA < cardB){
scoreB += (cardA + cardB);
}else{
scoreA += cardA;
scoreB += cardB;
}
}
System.out.println(scoreA + " " + scoreB);
}
}catch(Exception e){
System.err.println(e);
}
}
} | Main.java:5: error: class mountain is public, should be declared in a file named mountain.java
public class mountain{
^
1 error
|
s665016102 | p00423 | Java | public static void main(String args[]){
try{
while(true){
// まずカードの枚数を入力
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int cardnum = Integer.parseInt(br.readLine());
if(cardnum == 0) break; // 0が入力されたら修了
int scoreA = 0, scoreB = 0;
for(int i = 0; i < cardnum; i++){
// スペースで文字を区切る
String read_str = br.readLine();
String[] cards_str = read_str.split(" ");
//System.out.println(cards_str[0]);
//System.out.println(cards_str[1]);
int cardA = Integer.parseInt(cards_str[0]);
int cardB = Integer.parseInt(cards_str[1]);
if(cardA > cardB){
scoreA += (cardA + cardB);
}else if(cardA < cardB){
scoreB += (cardA + cardB);
}else{
scoreA += cardA;
scoreB += cardB;
}
}
System.out.println(scoreA + " " + scoreB);
}
}catch(Exception e){
System.err.println(e);
}
} | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args[]){
^
(use --enable-preview to enable unnamed classes)
1 error
|
s700799814 | p00423 | Java | import java.util.*;
public class Card_Game {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true) {
int n = sc.nextInt();
if (n == 0)
break;
int a = 0;
int b = 0;
for (int i = 0; i < n; i++) {
int ta = sc.nextInt();
int tb = sc.nextInt();
if (ta > tb)
a += ta + tb;
else if (ta < tb)
b += ta + tb;
else {
a += ta;
b += tb;
}
}
System.out.println(a + " " + b);
}
sc.close();
}
} | Main.java:3: error: class Card_Game is public, should be declared in a file named Card_Game.java
public class Card_Game {
^
1 error
|
s562784986 | p00423 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
if(n==0)break;
int p1 = 0;
int p2 = 0;
while(n--!=0){
int a = sc.nextInt();
int b = sc.nextInt();
if(a>b)p1+=a+b;
else if(a<b)p2+=a+b;
else
p1+=a;
p2+=b;
}
System.out.println(p1 + " " + p2);
}
}
} | Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:10: error: illegal character: '\u3000'
int p1 = 0;?
^
11 errors
|
s547045801 | p00423 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
if(n==0)break;
int p1 = 0;
int p2 = 0;
while(n--!=0){
int a = sc.nextInt();
int b = sc.nextInt();
if(a>b)p1+=a+b;
else if(a<b)p2+=a+b;
else {
p1+=a;
p2+=b;
}
}
System.out.println(p1 + " " + p2);
}
}
} | Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:8: error: illegal character: '\u3000'
????int n = sc.nextInt();
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:9: error: illegal character: '\u3000'
????if(n==0)break;??
^
Main.java:10: error: illegal character: '\u3000'
int p1 = 0;?
^
11 errors
|
s226578258 | p00423 | C | ↓カードゲーム
#include <stdio.h>
int main(){
int a[100]={0},b[100]={0};
int c=0;
int A[100]={0},B[100]={0};
int i,j=0,k=0;
for(j=0;;j++){
scanf("%d",&c);
if(c==0){
break;
}
else{
k++;
}
for(i=0;i<c;i++){
scanf("%d%d",&a[i],&b[i]);
if(a[i]>b[i]){
A[j]=A[j]+a[i]+b[i];
}
else if(a[i]<b[i]){
B[j]=B[j]+a[i]+b[i];
}
else{
A[j]=A[j]+a[i];
B[j]=B[j]+b[i];
}
}
}
for(j=0;j<=k-1;j++){
printf("%d %d\n",A[j],B[j]);
}
return 0;
}
| main.c:1:1: error: stray '\342' in program
1 | <U+2193><U+30AB><U+30FC><U+30C9><U+30B2><U+30FC><U+30E0>
| ^~~~~~~~
main.c:1:14: error: expected ';' before 'typedef'
1 | ↓カードゲーム
| ^
| ;
|
s449447161 | p00423 | C | #include <stdio.h>
int main(void)
{
int a,b,c,n,i,esc=0,f=0;
w
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&a,&b);
if(a>b){
esc=esc+a+b;
}
else if(a==b){
esc=esc+a;
f=f+b;
}
else{
f=f+a+b;
}
}
printf("%d\n %d\n",esc,f);
return 0;
}
| main.c: In function 'main':
main.c:6:9: error: unknown type name 'w'
6 | w
| ^
main.c:7:15: error: expected declaration specifiers or '...' before string constant
7 | scanf("%d",&n);
| ^~~~
main.c:7:20: error: expected declaration specifiers or '...' before '&' token
7 | scanf("%d",&n);
| ^
|
s642877506 | p00423 | C | #include<stdio.h>
int main(void)
{
int a[10000],b[10000],n,i,c[2];
for(;;){
scanf("%d",&n);
if(n==0)
break;
for(i=0;i<n+1;i++){
scanf("%d%d",&a[i],&b[i]);
if(a[i]>b[i])
c[0]=a[i]+b[i];
else
c[1]=a[i]+b[i];
}
printf("%d %d\n"c[0],c[1]);
}
return 0;
} | main.c: In function 'main':
main.c:16:33: error: expected ')' before 'c'
16 | printf("%d %d\n"c[0],c[1]);
| ~ ^
| )
|
s212188640 | p00423 | C | #include<stdio.h>
int main()
{
int a[10000],b[10000],n,i,c[2];
for(;;){
scanf("%d",&n);
if(n==0)
break;
for(i=0;i<n+1;i++){
scanf("%d%d",&a[i],&b[i]);
if(a[i]>b[i])
c[0]=a[i]+b[i];
else
c[1]=a[i]+b[i];
}
printf("%d %d\n"c[0],c[1]);
}
return 0;
} | main.c: In function 'main':
main.c:16:33: error: expected ')' before 'c'
16 | printf("%d %d\n"c[0],c[1]);
| ~ ^
| )
|
s408039233 | p00423 | C | #include "stdio.h"
#include "stdlib.h"
int main(void){
int i,n;
int suma,sumb;
n=suma=sumb=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&a,&b);
if(a==b){
suma+=a;
sumb+=b;
}else if(a>b){
suma+=a+b;
}else{
sumb+=a+b;
}
}
printf("%d %d\n",suma,sumb);
return 0;
} | main.c: In function 'main':
main.c:9:16: error: 'a' undeclared (first use in this function)
9 | scanf("%d %d",&a,&b);
| ^
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:19: error: 'b' undeclared (first use in this function)
9 | scanf("%d %d",&a,&b);
| ^
|
s705372753 | p00423 | C | #include <stdio.h>
int main(int ac, char** av) {
int n, score_a = 0, score_b = 0;
while(true) {
scanf("%d", &n);
if(n == 0) return 0;
int *a = (int*) malloc(sizeof(int) * n);
int *b = (int*) malloc(sizeof(int) * n);
int i;
for(i = 0; i < n; i++) {
scanf("%d %d", a+i, b+i);
}
for(i = 0; i < n; i++) {
if(a[i] > b[i]) {
score_a += a[i] + b[i];
} else if(a[i] < b[i]) {
score_b += a[i] + b[i];
} else if(a[i] == b[i]) {
score_a += a[i];
score_b += b[i];
}
}
printf("%d %d\n", score_a, score_b);
}
free(a);
free(b);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: 'true' undeclared (first use in this function)
5 | while(true) {
| ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
5 | while(true) {
| ^~~~
main.c:8:21: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
8 | int *a = (int*) malloc(sizeof(int) * n);
| ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
1 | #include <stdio.h>
+++ |+#include <stdlib.h>
2 |
main.c:8:21: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
8 | int *a = (int*) malloc(sizeof(int) * n);
| ^~~~~~
main.c:8:21: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:26:3: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
26 | free(a);
| ^~~~
main.c:26:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:26:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:26:8: error: 'a' undeclared (first use in this function)
26 | free(a);
| ^
main.c:27:8: error: 'b' undeclared (first use in this function)
27 | free(b);
| ^
|
s437225641 | p00423 | C | #include<stdio.h>
int main(void){
int loop,a,b,c=0,d=0;
while(1){
scanf("%d",&loop);
if(loop=\0)break;
for(;loop--;){
scanf("%d %d",&a,&b);
if(a!=b){
if(a>b){
c+=a+b;
}else{
d+=a+b;
}
}else{
c+=a;
d+=b;
}
}
printf("%d %d\n",c,d);}
return 0;
} | main.c: In function 'main':
main.c:6:13: error: stray '\' in program
6 | if(loop=\0)break;
| ^
|
s186359945 | p00423 | C | #include<stdio.h>
int main (void) {
int a[10000]={0}, b[10000]={0};
int c,i=0,asum=0,bsum=0;
scanf("%d",&c);
while(1) {
if(i==c) break;
scanf("%d%d",&a[i] ,&b[i]);
if(a[i]>b[i]) asum=asum+a[i]+b[i];
else if(a[i]<b[i]) bsum=bsum+a[i]+b[i];
else {
asum=asum+a[i];
bsum=bsum+b[i];
}
i++;
}
printf("%d %d\n",asum ,bsum);
}
return 0;
} | main.c:20:3: error: expected identifier or '(' before 'return'
20 | return 0;
| ^~~~~~
main.c:21:1: error: expected identifier or '(' before '}' token
21 | }
| ^
|
s122698144 | p00423 | C | #include <stdio.h>
int main(void){
int s_num = 1;
int sum1 = 0;
int sum2 = 0;
while(1){
int i;
scanf("%d",&s_num);
if(s_num == 0) break;
for(i = 0;i < s_num; i++){
int sam1 = 0;
int sam2 = 0;
scanf("%d %d",&sam1,&sam2);
if(sam1 > sam2){
sum1 += (sam1 + sam2);
}else if(sam1 < sam 2){
sum2 += (sam1 +sam2);
}else{
sum1 += sam1;
sum2 += sam2;
}
printf("%d %d\n",sam1.sam2);
}
return 0;
} | main.c: In function 'main':
main.c:21:19: error: 'sam' undeclared (first use in this function); did you mean 'sam2'?
21 | }else if(sam1 < sam 2){
| ^~~
| sam2
main.c:21:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:22: error: expected ')' before numeric constant
21 | }else if(sam1 < sam 2){
| ~ ^~
| )
main.c:28:24: error: request for member 'sam2' in something not a structure or union
28 | printf("%d %d\n",sam1.sam2);
| ^
main.c:34:1: error: expected declaration or statement at end of input
34 | }
| ^
|
s655684018 | p00423 | C | #include <stdio.h>
int main(void)
{
int n, a, b, sa = 0, sb = 0;
int i;
while (1) {
scanf("%d", &n);
if (n == 0)
break;
for (i = 0; i < n; i++) {
scanf("%d%d", &a, &b);
if (a > b)
sa += a + b;
else if (b > a)
sb += a + b;
else {
sa += a; sb += b;
}
}
printf("%d %d\n", sa, sb);
return 0;
} | main.c: In function 'main':
main.c:25:9: error: expected declaration or statement at end of input
25 | }
| ^
|
s479999944 | p00423 | C | #include <stdio.h>
int main(void) {
int a,b,i,j,as = 0,bs = 0;
while(scanf("%d",&j) ; j != 0){
for(i = 1;i <= j;i++){
scanf("%d%d", &a, &b);
if (a > b){
as = as + a + b;
}
else if (a <b){
bs = bs + a + b;
}
else{
as = as + a;
bs = bs + b;
}
}
printf("%d %d\n", as ,bs);
}
return 0;
} | main.c: In function 'main':
main.c:5:29: error: expected ')' before ';' token
5 | while(scanf("%d",&j) ; j != 0){
| ~ ^~
| )
|
s560206359 | p00423 | C | #include<stdio.h>
#include<stdlib.h>
int main()
{
int num;
while(1)
{
scanf("%d",num);
if(num==0)break;
int i;
int *a,*b;
a=(int *)malloc(sizeof(int)*num);
b=(int *)malloc(sizeof(int)*num);
for(i=0;i<num;i++)
{
int carda,cardb;
scanf("%d %d",&carda,&cardb);
a[i]=carda;
b[i]=cardb;
}
pointa=0;pointb=0;
for(i=0;i<num;i++)
{
if(a[i]>b[i])
{
pointa+=a[i]+b[i];
}
else if(a[i]<b[i])
{
pointb+=a[i]+b[i];
}
else
{
pointa+=a[i];
pointb+=b[i];
}
}
printf("%d %d\n",pointa,pointb);
free(a);free(b);
}
} | main.c: In function 'main':
main.c:23:7: error: 'pointa' undeclared (first use in this function); did you mean 'printf'?
23 | pointa=0;pointb=0;
| ^~~~~~
| printf
main.c:23:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:16: error: 'pointb' undeclared (first use in this function); did you mean 'printf'?
23 | pointa=0;pointb=0;
| ^~~~~~
| printf
|
s231779846 | p00423 | C | #include<stdio.h>
#include<string.h>
using namespace std;
int main(void){
int n=0,a=0,b=0,a1=0,b1=0,i=0;
while(1){
scanf("%d",&n);
a1=0;
b1=0;
if(n==0){break;}
for(i=0;i<n;i++){
scanf("%d%d",&a,&b);
if(a>b){
a1=a+b;
}else if(b>a){
b1=a+b;
}else{
a1+=a;
b1+=b;
}
}
printf("%d %d\n",a1,b1);
}
return 0;
} | main.c:3:1: error: unknown type name 'using'
3 | using namespace std;
| ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
3 | using namespace std;
| ^~~
|
s122740662 | p00423 | C | #include "stdafx.h"
#define N 10000
int main()
{
int all,i;
int a, b;
a = 0, b = 0;
scanf_s("%d", &all);
int carda[N] = {0}, cardb[N] = {0};
for (i = 0; i < all; i++) {
scanf_s("%d", &carda[i]);
scanf_s("%d", &cardb[i]);
}
for (i = 0; i < all; i++) {
if (carda[i] > cardb[i]) {
a += (carda[i] + cardb[i]);
}
else if (carda[i] == cardb[i]) {
a += carda[i];
b += cardb[i];
}
else {
b += (carda[i] + cardb[i]);
}
}
printf("%d %d\n", a, b);
return 0;
} | main.c:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s408438654 | p00423 | C | #include <stdio.h>
int main(){
int num;
do{
int px =0, py =0;
scanf("%d", &num);
for (int i =0; i < num; i++){
int x, y;
scanf("%d %d", &x, &y);
if ( x > y ) px += x + y;
else if(x == y) { px+=x; py+=y;}
else py += x + y;
}
printf("%d %d\n", px, py);
}while( num != 0 )
return 0;
} | main.c: In function 'main':
main.c:16:21: error: expected ';' before 'return'
16 | }while( num != 0 )
| ^
| ;
17 |
18 | return 0;
| ~~~~~~
|
s473769489 | p00423 | C | #include<stdio.h>
int main()
{
int i1, i2, b, k, n, m[2], **c, max[2], min[2];
scanf("%d", &n);
m[0] = n;
m[1] = n;
c = new int * [2];
c[0] = new int [n];
c[1] = new int [n];
for (i1 = 0; i1 < n; i1++)
scanf("%d", &c[0][i1]);
qsort(c[0], n, sizeof(int), compare);
min[0] = 0;
max[0] = n - 1;
k = 0;
for (i1 = 1; i1 < c[0][0]; i1++) {
c[1][k] = i1;
k++;
}
for (i1 = 0; i1 < n-1; i1++) {
for (i2 = c[0][i1]+1; i2 < c[0][i1+1]; i2++) {
c[1][k] = i2;
k++;
}
}
min[1] = 0;
max[1] = n - 1;
k = 1;
b = c[0][0];
min[0] = 1;
c[0][0] = 0;
m[0]--;
while (m[0] > 0 && m[1] > 0) {
if (b > c[k][max[k]])
b = -1;
else {
for (i1 = min[k]; i1 <= max[k]; i1++) {
if (c[k][i1] > b) {
b = c[k][i1];
c[k][i1] = 0;
m[k]--;
if (i1 == min[k]) {
for (i2 = min[k]+1; i2 <= max[k]; i2++) {
if (c[k][i2] > 0) {
min[k] = i2;
break;
}
}
}
else if (i1 == max[k]) {
for (i2 = max[k]-1; i2 >= min[k]; i2--) {
if (c[k][i2] > 0) {
max[k] = i2;
break;
}
}
}
break;
}
}
}
k = (k + 1) % 2;
}
printf("%d\n%d\n", m[1], m[0]);
return 0;
} | main.c: In function 'main':
main.c:8:16: error: 'new' undeclared (first use in this function)
8 | c = new int * [2];
| ^~~
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:19: error: expected ';' before 'int'
8 | c = new int * [2];
| ^~~~
| ;
main.c:9:19: error: expected ';' before 'int'
9 | c[0] = new int [n];
| ^~~~
| ;
main.c:10:19: error: expected ';' before 'int'
10 | c[1] = new int [n];
| ^~~~
| ;
main.c:13:9: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
13 | qsort(c[0], n, sizeof(int), compare);
| ^~~~~
main.c:13:37: error: 'compare' undeclared (first use in this function)
13 | qsort(c[0], n, sizeof(int), compare);
| ^~~~~~~
|
s635296883 | p00423 | C | #include<stdio.h>
int main(){
int n;
int pa, pb;
ina sa, sb;
for(;;){
scanf("%d",&n);
if(n==0) return 0;
int i;
for(i=0;i<n;i++){
scanf("%d %d",&pa,&pb);
if(pa > pb) sa += pa+pb;
else if(pb > pa) sb += pa+pb;
else { sa+=pa; sb += pb; }
}
printf("%d %d\n", sa, sb);
}
} | main.c: In function 'main':
main.c:6:3: error: unknown type name 'ina'; did you mean 'int'?
6 | ina sa, sb;
| ^~~
| int
|
s691023136 | p00423 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int n;
int pa, pb;
ina sa, sb;
for(;;){
scanf("%d",&n);
if(n==0) exit(0);
int i;
for(i=0;i<n;i++){
scanf("%d %d",&pa,&pb);
if(pa > pb) sa += pa+pb;
else if(pb > pa) sb += pa+pb;
else { sa+=pa; sb += pb; }
}
printf("%d %d\n", sa, sb);
}
return 0;
} | main.c: In function 'main':
main.c:7:3: error: unknown type name 'ina'; did you mean 'int'?
7 | ina sa, sb;
| ^~~
| int
|
s801024249 | p00423 | C | #include<stdio.h>
int main(){
int n,a,b,i,ca,cb;
a=0;
b=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&ca,&cb);
(ca>cb)?a+=ca+cb:b+=ca+cb;
}
printf("%d %d\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:10:35: error: lvalue required as left operand of assignment
10 | (ca>cb)?a+=ca+cb:b+=ca+cb;
| ^~
|
s510138001 | p00423 | C | #include<stdio.h>
int main(){
int n,a,b,i,ca,cb;
a=0;
b=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&ca,&cb);
if(ca>cb){
a+=ca+cb;
}else if(ca<cb){
b+=ca+cb;
}else{
a+=ca:
b+=cb;
}
}
printf("%d %d\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:15:22: error: expected ';' before ':' token
15 | a+=ca:
| ^
| ;
|
s393034728 | p00423 | C | #include <stdio.h.
#define NUM 3
int main()
{
int a=0,b=0,i,j;
int a[NUM],b[NUM];
for(i=0;i<NUM;i++){
scanf("%d",&a[i]);
scanf("%d",&b[i]);
if(a[i]>b[i])
a+=a[i]+b[i];
else (a[i]<B[i])
b+=a[i]+b[i];
else
a+=a[i];
b+=b[i];
}
printf("%d %d\n",a,b);
return 0;
} | main.c:1:19: error: missing terminating > character
1 | #include <stdio.h.
| ^
main.c:1:10: fatal error: stdio.h.: No such file or directory
1 | #include <stdio.h.
| ^
compilation terminated.
|
s228031218 | p00423 | C | #include <stdio.h.
#define NUM 3
int main()
{
int a=0,b=0,i,j;
int a[NUM],b[NUM];
for(i=0;i<NUM;i++){
scanf("%d",&a[i]);
scanf("%d",&b[i]);
if(a[i]>b[i])
a+=a[i]+b[i];
else (a[i]<B[i])
b+=a[i]+b[i];
else
a+=a[i];
b+=b[i];
}
printf("%d %d\n",a,b);
return 0;
} | main.c:1:19: error: missing terminating > character
1 | #include <stdio.h.
| ^
main.c:1:10: fatal error: stdio.h.: No such file or directory
1 | #include <stdio.h.
| ^
compilation terminated.
|
s733197679 | p00423 | C | #include <stdio.h>
int main()
{
int n;
while (1) {
scanf_s("%d", &n);
if (n == 0) break;
int a, b, A = 0, B = 0, i;
scanf_s("%d", &a);
scanf_s("%d", &b);
if (a > b) { A += a + b; }
else if (a < b) { B += a + b; }
else if (a == b) { A += a, B += b; }
}
printf("%d %d", A, B);
return 0;
} | main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
8 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
main.c:19:25: error: 'A' undeclared (first use in this function)
19 | printf("%d %d", A, B);
| ^
main.c:19:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:28: error: 'B' undeclared (first use in this function)
19 | printf("%d %d", A, B);
| ^
|
s628476692 | p00423 | C |
int main()
{
int n;
while (1) {
scanf_s("%d", &n);
if (n == 0) break;
int a, b, A = 0, B = 0, i;
scanf_s("%d", &a);
scanf_s("%d", &b);
for (i = 0;i < n;i++) {
if (a > b) { A += a + b; }
else if (a < b) { B += a + b; }
else if (a == b) { A += a, B += b; }
}
}
printf("%d %d", A, B);
return 0;
} | main.c: In function 'main':
main.c:6:17: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
6 | scanf_s("%d", &n);
| ^~~~~~~
main.c:19:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
19 | printf("%d %d", A, B);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 |
main.c:19:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
19 | printf("%d %d", A, B);
| ^~~~~~
main.c:19:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:25: error: 'A' undeclared (first use in this function)
19 | printf("%d %d", A, B);
| ^
main.c:19:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:28: error: 'B' undeclared (first use in this function)
19 | printf("%d %d", A, B);
| ^
|
s768111681 | p00423 | C | #include <stdio.h>
int main(){
????????int n;
????????while(1){
????????scanf("%d",&n);
????????if(n==0)break;
????????int A=0,B=0,a=0,b=0,i=0;
????????for(i=0;i<n;i++){
????????????????scanf("%d %d",&a,&b);
????????????????if(a>b){A+=a+b;
????????????????}else if(a<b){B+=a+b;
????????????????}else if(a=b){A+=a;B+=b;}
????????}
????????printf("%d %d\n",A,B);
????????}
return 0;
} | main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
3 | ????????int n;
| ^
main.c:4:1: error: expected expression before '?' token
4 | ????????while(1){
| ^
|
s518826514 | p00423 | C |
int main()
{
int n;
int a, b, A = 0, B = 0, i;
while (1) {
scanf_s("%d", &n);
if (n == 0) break;
scanf_s("%d %d", &a, &b);
for (i = 0;i < n;i++) {
if (a > b) { A += a + b; }
else if (a < b) { B += a + b; }
else if (a == b) { A += a; B += b; }
}
}
printf("%d %d", A, B);
return 0;
} | main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
7 | scanf_s("%d", &n);
| ^~~~~~~
main.c:18:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
18 | printf("%d %d", A, B);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 |
main.c:18:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
18 | printf("%d %d", A, B);
| ^~~~~~
main.c:18:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s489861544 | p00423 | C | #include <stdio.h>
??
int main(){
????????int n, i, a, b, sumA, sumB;
????????while(1){
????????????????scanf("%d", &n);
????????????????if(n==0) break;
????????????????sumA=sumB=0;
????????????????for(i=0;i<n;++i){
????????????????????????scanf("%d %d", &a, &b);
????????????????????????if(a>b) sumA=sumA+a+b;
????????????????????????else if(a<b) sumB=sumB+a+b;
????????????????????????else{
????????????????????????????????sumA=sumA+a;
????????????????????????????????sumB=sumB+b;
????????????????????????}
????????????????}????
????????????????printf("%d %d\n", sumA, sumB);
????????}
????????return 0;
} | main.c:2:1: error: expected identifier or '(' before '?' token
2 | ??
| ^
|
s776549997 | p00423 | C | #include <stdio.h>
int main()
{
int n, cardA, cardB, aSc, bSc, i;
while(scanf("%d", &n), n != 0) {
aSc = bSc = 0;
for(i = 0; i < n; i++) {
scanf("%d %d", &cardA, &cardB);
cardA > cardB ? aSc += cardA + cardB : bSc += cardA + cardB;
}
printf("%d %d\n", aSc, bSc);
}
return 0;
} | main.c: In function 'main':
main.c:14:68: error: lvalue required as left operand of assignment
14 | cardA > cardB ? aSc += cardA + cardB : bSc += cardA + cardB;
| ^~
|
s494878014 | p00423 | C | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,a,b,countA=0,countB=0;
cin>>n;
if(n!=0){
do{
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b){
countA+=(a+b);
}else if(a<b){
countB+=(a+b);
}//a==b
}
cout<<countA<<" "<<countB;
cout<<"\n";
countA=0,countB=0;
cin>>n;
if(n==0)break;
}while(1);
}
cout<<endl;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s315452807 | p00423 | C | #include<stdio.h>
int main(){
int n=0;
int i=0;
int a[10000], b[10000];
int a=0, b=0;
int ansA=0, ansB=0;
scanf("%d", &n);
while(n!=0){
for(i=0;i<n;i++){
scanf("%d, %d", &a[i], &b[i]);
}
for(i=0;i<n;i++){
a=a[i];
b=b[i];
if(a<b){
ansB=ansB+a+b;
}else if(b<a){
ansA=ansA+a+b;
}else{
ansA=ansA+a;
ansB=ansB+b;
}
}
scanf("%d", &n);
}
printf("%d %d\n", ansA, ansB);
return 0;
} | main.c: In function 'main':
main.c:7:8: error: conflicting types for 'a'; have 'int'
7 | int a=0, b=0;
| ^
main.c:6:8: note: previous declaration of 'a' with type 'int[10000]'
6 | int a[10000], b[10000];
| ^
main.c:7:13: error: conflicting types for 'b'; have 'int'
7 | int a=0, b=0;
| ^
main.c:6:18: note: previous declaration of 'b' with type 'int[10000]'
6 | int a[10000], b[10000];
| ^
|
s692246940 | p00423 | C | #include<stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("&d",n);
if(i=n;i=0;i--){
scanf("%d %d",A[i],B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Anum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
}
| main.c: In function 'main':
main.c:7:11: error: expected ')' before ';' token
7 | if(i=n;i=0;i--){
| ~ ^
| )
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s930187416 | p00423 | C | #include<stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("&d",&n);
if(i=n;i=0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Anum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
}
| main.c: In function 'main':
main.c:7:11: error: expected ')' before ';' token
7 | if(i=n;i=0;i--){
| ~ ^
| )
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s208806667 | p00423 | C | #include <stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("%d",&n);
if(i=n;i=0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Anum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
}
| main.c: In function 'main':
main.c:7:11: error: expected ')' before ';' token
7 | if(i=n;i=0;i--){
| ~ ^
| )
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s552356935 | p00423 | C | #include <stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("%d",&n);
if(i=n;i>0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Anum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
}
| main.c: In function 'main':
main.c:7:11: error: expected ')' before ';' token
7 | if(i=n;i>0;i--){
| ~ ^
| )
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s140193527 | p00423 | C | #include <stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("%d",&n);
if(i=n;i>0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+A[i]+B[i];
else if(A[i]<B[i])
Anum=Bnum+A[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
}
| main.c: In function 'main':
main.c:7:11: error: expected ')' before ';' token
7 | if(i=n;i>0;i--){
| ~ ^
| )
|
s948208711 | p00423 | C | #include <stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("%d",&n);
if(i=n;i=0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Bnum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
} | main.c: In function 'main':
main.c:7:11: error: expected ')' before ';' token
7 | if(i=n;i=0;i--){
| ~ ^
| )
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s072443991 | p00423 | C | #include <stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("%d",&n);
for(i=n;i=0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Bnum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
} | main.c: In function 'main':
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s458646176 | p00423 | C | #include <stdio.h>
int main(void){
int A[10000],B[10000],n,i,Anum=0,Bnum=0;
scanf("%d",&n);
for(i=n;i>0;i--){
scanf("%d %d",&A[i],&B[i]);
if(A[i]>B[i])
Anum=Anum+a[i]+B[i];
else if(A[i]<B[i])
Bnum=Bnum+a[i]+B[i];
else{
Anum+=A[i];
Bnum+=B[i];
}
}
printf("%d %d",Anum,Bnum);
} | main.c: In function 'main':
main.c:10:23: error: 'a' undeclared (first use in this function)
10 | Anum=Anum+a[i]+B[i];
| ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
|
s802775206 | p00423 | C | #include <stdio.h>
void main() {
int n, a, b;
int suma = 0;
int sumb = 0;
bool endflg = false;
while (1) {
scanf_s("%d", &n);
if (n == 0) {
return;
}
int i;
for (i = n; i > 0; i--) {
scanf_s("%d %d", &a, &b);
if (a > b) {
suma = suma + a + b;
}
else if (b > a) {
sumb = sumb + a + b;
}
else {
suma = suma + a;
sumb = sumb + b;
}
}
printf("%d %d\n", suma, sumb);
suma = 0;
sumb = 0;
}
} | main.c: In function 'main':
main.c:7:9: error: unknown type name 'bool'
7 | bool endflg = false;
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c:7:23: error: 'false' undeclared (first use in this function)
7 | bool endflg = false;
| ^~~~~
main.c:7:23: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
9 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s301582646 | p00423 | C | #include <stdio.h>
int main(void) {
int n, a, b;
int suma = 0;
int sumb = 0;
while (1) {
scanf_s("%d", &n);
if (n == 0) {
return;
}
int i;
for (i = n; i > 0; i--) {
scanf_s("%d %d", &a, &b);
if (a > b) {
suma = suma + a + b;
}
else if (b > a) {
sumb = sumb + a + b;
}
else {
suma = suma + a;
sumb = sumb + b;
}
}
printf("%d %d\n", suma, sumb);
suma = 0;
sumb = 0;
}
} | main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
8 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
main.c:10:25: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
10 | return;
| ^~~~~~
main.c:3:5: note: declared here
3 | int main(void) {
| ^~~~
|
s915721073 | p00423 | C | #include <stdio.h>
int main (){
while (1){
int i,ny[101]={0},ny2[101]={0},sum=0,sum2=0;
scanf ("%d",&i);
if (i==0) break;
for (int s=0;s<i;s++){
scanf ("%d %d",&ny[s],&ny2[s]);
}
for (int s=0;s<i;s++){
if (ny[s]>ny2[s]){
sum=sum+ny[s]+ny2[s];
}
else if (ny[s]<ny2[s]){
sum2=sum2+ny[s]+ny2[s];
}
else if (ny[s]==ny2[s]){
sum=sum+ny[s];
sum2=sum2+ny2[s];
}
}
printf ("%d %d\n",sum,sum2);
}
return 0;
}
~
~ | main.c:27:1: error: expected identifier or '(' before '~' token
27 | ~
| ^
|
s346365076 | p00423 | C | #include<stdio.h>
int main(void)
{
int A=0, B=0, n, i, Aa[10001] = { 0 }, Bb[10001] = { 0 },c;
while (1)
{
for (c = 1; c <= 2; c++)
{
A = 0;
B = 0;
n = 0;
i = 0;
Aa[10001] = { 0 };
Bb[10001] = { 0 };
}
scanf("%d", &n);
if (n == 0)
{
break;
}
for (i = 1; i <= n; i++)
{
scanf("%d %d", &Aa[i], &Bb[i]);
if (Aa[i] > Bb[i])
{
A = A + Aa[i] + Bb[i];
}
else if (Aa[i] < Bb[i])
{
B = B + Aa[i] + Bb[i];
}
else
{
A = A + Aa[i];
B = B + Bb[i];
}
}
printf("%d %d\n", A, B);
}
return 0;
} | main.c: In function 'main':
main.c:14:37: error: expected expression before '{' token
14 | Aa[10001] = { 0 };
| ^
main.c:15:37: error: expected expression before '{' token
15 | Bb[10001] = { 0 };
| ^
|
s814535943 | p00423 | C | #include <stdio.h>
int main(){
int n,a=0,b=0,i,ai,bi;
scanf("%d",&n);
if(n==0)break;
for(i=0;i<n;i++){
scanf("%d %d",&ai,&bi);
if(ai>bi)a=a+ai+bi;
else if(ai<bi)b=b+ai+bi;
else {a+=ai;
b+=bi;}
}
printf("%d %d\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: break statement not within loop or switch
5 | if(n==0)break;
| ^~~~~
|
s014349551 | p00423 | C | #include <stdio.h>
int main(){
int n,a=0,b=0,i,ai,bi;
scanf("%d",&n);
if(n==0)break;
for(i=0;i<n;i++){
scanf("%d %d\n",&ai,&bi);
if(ai>bi)a=a+ai+bi;
else if(ai<bi)b=b+ai+bi;
else {a+=ai;
b+=bi;}
}
printf("%d %d\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: break statement not within loop or switch
5 | if(n==0)break;
| ^~~~~
|
s660520511 | p00423 | C | #include<stdio.h>
int main()
{
int n,i;
int a,b;
int point[2];
while(scanf("%d",&n) != 0)
{
for(i=0; i<n; ++i)
{
scanf("%d%d",&a,&b);
point[0] = point[1] = 0;
if(a > b) point[0] += ツ a + b;
if(a < b) point[1] += ツ a + b;
if(a == b)
{
point[0] += a;
point[1] += b;
}
}
printf("%d %d\n",point[0],point[1]);
}
return 0;
} | main.c: In function 'main':
main.c:14:31: error: stray '\343' in program
14 | if(a > b) point[0] += <U+30C4><U+3000>a + b;
| ^~~~~~~~
main.c:14:29: error: '\U000030c4' undeclared (first use in this function)
14 | if(a > b) point[0] += ツ a + b;
| ^~
main.c:14:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:31: error: expected ';' before 'a'
14 | if(a > b) point[0] += ツ a + b;
| ^ ~
| ;
main.c:15:31: error: stray '\343' in program
15 | if(a < b) point[1] += <U+30C4><U+3000>a + b;
| ^~~~~~~~
main.c:15:31: error: expected ';' before 'a'
15 | if(a < b) point[1] += ツ a + b;
| ^ ~
| ;
|
s779747291 | p00423 | C | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);} | main.c:1:1: warning: data definition has no type or storage class
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'B' [-Wimplicit-int]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^
main.c:1:7: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:9: error: type of 'S' defaults to 'int' [-Wimplicit-int]
main.c:1:29: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
main.c:1:29: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^~~~~
main.c:1:29: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:51: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^~~~~~
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:51: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:58: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^
| |
| int
main.c:1:58: note: expected 'const char *' but argument is of type 'int'
main.c:1:81: error: lvalue required as left operand of assignment
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^~
main.c:1:106: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ^
main.c:1:106: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
1 | A,B,a,b;main(n,S){for(;--n||scanf("%d",&n,A=B=A&&!printf(S,A,B))*n;a-b?(a>b?A:B)+=a+b:(A+=a,B+=b))scanf(S="%d %d\n",&a,&b);}
| ~^~~~~~~~~~
| |
| int
main.c:1:106: note: expected 'const char *' but argument is of type 'int'
|
s170399104 | p00423 | C | #include <stdio.h>
int main(void){
int i, n;
int score_a, score_b;
int card_a, card_b;
while(1){
score_a = 0;
score_b = 0;
scanf("%d", &n);
if(n == 0){
return 0;
}else{
for(i=0;i<n;i++){
scanf("%d, %d", &card_a, &card_b);
if(card_a < card_b){
score_b = score_b + card_a + card_b;
}else if(card_b < card_a){
score_a = score_a + card_a + card_b;
}else{
score_a += card_a;
socre_b += card_b;
}
}
printf("%d %d\n", score_a, score_b);
}
}
return 0;
} | main.c: In function 'main':
main.c:22:41: error: 'socre_b' undeclared (first use in this function); did you mean 'score_b'?
22 | socre_b += card_b;
| ^~~~~~~
| score_b
main.c:22:41: note: each undeclared identifier is reported only once for each function it appears in
|
s040468038 | p00423 | C | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:30: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
main.c:1:30: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~
main.c:1:30: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~~
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:128: error: lvalue required as left operand of assignment
1 | main(n,a,b,x,y,i){for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~
|
s580038913 | p00423 | C | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~
main.c: In function 'main':
main.c:1:35: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
main.c:1:35: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~
main.c:1:35: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~~~~~
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:133: error: lvalue required as left operand of assignment
1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
| ^~
|
s994535797 | p00423 | C | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:53: error: 'x' undeclared (first use in this function)
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^
main.c:1:53: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:55: error: 'y' undeclared (first use in this function)
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^
main.c:1:128: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^~~~~~
main.c:1:128: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:128: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:128: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:151: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
main.c:1:151: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | main(a,b,n){while(1){scanf("%d",&n);if(!n)break;for(x=y=0;n--;){scanf("%d%d",&a,&b);a>b?x+=a+b:a<b?y+=a+b:0;;a==b?x+=a,y+=b:0;}printf("%d %d\n",x,y);}exit(0);}
| ^~~~
main.c:1:151: note: include '<stdlib.h>' or provide a declaration of 'exit'
|
s374893407 | p00423 | C | #include <stdio.h>
int main(void){
int i,a,b,c,d;
for(i=0; i<9; i++;){
scanf("%d%d\n",a,b);
if(a>b){c=a+b;}
if(a<b){d=a+b;}
if(a=b){c=a,d=b;}
}
return 0;
} | main.c: In function 'main':
main.c:4:20: error: expected ')' before ';' token
4 | for(i=0; i<9; i++;){
| ~ ^
| )
|
s213704707 | p00423 | C | #include <stdio.h>
int main(void){
int i,a,b,c,d;
while(n<=10000){
scanf("%d%d\n",&a,&b);
if(a>b){c=a+b;}
if(a<b){d=a+b;}
if(a=b){c=a,d=b;}
}
return 0;
} | main.c: In function 'main':
main.c:4:9: error: 'n' undeclared (first use in this function)
4 | while(n<=10000){
| ^
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
|
s909297535 | p00423 | C | #include <stdio.h>
int main(void){
int i,a,b,c,d,e,f,i,n;
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
i=0;
n<=10000
for(i=0,i<3,i++){
scanf("%d\n",&n);
while(n){
scanf("%d%d\n",&a,&b);
if(a>b){c=a+b;}
if(a<b){d=a+b;}
if(a=b){c=a,d=b;}
for(i=0,i<1,i++){
e=c;
}
if(i<=1){
e=e+c;
}
}
return 0;
} | main.c: In function 'main':
main.c:4:21: error: redeclaration of 'i' with no linkage
4 | int i,a,b,c,d,e,f,i,n;
| ^
main.c:4:7: note: previous declaration of 'i' with type 'int'
4 | int i,a,b,c,d,e,f,i,n;
| ^
main.c:12:11: error: expected ';' before 'for'
12 | n<=10000
| ^
| ;
13 |
14 | for(i=0,i<3,i++){
| ~~~
main.c:33:5: error: expected declaration or statement at end of input
33 | }
| ^
|
s659403144 | p00423 | C | #include <stdio.h>
int main(void){
int i,a,b,c,d,e,f,i,n;
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
i=0;
n<=10000;
for(i=0,i<3,i++){
scanf("%d\n",&n);
while(n){
scanf("%d%d\n",&a,&b);
if(a>b){c=a+b;}
if(a<b){d=a+b;}
if(a=b){c=a,d=b;}
for(i=0,i<1,i++){
e=c;
}
if(i<=1){
e=e+c;
}
}
return 0;
} | main.c: In function 'main':
main.c:4:21: error: redeclaration of 'i' with no linkage
4 | int i,a,b,c,d,e,f,i,n;
| ^
main.c:4:7: note: previous declaration of 'i' with type 'int'
4 | int i,a,b,c,d,e,f,i,n;
| ^
main.c:14:20: error: expected ';' before ')' token
14 | for(i=0,i<3,i++){
| ^
| ;
main.c:14:20: error: expected expression before ')' token
main.c:24:22: error: expected ';' before ')' token
24 | for(i=0,i<1,i++){
| ^
| ;
main.c:24:22: error: expected expression before ')' token
main.c:33:5: error: expected declaration or statement at end of input
33 | }
| ^
|
s158041843 | p00423 | C | #include <stdio.h>
int main(void){
int a,b,c,d,e,f,i,n;
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
i=0;
n<=10000;
for(i=0,i<3,i++;)
scanf("%d\n",&n);
while(n){
scanf("%d%d\n",&a,&b);
if(a>b){c=a+b;}
if(a<b){d=a+b;}
if(a=b){c=a,d=b;}
for(i=0,i<1,i++:)
e=c;
}
if(i<=1){
e=e+c;
}
}
return 0;
} | main.c: In function 'main':
main.c:14:19: error: expected expression before ')' token
14 | for(i=0,i<3,i++;)
| ^
main.c:24:20: error: expected ';' before ':' token
24 | for(i=0,i<1,i++:)
| ^
| ;
main.c:24:21: error: expected expression before ')' token
24 | for(i=0,i<1,i++:)
| ^
main.c: At top level:
main.c:32:2: error: expected identifier or '(' before 'return'
32 | return 0;
| ^~~~~~
main.c:33:1: error: expected identifier or '(' before '}' token
33 | }
| ^
|
s441343458 | p00423 | C | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~
main.c: In function 'main':
main.c:1:7: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~~
main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:63: error: lvalue required as left operand of assignment
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~
main.c:1:67: error: expected ')' before 'c'
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ~ ^
| )
main.c:1:106: error: expected expression before '}' token
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);(c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
|
s708714335 | p00423 | C | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~
main.c: In function 'main':
main.c:1:7: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~~
main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:62: error: lvalue required as left operand of assignment
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~
main.c:1:76: error: lvalue required as left operand of assignment
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~
main.c:1:83: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | a,b,c;main(d){for(scanf("%d");~scanf("%d%d",&c,&d);c>d?a+=c:b+=d)c<d?b+=c:a+=d;a=!printf("%d %d\n",a,b);}
| ^~~~~~
main.c:1:83: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:83: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:83: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s386394345 | p00423 | C | #includestdio.h
int main(void){
int n,a,b,i;
while(scanf("%d",&n),n){
int Pa=0,Pb=0;
for(i=0;in;i++){
scanf("%d %d",&a,&b);
if(a>b)Pa+=a+b;
else if(a
else {Pa+=a; Pb+=b;}
}
printf("%d %d\n",Pa,Pb);
}
return 0;
} | main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #includestdio.h
| ^
main.c: In function 'main':
main.c:6:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | while(scanf("%d",&n),n){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #includestdio.h
main.c:6:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
6 | while(scanf("%d",&n),n){
| ^~~~~
main.c:6:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:10: error: stray '\302' in program
8 | for(i=0;i<U+0081><U+0083>n;i++){
| ^~~~~~~~
main.c:8:11: error: stray '\302' in program
8 | for(i=0;i<U+0081><U+0083>n;i++){
| ^~~~~~~~
main.c:8:10: error: expected ';' before 'n'
8 | for(i=0;in;i++){
| ^ ~
| ;
main.c:11:10: error: expected ')' before 'else'
11 | else if(a
| ~ ^
| )
12 | else {Pa+=a; Pb+=b;}
| ~~~~
main.c:13:1: error: expected expression before '}' token
13 | }
| ^
main.c:14:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
14 | printf("%d %d\n",Pa,Pb);
| ^~~~~~
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s760405756 | p00423 | C | #include<stdio.h>
void main(){
int n, i;
int card[2];
int result[2];
result[0] = result[1] = 0;
scanf("%d",&n);
for(i=0;i < n;i++){
card[0] = card[1] = 0;
scanf("%d %d", &card[0], &card[1]);
if(card[0] < card[1]) result[1] += card[0] + card[1];
else if(card[0] > card[1]) result[0] += card[0] + card[1];
else{
result[0] += card[0];
result[1] += card[1];
}
}
printf("%d %d\n", result[0], result[1]);
return 0;
} | main.c: In function 'main':
main.c:20:1: error: stray '\343' in program
20 | <U+3000><U+3000>return 0;
| ^~~~~~~~
main.c:20:3: error: stray '\343' in program
20 | <U+3000><U+3000>return 0;
| ^~~~~~~~
main.c:20:12: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
20 | return 0;
| ^
main.c:3:6: note: declared here
3 | void main(){
| ^~~~
|
s406277030 | p00423 | C | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}} | main.c:1:1: warning: data definition has no type or storage class
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
main.c:1:7: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~~~~~
main.c:1:7: error: initializer element is not computable at load time
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~
main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:51: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~~
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:51: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:58: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
| |
| int
main.c:1:58: note: expected 'const char *' but argument is of type 'int'
main.c:1:87: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
| |
| int
main.c:1:87: note: expected 'const char *' but argument is of type 'int'
main.c:1:104: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~
main.c:1:118: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,a,b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~
|
s356689685 | p00423 | C | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}} | main.c:1:1: warning: data definition has no type or storage class
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
main.c:1:7: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~~~~~
main.c:1:7: error: initializer element is not computable at load time
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~
main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~~~~~
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:59: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
| |
| int
main.c:1:59: note: expected 'const char *' but argument is of type 'int'
main.c:1:88: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^
| |
| int
main.c:1:88: note: expected 'const char *' but argument is of type 'int'
main.c:1:107: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~
main.c:1:121: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;){scanf(s,&a,&b);(a>=b?c:d)+=a;(b>=a?d:c)+=b;}}
| ^~
|
s212937120 | p00423 | C | c,d,s="%d %d\n";
main(n,a,b){
for(;scanf("%d ",&n),n;
printf(s,c,d))
for(c=d=0;n--;){
scanf(s,&a,&b);
(a>=b?c:d)+=a;
(b>=a?d:c)+=b;
}
} | main.c:1:1: warning: data definition has no type or storage class
1 | c,d,s="%d %d\n";
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | c,d,s="%d %d\n";
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | c,d,s="%d %d\n";
| ^
main.c:1:7: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";
| ^~~~~~~~~
main.c:1:7: error: initializer element is not computable at load time
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(n,a,b){
| ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:3:6: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | for(;scanf("%d ",&n),n;
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | c,d,s="%d %d\n";
main.c:3:6: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | for(;scanf("%d ",&n),n;
| ^~~~~
main.c:3:6: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
4 | printf(s,c,d))
| ^~~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:8: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
4 | printf(s,c,d))
| ^
| |
| int
main.c:4:8: note: expected 'const char *' but argument is of type 'int'
main.c:6:7: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
6 | scanf(s,&a,&b);
| ^
| |
| int
main.c:6:7: note: expected 'const char *' but argument is of type 'int'
main.c:7:11: error: lvalue required as left operand of assignment
7 | (a>=b?c:d)+=a;
| ^~
main.c:8:11: error: lvalue required as left operand of assignment
8 | (b>=a?d:c)+=b;
| ^~
|
s752255333 | p00423 | C | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)} | main.c:1:1: warning: data definition has no type or storage class
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^
main.c:1:7: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^~~~~~~~~
main.c:1:7: error: initializer element is not computable at load time
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^~~~~
main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^~~~~~
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:59: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^
| |
| int
main.c:1:59: note: expected 'const char *' but argument is of type 'int'
main.c:1:86: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^
| |
| int
main.c:1:86: note: expected 'const char *' but argument is of type 'int'
main.c:1:105: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^~
main.c:1:108: error: expected ')' before ';' token
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ~ ^
| )
main.c:1:124: error: expected expression before '}' token
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a;,b<a?c+=b:d+=b)}
| ^
|
s044081638 | p00423 | C | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)} | main.c:1:1: warning: data definition has no type or storage class
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^
main.c:1:7: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~~~~~~~~
main.c:1:7: error: initializer element is not computable at load time
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~~~~
main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~~~~~
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:59: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^
| |
| int
main.c:1:59: note: expected 'const char *' but argument is of type 'int'
main.c:1:86: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^
| |
| int
main.c:1:86: note: expected 'const char *' but argument is of type 'int'
main.c:1:105: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~
main.c:1:119: error: lvalue required as left operand of assignment
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^~
main.c:1:123: error: expected expression before '}' token
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=d=0;n--;scanf(s,&a,&b),a<b?d+=a:c+=a,b<a?c+=b:d+=b)}
| ^
|
s890048467 | p00423 | C | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)} | main.c:1:1: warning: data definition has no type or storage class
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^
main.c:1:7: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^~~~~~~~~
main.c:1:7: error: initializer element is not computable at load time
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^~~~~
main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^~~~~~
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:59: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^
| |
| int
main.c:1:59: note: expected 'const char *' but argument is of type 'int'
main.c:1:88: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^
| |
| int
main.c:1:88: note: expected 'const char *' but argument is of type 'int'
main.c:1:119: error: expected expression before '}' token
1 | c,d,s="%d %d\n";main(n,a,b){for(;scanf("%d ",&n),n;printf(s,c,d))for(c=a,d=b;n--;scanf(s,&a,&b),a+=a<b?d:c,b+=b<a?c:d)}
| ^
|
s690118333 | p00423 | C | #include<stdio.h>
int main(){
int n,*a,*b;
int sum_a=0; int sum_b=0;
scanf("%d\n",&n);
if(n == 0) break;
a=(int *)malloc(sizeof(int)*n);
b=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++){
scanf("%d %d\n",a[i],b[i]);
if(a[i]>b[i])
sum_a = sum_a + a[i] + b[i];
elseif(a[i]<b[i])
sum_b = sum_b + a[i] + b[i];
else{
sum_a += a[i];
sum_b += b[i];
}
}
printf("%d %d",sum_a,sum_b);
return 0;
} | main.c: In function 'main':
main.c:8:17: error: break statement not within loop or switch
8 | if(n == 0) break;
| ^~~~~
main.c:9:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
9 | a=(int *)malloc(sizeof(int)*n);
| ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
1 | #include<stdio.h>
+++ |+#include <stdlib.h>
2 |
main.c:9:15: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
9 | a=(int *)malloc(sizeof(int)*n);
| ^~~~~~
main.c:9:15: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:12:10: error: 'i' undeclared (first use in this function)
12 | for(i=0;i<n;i++){
| ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:6: error: implicit declaration of function 'elseif' [-Wimplicit-function-declaration]
17 | elseif(a[i]<b[i])
| ^~~~~~
main.c:17:23: error: expected ';' before 'sum_b'
17 | elseif(a[i]<b[i])
| ^
| ;
18 | sum_b = sum_b + a[i] + b[i];
| ~~~~~
main.c:19:6: error: 'else' without a previous 'if'
19 | else{
| ^~~~
|
s506447044 | p00423 | C | #include<stdio.h>
int main(void){
int n,i,a,b,x,y;
scanf("%d",n);
for(i=0;i<n;i++){
scanf("%d %d",a,b);
if(a>b){
x = x + a + b;
}
if else(a<b){
y = y + a + b;
}
else{
x = x + a;
y = y + b;
}
}
return 0;
} | main.c: In function 'main':
main.c:12:10: error: expected '(' before 'else'
12 | if else(a<b){
| ^~~~
| (
|
s956751479 | p00423 | C | #include <stdio.h>
int main(){
int n,h,i,apoint,bpoint;
int a[10000],b[10000];
for(h=0;h<10000;h++){
a[h]=0;
b[h]=0;
}
apoint =0;
bpoint=0;
while(1){
scanf("%d",&n);
if(n==0){
break;
}
for(i=0;i<n;i++){
scanf("%d %d",a[i],b[i]);
if(a[i]<b[i]){
apoint += a[i]+b[i];
}else if(a[i]>b[i]){
bpoint += a[i]+b[i];
}else{
apoint += a[i];
bpoint += b[i];
}
printf("%d",apoint);
printf("%d\n",bpoint);
}
return 0;
} | main.c: In function 'main':
main.c:30:1: error: expected declaration or statement at end of input
30 | }
| ^
|
s357599325 | p00423 | C | #include <stdio.h>
int main(){
int n,h,i,j,x,apoint,bpoint;
int a[10000],b[10000];
for(h=0;h<10000;h++){
a[h]=0;
b[h]=0;
}
apoint=0;
bpoint=0;
scanf("%d",&n);
if(n==0){
break;
}
for(i=0;i<n;i++){
scanf("%d %d",&a[i],&b[i]);
if(a[i]<b[i]){
bpoint += a[i]+b[i];
}else if(a[i]>b[i]){
apoint += a[i]+b[i];
}else{
apoint += a[i];
bpoint += b[i];
}
}
printf("%d",apoint);
printf(" %d\n",bpoint);
}
return 0;
} | main.c: In function 'main':
main.c:14:7: error: break statement not within loop or switch
14 | break;
| ^~~~~
main.c: At top level:
main.c:31:1: error: expected identifier or '(' before 'return'
31 | return 0;
| ^~~~~~
main.c:32:1: error: expected identifier or '(' before '}' token
32 | }
| ^
|
s220421826 | p00423 | C | #include<stdio.h>
int main(){
int game,n;
int a,b;
int A=0,B=0;
int Anoten[100],Bnoten[100];
while(1){
if(game==0)
return 0;
for(n=0;n<game;n++){
scanf("%d %d",&a,&b);
if(a<b){
Bnoten[n]=a+b;
Anoten[n]=0;
}
else if(b<a){
Anoten[n]=a+b;
Bnoten[n]=0;
}
else{
Anoten[n]=a;
Bnoten[n]=b;
}
}
for(n=0;n<game;n++){
A+=Anoten[n];
B+=Bnoten[n];
}
printf("%d %d\n",A,B);
A=0,B=0;
}
return 0; | main.c: In function 'main':
main.c:34:9: error: expected declaration or statement at end of input
34 | return 0;
| ^~~~~~
|
s891010157 | p00423 | C | #include<stdio.h>
int main()
{
int n,s,t,x,y;
for(;scanf("%d",&n)&&n!=0;printf("%d %d\n",x,y))
for(x=0,y=0;n-->0;)
{
scanf("%d %d",&s,&t);
s==t?x+=s,y+=t:s>t?x+=s+t:y+=s+t;
}
return 0;
} | main.c: In function 'main':
main.c:9:52: error: lvalue required as left operand of assignment
9 | s==t?x+=s,y+=t:s>t?x+=s+t:y+=s+t;
| ^~
|
s363993567 | p00423 | C | #include <stdio.h>
int main()
{
int n,i;
int a[10000]={0};
int b[10000]=(0);
int s1;
int s2;
s1=0; s2=0;
scanf("%d",&n);
for(i=0; i<n; i++)
{
if (a[i] > b[i]) s1 += 3;
else if(a[i]<b[i]) s2+= 3;
else {s1 +=1; s2+=1;}
}
printf("%d %d\n",s1,s2);
return 0;
} | main.c: In function 'main':
main.c:6:16: error: invalid initializer
6 | int b[10000]=(0);
| ^
|
s449289377 | p00423 | C | #include <stdio.h>
int main(void){
int cnt;
int a,b,ind=0,j;
int point[10000][2];
while(1){
scanf("%d",&cnt);
if(cnt == 0) break;
while(cnt-- > 0){
scanf("%d %d",&a,&b);
if(a > b){
pt1 += a + b;
}else if(a < b){
pt2 += a + b;
}else{
pt1 += a; pt2 += a;
}
}
point[ind][0] = pt1;
point[ind][1] = pt2;
ind++;
}
for(j = 0; j < ind;j++)
printf("%d %d\n",point[j][0],point[j][1]);
return 0;
} | main.c: In function 'main':
main.c:12:9: error: 'pt1' undeclared (first use in this function)
12 | pt1 += a + b;
| ^~~
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: 'pt2' undeclared (first use in this function)
14 | pt2 += a + b;
| ^~~
|
s871398251 | p00423 | C | #include<stdio.h>
int main(){
int i,n;
int s,t,a=0,b=0;
scanf("%d",&a);
for(i=1;i<=n;i++){
scanf("%d %d",&s,&t);
if(s>t){
a=a+s+t;
}else if(s<t){
b=b+s+t;
}else{
a=a+t;
b=b+s;
}
}
if(a!=0){printf("%d %d\n",a,b);}
return 0; | main.c: In function 'main':
main.c:20:3: error: expected declaration or statement at end of input
20 | return 0;
| ^~~~~~
|
s101018443 | p00423 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
vector<int> A, B;
int i = 0. j;
int a, b;
for(; i < 5; i++) {
cin >> n;
if(!n) break;
A.push_back(0), B.push_back(0);
for(j = 0; i < n; i++) {
cin >> a >> b;
if(a > b) A[i] += a;
else if(a < b) B[i] += b;
else A[i] += a, B[i] += b;
}
for(int i = 0; i < A.size(); i++) cout << A[i] << " " << B[i] << endl;
}
| a.cc: In function 'int main()':
a.cc:7:14: error: expected ',' or ';' before 'j'
7 | int i = 0. j;
| ^
a.cc:13:9: error: 'j' was not declared in this scope
13 | for(j = 0; i < n; i++) {
| ^
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:4:16: note: to match this '{'
4 | int main(void) {
| ^
|
s218520010 | p00423 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
vector<int> A, B;
int i = 0. j;
int a, b;
for(; i < 5; i++) {
cin >> n;
if(!n) break;
A.push_back(0), B.push_back(0);
for(j = 0; j < n; j++) {
cin >> a >> b;
if(a > b) A[i] += a;
else if(a < b) B[i] += b;
else A[i] += a, B[i] += b;
}
}
for(int i = 0; i < A.size(); i++) cout << A[i] << " " << B[i] << endl;
}
| a.cc: In function 'int main()':
a.cc:7:14: error: expected ',' or ';' before 'j'
7 | int i = 0. j;
| ^
a.cc:13:9: error: 'j' was not declared in this scope
13 | for(j = 0; j < n; j++) {
| ^
|
s148393715 | p00423 | C++ | def main():
while 1:
n = input()
if n == 0:
break
sum_a = 0
sum_b = 0
for i in range(n):
a,b = map(int, raw_input().split())
if a > b:
sum_a = sum_a + a + b
elif a < b:
sum_b = sum_b + a + b
elif a == b:
sum_a = sum_a + a
sum_b = sum_b + b
print("%s %s" %(sum_a,sum_b))
return 0
if __name__ == "__main__":
main()
| a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s378844431 | p00423 | C++ | def main():
while 1:
n = input()
if n == 0:
break
sum_a = 0
sum_b = 0
for i in range(n):
a,b = map(int, raw_input().split())
if a > b:
sum_a = sum_a + a + b
elif a < b:
sum_b = sum_b + a + b
elif a == b:
sum_a = sum_a + a
sum_b = sum_b + b
print("%s %s" %(sum_a,sum_b))
return 0
if __name__ == "__main__":
main()
| a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s434045470 | p00423 | C++ | #include<stdio.h>
int main(void)
{
int a[10000],b[10000],n,i,c[2];
for(;;){
scanf("%d",&n);
if(n==0)
break;
for(i=0;i<n+1;i++){
scanf("%d%d",&a[i],&b[i]);
if(a[i]>b[i])
c[0]=a[i]+b[i];
else
c[1]=a[i]+b[i];
}
printf("%d %d\n"c[0],c[1]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:24: error: unable to find string literal operator 'operator""c' with 'const char [7]', 'long unsigned int' arguments
16 | printf("%d %d\n"c[0],c[1]);
| ^~~~~~~~~~
|
s249119404 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n){
int a[10000]={},b[10000]={};
int ap=0,bp=0;
for(int i=0;i<n;i++){
cin>>a[n]>>b[n];
if(a[n]>b[n]){
ap+=a[n]+b[n];
}else if(a[n]<b[n]){
bp+=a[n]+b[n];
}else{
ap+=a[n];
bp+=b[n];
}
cout<<ap<<" "<<bp<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s747767127 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int a[10000],b[10000];
while(cin>>n){
a[10000]={};
b[10000]={};
int ap=0,bp=0;
for(int i=0;i<n;i++){
cin>>a[n]>>b[n];
sum=a[n]+b[n];
if(a[n]>b[n]){
ap+=sum;
}else if(a[n]<b[n]){
bp+=sum;
}else{
ap+=a[n];
bp+=b[n];
}
}
cout<<ap<<" "<<bp<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:17: error: 'sum' was not declared in this scope
12 | sum=a[n]+b[n];
| ^~~
|
s693781086 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n,sum;
int a,b.ap,bp;
while(cin>>n){
int ap=0,bp=0;
for(int i=0;i<n;i++){
cin>>a>>b;
sum=a+b;
if(a>b){
ap+=sum;
}else if(a<b){
bp+=sum;
}else{
ap+=a;
bp+=b;
}
}
cout<<ap<<" "<<bp<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
5 | int a,b.ap,bp;
| ^
a.cc:9:25: error: 'b' was not declared in this scope
9 | cin>>a>>b;
| ^
|
s532773866 | p00423 | C++ | #include<iostream>
using namespace std;
int main(){
int n,sum;
int a,b.ap,bp;
while(cin>>n){
ap=0;
bp=0;
for(int i=0;i<n;i++){
cin>>a>>b;
sum=a+b;
if(a>b){
ap+=sum;
}else if(a<b){
bp+=sum;
}else{
ap+=a;
bp+=b;
}
}
cout<<ap<<" "<<bp<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
5 | int a,b.ap,bp;
| ^
a.cc:7:1: error: 'ap' was not declared in this scope; did you mean 'a'?
7 | ap=0;
| ^~
| a
a.cc:8:1: error: 'bp' was not declared in this scope
8 | bp=0;
| ^~
a.cc:10:25: error: 'b' was not declared in this scope
10 | cin>>a>>b;
| ^
|
s725416138 | p00423 | C++ | #include <iostream>
using namespace std;
int main()
{
int n, x, y;
cin >>n;
x=0;
y=0;
int a[n], b[n];
for(i=1;i<=n;i++)
{
cin >>a[i]>>b[i];
if(a[i]>b[i])
{
x += a[i]+b[i];
}
else if(a[i]<b[i])
{
y += a[i]+b[i];
}
else
{
x += a[i];
y += b[i];
}
}
cout <<x<<" "<<y<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
13 | for(i=1;i<=n;i++)
| ^
|
s911893613 | p00423 | C++ | #include <iostream>
using namespace std;
int main()
{
while(1){
int i, n, x, y;
cin >>n;
if(n=0){break;}
x=0;
y=0;
int a[n], b[n];
for(i=1;i<=n;i++)
{
cin >>a[i]>>b[i];
if(a[i]>b[i])
{
x += a[i]+b[i];
}
else if(a[i]<b[i])
{
y += a[i]+b[i];
}
else
{
x += a[i];
y += b[i];
}
}}
cout <<x<<" "<<y<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:34:10: error: 'x' was not declared in this scope
34 | cout <<x<<" "<<y<<"\n";
| ^
a.cc:34:18: error: 'y' was not declared in this scope
34 | cout <<x<<" "<<y<<"\n";
| ^
|
s312061220 | p00423 | C++ | #include<iostream>
using namespace std
int main () {
int n, i,A,B, resa =0, resb =0;
while(cin >> n,n){
for(i=0;i<n;i++){
cin >> A >> B;
(A > B)? resa +=A:resb+=B;
if(A==B) {resa += A; resb +=B};
}
cout << resa << " " << resb << endl;
}
} | a.cc:8:12: error: extended character is not valid in an identifier
8 | cin >> A >> B;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
12 | cout << resa << " " << resb << endl;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:2:20: error: expected ';' before 'int'
2 | using namespace std
| ^
| ;
3 |
4 | int main () {
| ~~~
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
8 | cin >> A >> B;
| ^~~~~
a.cc:10:43: error: expected ';' before '}' token
10 | if(A==B) {resa += A; resb +=B};
| ^
| ;
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
12 | cout << resa << " " << resb << endl;
| ^~~~~~~~~~~~
|
s335817809 | p00423 | C++ | #include<iostream>
using namespace std
int main () {
int n, i,A,B, resa =0, resb =0;
while(cin >> n,n){
for(i=0;i<n;i++){
cin >> A >> B;
(A > B)? resa +=A:resb+=B;
if(A==B) {resa += A; resb +=B};
}
cout << resa << " " << resb << endl;
}
} | a.cc:8:12: error: extended character is not valid in an identifier
8 | cin >> A >> B;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
12 | cout << resa << " " << resb << endl;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:2:20: error: expected ';' before 'int'
2 | using namespace std
| ^
| ;
3 |
4 | int main () {
| ~~~
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
8 | cin >> A >> B;
| ^~~~~
a.cc:10:43: error: expected ';' before '}' token
10 | if(A==B) {resa += A; resb +=B};
| ^
| ;
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
12 | cout << resa << " " << resb << endl;
| ^~~~~~~~~~~~
|
s101863717 | p00423 | C++ | #include<iostream>
using namespace std;
int main () {
int n, i,A,B, resa =0, resb =0;
while(cin >> n,n){
for(i=0;i<n;i++){
cin >> A >> B;
(A > B)? resa +=A:resb+=B;
if(A==B) {resa += A; resb +=B;};
}
cout << resa << " " << resb << endl;
}
} | a.cc:8:12: error: extended character is not valid in an identifier
8 | cin >> A >> B;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
12 | cout << resa << " " << resb << endl;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
8 | cin >> A >> B;
| ^~~~~
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
12 | cout << resa << " " << resb << endl;
| ^~~~~~~~~~~~
|
s643415701 | p00423 | C++ | #include<iostream>
using namespace std;
int main () {
int n, i,A,B, resa =0, resb =0;
while(cin >> n,n){
for(i=0;i<n;i++){
cin >> A >> B;
(A > B)? resa +=A:resb+=B;
if(A==B) {resa += A; resb +=B;};
}
cout << resa << " " << resb << endl;
}
} | a.cc:8:12: error: extended character is not valid in an identifier
8 | cin >> A >> B;
| ^
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
8 | cin >> A >> B;
| ^~~~~
|
s017054374 | p00423 | C++ | #include<iostream>
using namespace std;
int main () {
int n, i,A,B, resa =0, resb =0;
while(cin >> n,n){
for(i=0;i<n;i++){
cin >> A >> B;
(A > B)? resa +=A:resb+=B;
if(A==B) {resa += A; resb +=B;};
}
cout << resa << " " << resb << endl;
}
} | a.cc:12:1: error: extended character is not valid in an identifier
12 | cout << resa << " " << resb << endl;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
12 | cout << resa << " " << resb << endl;
| ^~~~~~~~~~~~
|
s153198396 | p00423 | C++ | #include<cstdio>
using namespace std;
int main(){
int n;
while (1){
int A = 0, B = 0;
scanf_s("%d", &n);
if (n == 0)return 0;
for (int i = 0; i < n; i++){
int a, b;
scanf_s("%d %d", &a, &b);
if (a > b){
a += b;
b = 0;
}
if (a < b){
b += a;
a = 0;
}
A += a;
B += b;
}
printf("%d %d\n", A, B);
}
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.