submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s221663788
p00014
C++
#include<iostream> using namespace std; int main(void){ int d; while(cin >> d){ int sum=0; for(int i=1;i<600/d;i++) sum+=i*i*d*d*d; cout << sum << endl; } retu
a.cc: In function 'int main()': a.cc:16:3: error: 'retu' was not declared in this scope 16 | retu | ^~~~ a.cc:16:7: error: expected '}' at end of input 16 | retu | ^ a.cc:5:15: note: to match this '{' 5 | int main(void){ | ^
s296692208
p00014
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Programminng { class AOJ_Volume0014 { public static void Main(string[] args) { while (true) { string input = Console.ReadLine(); ; if (string.IsNullOrEmpty(input)) break; int d = int.Parse(input); int value = 0, s = 0; while (value != 600 - d) { value += d; int line = value * value; s += line * d; } Console.WriteLine(s); } } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:10:15: error: expected ':' before 'static' 10 | public static void Main(string[] args) | ^~~~~~~ | : a.cc:10:33: error: 'string' has not been declared 10 | public static void Main(string[] args) | ^~~~~~ a.cc:10:42: error: expected ',' or '...' before 'args' 10 | public static void Main(string[] args) | ^~~~ a.cc:31:6: error: expected ';' after class definition 31 | } | ^ | ; a.cc: In static member function 'static void Programminng::AOJ_Volume0014::Main(int*)': a.cc:15:17: error: 'string' was not declared in this scope 15 | string input = Console.ReadLine(); ; | ^~~~~~ a.cc:16:42: error: 'input' was not declared in this scope; did you mean 'int'? 16 | if (string.IsNullOrEmpty(input)) break; | ^~~~~ | int a.cc:18:25: error: expected primary-expression before 'int' 18 | int d = int.Parse(input); | ^~~ a.cc:27:17: error: 'Console' was not declared in this scope 27 | Console.WriteLine(s); | ^~~~~~~
s943557442
p00014
C++
#include <iostream> int main(){ int d, menseki; while(std::cin >> d){ menseki = 0; for(int x = 0; x < 600; x+=d){ menseki += d * x * x; } std::cout << menseki << std::endl; } }
a.cc:6:9: error: extended character   is not valid in an identifier 6 | menseki = 0; | ^ a.cc:6:19: error: extended character   is not valid in an identifier 6 | menseki = 0; | ^ a.cc: In function 'int main()': a.cc:6:9: error: 'menseki\U00003000' was not declared in this scope; did you mean 'menseki'? 6 | menseki = 0; | ^~~~~~~~~ | menseki a.cc:6:19: error: '\U000030000' was not declared in this scope 6 | menseki = 0; | ^~~
s633617790
p00014
C++
#include <iostream> int main(){ int d, menseki; while(std::cin >> d){ menseki = 0; for(int x = 0; x < 600; x+=d){ menseki += d * x * x; } std::cout << menseki << std::endl; } }
a.cc:6:9: error: extended character   is not valid in an identifier 6 | menseki = 0; | ^ a.cc:6:19: error: extended character   is not valid in an identifier 6 | menseki = 0; | ^ a.cc: In function 'int main()': a.cc:6:9: error: 'menseki\U00003000' was not declared in this scope; did you mean 'menseki'? 6 | menseki = 0; | ^~~~~~~~~ | menseki a.cc:6:19: error: '\U000030000' was not declared in this scope 6 | menseki = 0; | ^~~
s858052713
p00014
C++
using namespace std;int main(){int a=0,d,i=0;while(cin>>d){for(;i<600;i+=d){a+=i*i*d;}cout<<a<<endl;}}
a.cc: In function 'int main()': a.cc:1:52: error: 'cin' was not declared in this scope 1 | using namespace std;int main(){int a=0,d,i=0;while(cin>>d){for(;i<600;i+=d){a+=i*i*d;}cout<<a<<endl;}} | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std;int main(){int a=0,d,i=0;while(cin>>d){for(;i<600;i+=d){a+=i*i*d;}cout<<a<<endl;}} a.cc:1:87: error: 'cout' was not declared in this scope 1 | using namespace std;int main(){int a=0,d,i=0;while(cin>>d){for(;i<600;i+=d){a+=i*i*d;}cout<<a<<endl;}} | ^~~~ a.cc:1:87: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:1:96: error: 'endl' was not declared in this scope 1 | using namespace std;int main(){int a=0,d,i=0;while(cin>>d){for(;i<600;i+=d){a+=i*i*d;}cout<<a<<endl;}} | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;int main(){int a=0,d,i=0;while(cin>>d){for(;i<600;i+=d){a+=i*i*d;}cout<<a<<endl;}}
s571214050
p00014
C++
#include<iostream> void main(){int i,d,s;while(std::cin>>d){s=0;for(i=0;i<600;i+=d){s+=d*i*i;}std::cout<<s<<std::endl;}}
a.cc:2:1: error: '::main' must return 'int' 2 | void main(){int i,d,s;while(std::cin>>d){s=0;for(i=0;i<600;i+=d){s+=d*i*i;}std::cout<<s<<std::endl;}} | ^~~~
s574569546
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class bi{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); int num = scan.nextInt(); for(int i=0;i<num;i++){ BigInteger bix = new BigInteger(scan.next()); BigInteger biy = new BigInteger(scan.next()); BigInteger add = bix.add(biy); System.out.println(add.toString()); } } }
Main.java:4: error: class bi is public, should be declared in a file named bi.java public class bi{ ^ 1 error
s697730048
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(0!=n--){ BigInteger a = sc.nextBigInteger(); BigInteger b = sc.nextBigInteger(); System.out.println(a.add(b)); } } }
Main.java:3: error: illegal character: '\u3000' public class?Main { ^ 1 error
s902185935
p00015
Java
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; import java.math.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { Scanner sc = new Scanner(System.in); int q = sc.nextInt(); for(int i = 0; i < q; ++i){ BigInteger n1 = sc.nextBigInteger(); BigInteger n2 = sc.nextBigInteger(); BigInteger ans = n1.add(n2); String sa = ans.toString(); if(sa.length() > 80){ System.out.println("overflow"); } else{ System.out.println(sa); } } }
Main.java:14: error: illegal start of type for(int i = 0; i < q; ++i){ ^ Main.java:14: error: > or ',' expected for(int i = 0; i < q; ++i){ ^ Main.java:14: error: illegal start of type for(int i = 0; i < q; ++i){ ^ Main.java:14: error: <identifier> expected for(int i = 0; i < q; ++i){ ^ 4 errors
s293858180
p00015
Java
import java.util.Scanner; import java.math.BigInteger; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0i<n;i++){ BigInteger a=sc.nextBigInteger(); BigInteger b=sc.nextBigInteger(); a=a.add(b); if(a.toString().length()>80{ System.out.println("overflow"); } else{ System.out.println(a); } } } }
Main.java:8: error: ';' expected for(int i=0i<n;i++){ ^ Main.java:12: error: ')' expected if(a.toString().length()>80{ ^ 2 errors
s941499820
p00015
Java
import java.util.Scanner; import java.math.BigInteger; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0;i<n;i++){ BigInteger a=sc.nextBigInteger(); BigInteger b=sc.nextBigInteger(); a=a.add(b); if(String.valeOf(a).length()>80){ System.out.println("overflow"); } else{ System.out.println(a); } } } }
Main.java:12: error: cannot find symbol if(String.valeOf(a).length()>80){ ^ symbol: method valeOf(BigInteger) location: class String 1 error
s627028864
p00015
Java
import java.util.Arrays; import java.util.Scanner; public class NationalBudget{ public static void main(String[] args){ byte[] bof = new byte[80]; Arrays.fill(bof, (byte)9); BigInteger overflow = new BigInteger(bof); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++){ String str1 = sc.next(); String str2 = sc.next(); byte[] b1 = strToByteArray(str1); byte[] b2 = strToByteArray(str2); BigInteger i1 = new BigInteger(b1); BigInteger i2 = new BigInteger(b2); BigInteger sum = BigInteger.sum(i1, i2); if(BigInteger.isABiggerThanB(i1, overflow) || BigInteger.isABiggerThanB(i2, overflow) || BigInteger.isABiggerThanB(sum, overflow)) System.out.println("overflow"); else System.out.println(sum); } sc.close(); } static byte[] strToByteArray(String cs) { byte[] result = new byte[cs.length()]; for(int i = 0; i < cs.length(); i++) { result[cs.length() - i - 1] = Byte.parseByte(Character.toString(cs.charAt(i))); } return result; } } class BigInteger{ byte[] ds; BigInteger(byte[] d){ int i; for(i = d.length-1; i > 0; i--) { if(d[i] != 0) break; } this.ds = Arrays.copyOfRange(d, 0, i+1); } static boolean isABiggerThanB(BigInteger a, BigInteger b) { if(a.ds.length > b.ds.length) return true; else if(a.ds.length < b.ds.length) return false; else { return a.ds[a.ds.length-1] > b.ds[b.ds.length-1]; } } static BigInteger sum(BigInteger i1, BigInteger i2) { if(isABiggerThanB(i1, i2)) return subsum(i1, i2); else return subsum(i2, i1); } static BigInteger subsum(BigInteger i1, BigInteger i2) { int digit = (i1.ds.length > i2.ds.length)? i1.ds.length + 2: i2.ds.length + 2; byte[] ds = new byte[digit]; boolean c_up = false; int i; for(i = 0; i < i1.ds.length; i++) { ds[i] = (i < i2.ds.length)? (byte) (i1.ds[i] + i2.ds[i]): i1.ds[i]; if(c_up) ds[i]++; if(ds[i] > 9) { ds[i] = (byte) (ds[i] % 10); c_up = true; }else c_up = false; } if(c_up) ds[i]++; return new BigInteger(ds); } public String toString() { StringBuffer sb = new StringBuffer(); for(int i = ds.length - 1; i >= 0; i-- ) { sb.append(ds[i]); } return sb.toString(); } }
Main.java:5: error: class NationalBudget is public, should be declared in a file named NationalBudget.java public class NationalBudget{ ^ 1 error
s053480543
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class AOJ15{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); for(int i = 0; i < n; i++){ String a = scan.next(); String b = scan.next(); BigInteger ab = (new BigInteger(a)).add(new BigInteger(b)); if(ab.toString().length() > 80) System.out.println("overflow"); else System.out.println(ab); } } }
Main.java:4: error: class AOJ15 is public, should be declared in a file named AOJ15.java public class AOJ15{ ^ 1 error
s061650729
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); BigInteger out=new BigInteger("1"); for(int i=1;i<80;i++){ out=out.multiply(new BigInteger("10")); } int n=sc.nextInt(); for(int i=0;i<n;i++){ BigInteger a=new BigInteger(sc.next()); BigInteger b=new BigInteger(sc.next()); a=a.add(b); if(a.min(out).equals(out)) System.out.println("overflow"); else System.out.println(a.toString()); } } }
Main.java:4: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s084934674
p00015
Java
import java.util.*; import java.math.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++) { BigInteger x = sc.nextBigInteger().add(sc.nextBigInteger()); if(x.toString.length() > 80) System.out.println("overflow"); else system.out.println(x); } } }
Main.java:9: error: cannot find symbol if(x.toString.length() > 80) System.out.println("overflow"); ^ symbol: variable toString location: variable x of type BigInteger Main.java:10: error: package system does not exist else system.out.println(x); ^ 2 errors
s705833369
p00015
Java
import java.util.*; import java.math.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++) { BigInteger x = sc.nextBigInteger().add(sc.nextBigInteger()); if(x.toString.length() > 80) System.out.println("overflow"); else System.out.println(x); } } }
Main.java:9: error: cannot find symbol if(x.toString.length() > 80) System.out.println("overflow"); ^ symbol: variable toString location: variable x of type BigInteger 1 error
s919248749
p00015
Java
class Main { public String conbineBigNumbers(String strA, String strB){ int lengthA = strA.length(); int lengthB = strB.length(); int numPartitionA = (int)Math.ceil(lengthA/9.0); int numPartitionB = (int)Math.ceil(lengthB/9.0); int carryOver = 0; String strSum = ""; for(int partNo = 0; partNo < Math.max(numPartitionA, numPartitionB); partNo++){ int aParts; int bParts; if(partNo >= numPartitionA){ aParts = 0; } else { aParts = Integer.parseInt(strA.substring(Math.max(0, lengthA - 9 * (partNo + 1)), lengthA - 9 * partNo)); } if(partNo >= numPartitionB){ bParts = 0; } else { bParts = Integer.parseInt(strB.substring(Math.max(0, lengthB - 9 * (partNo + 1)), lengthB - 9 * partNo)); } String newParts = String.valueOf((aParts + bParts + carryOver) % 1000000000); int newPartsLength = newParts.length(); if(newPartsLength < 9){ for(int i = 0; i < 9 - newPartsLength; i++) newParts = 0 + newParts; } strSum = newParts + strSum; carryOver = (aParts + bParts + carryOver) / 1000000000; } strSum = carryOver + strSum; strSum = strSum.replaceFirst("^0*", ""); return strSum; } public static void main(String[] args) throws NumberFormatException, IOException{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); int numSet = Integer.parseInt(br.readLine()); for(int iSet = 0; iSet < numSet; iSet++){ String strA = br.readLine(); String strB = br.readLine(); if(strA.length() > 80 || strB.length() >80){ System.out.println("overflow"); } else { Main nationalBudget = new Main(); String sum = nationalBudget.conbineBigNumbers(strA, strB); if(sum.length() > 80){ System.out.println("overflow"); } else { System.out.println(sum); } } } } }
Main.java:45: error: cannot find symbol public static void main(String[] args) throws NumberFormatException, IOException{ ^ symbol: class IOException location: class Main Main.java:46: error: cannot find symbol InputStreamReader isr = new InputStreamReader(System.in); ^ symbol: class InputStreamReader location: class Main Main.java:46: error: cannot find symbol InputStreamReader isr = new InputStreamReader(System.in); ^ symbol: class InputStreamReader location: class Main Main.java:47: error: cannot find symbol BufferedReader br = new BufferedReader(isr); ^ symbol: class BufferedReader location: class Main Main.java:47: error: cannot find symbol BufferedReader br = new BufferedReader(isr); ^ symbol: class BufferedReader location: class Main 5 errors
s423153625
p00015
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Vol0_0015 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); String num1,num2; int N = Integer.parseInt(str); String[] tmp1,tmp2; List<Integer> list_a = new ArrayList<Integer>(); List<Integer> list_b = new ArrayList<Integer>(); List<Integer> ans = new ArrayList<Integer>(); while(N-->0){ //??????????????? num1=br.readLine(); tmp1=num1.split(""); num2=br.readLine(); tmp2=num2.split(""); list_a.clear(); list_b.clear(); ans.clear(); if(tmp1.length>=tmp2.length){ for(int i=0;i<tmp1.length;i++){ list_a.add(Integer.parseInt(tmp1[tmp1.length-i-1])); } for(int i=0;i<tmp2.length;i++){ list_b.add(Integer.parseInt(tmp2[tmp2.length-i-1])); } }else{ for(int i=0;i<tmp2.length;i++){ list_a.add(Integer.parseInt(tmp2[tmp2.length-i-1])); } for(int i=0;i<tmp1.length;i++){ list_b.add(Integer.parseInt(tmp1[tmp1.length-i-1])); } } //?????????0??§????????? if(list_a.size()>list_b.size()){ //System.out.println("0??§????????????"); for(int i=list_b.size();i<list_a.size();i++){ list_b.add(i,0); } } /* //????´???§????????????????¢???? System.out.println("num1: "+num1+" tmp1.size:"+tmp1.length); System.out.println("num2: "+num2+" tmp2.size:"+tmp2.length); System.out.print("list_a: "); for(int i=0;i<list_a.size();i++){ System.out.print(list_a.get(i)+","); } System.out.println(); System.out.print("list_b: "); for(int i=0;i<list_b.size();i++){ System.out.print(list_b.get(i)+","); } System.out.println(); */ //???????¨???? int a,b; int loop = list_a.size(); boolean kuriage=false; for(int i=0;i<loop;i++){ //System.out.println("i="+i+"-----------------------------"); a=list_a.get(i); b=list_b.get(i); //System.out.println(i+":a(i)="+a+":b(i)="+b); if(a+b>=10){ if(i<loop-1){ int tmp = list_a.get(i+1); list_a.set(i+1,tmp+1); }else{ list_a.add(1); kuriage=true; } } ans.add((a+b)%10); //System.out.println("ans(i):"+ans.get(i)); } if(kuriage){ ans.add(list_a.get(list_a.size()-1)); } //ans?????? for(int i=ans.size()-1;i>=0;i--){ System.out.print(ans.get(i)); } System.out.println(); } } }
Main.java:7: error: class Vol0_0015 is public, should be declared in a file named Vol0_0015.java public class Vol0_0015 { ^ 1 error
s573545922
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for (int i = 0; i < n ; i++){ BigInteger a = new BigInteger(br.readLine()); BigInteger b = new BigInteger(br.readLine()); if (s.length() > 80){ System.out.println("overflow"); }else{ System.out.println(a.add(b)); } } } }
Main.java:12: error: cannot find symbol if (s.length() > 80){ ^ symbol: variable s location: class Main 1 error
s051789256
p00015
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ while(scan.hasNext()){ int N = scan.nextInt(); for(int i = 0; i < N; i++){ BigInteger a = scan.nextBigInteger(); BigInteger b = scan.nextBigInteger(); String num = String.valueOf(a.add(b)); if(num.length() > 80){ System.out.printf("%s\n", "overflow"); } else{ System.out.printf("%s\n", num); } } } } }
Main.java:10: error: cannot find symbol BigInteger a = scan.nextBigInteger(); ^ symbol: class BigInteger location: class Main Main.java:11: error: cannot find symbol BigInteger b = scan.nextBigInteger(); ^ symbol: class BigInteger location: class Main 2 errors
s653698378
p00015
Java
import java.math.BigDecimal; import java.util.Scanner; public class NationalBudget { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int count = Integer.parseInt(sc .nextLine()); for (int i = 0; i < count; i++) { String output = new BigDecimal(sc .nextLine()).add( new BigDecimal(sc .nextLine())) .toString(); if (output.length() > 80) { output = "overflow"; } System.out.println(output); } } }
Main.java:4: error: class NationalBudget is public, should be declared in a file named NationalBudget.java public class NationalBudget { ^ 1 error
s005429919
p00015
Java
import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int setNum = Integer.parseInt(sc.nextLine()); int inputNum = setNum * 2; String[][] inputSet = new String[setNum][2]; int cnt = 0; boolean zero = true; while (0 < inputNum--) { String input = sc.nextLine(); if(zero) inputSet[cnt][0] = input; else inputSet[cnt++][1] = input; zero = !zero; } for(int i=0; i < setNum; i++) { output(inputSet[i][0], inputSet[i][1]); } } public static void output(String a, String b) { String[] partA = slice(a); String[] partB = slice(b); String[] output = new String[10]; Long carry = 0L; int cnt = 0; for(int i=0; i < 9; i++) { Long x = Long.valueOf(partA[i] != null ? partA[i] : "0") + Long.valueOf(partB[i] != null ? partB[i] : "0") + carry; String y = String.valueOf(x); output[i] = y.length() <= 10 ? y : y.substring(y.length()-10); if(y.length() <= 10 && partA[i+1] == null && partB[i+1] == null) break; carry = y.length() <= 10 ? 0L : Long.valueOf(y.substring(0, y.length()-10)); cnt++; } if(cnt==8){ String buf = ""; for(int i=8; 0<=i; i--) { buf += output[i] != null ? output[i] : ""; } if(buf.length==80){ System.out.println(buf); } } if(partA[8] != null || partB[8] != null || 8 <= cnt) { System.out.println("overflow"); } else { for(int i=7; 0<=i; i--) { System.out.print(output[i] != null ? output[i] : ""); } System.out.println(); } } public static String[] slice(String a) { int len = a.length(); String[] ret = new String[10]; int cnt = 0; while(10 < len) { ret[cnt++] = a.substring(len-10, len); len = len - 10; } ret[cnt] = a.substring(0, len); return ret; } }
Main.java:51: error: cannot find symbol if(buf.length==80){ ^ symbol: variable length location: variable buf of type String 1 error
s826856217
p00015
Java
import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int setNum = Integer.parseInt(sc.nextLine()); int inputNum = setNum * 2; String[][] inputSet = new String[setNum][2]; int cnt = 0; boolean zero = true; while (0 < inputNum--) { String input = sc.nextLine(); if(zero) inputSet[cnt][0] = input; else inputSet[cnt++][1] = input; zero = !zero; } for(int i=0; i < setNum; i++) { output(inputSet[i][0], inputSet[i][1]); } } public static void output(String a, String b) { String[] partA = slice(a); String[] partB = slice(b); String[] output = new String[10]; Long carry = 0L; int cnt = 0; for(int i=0; i < 9; i++) { Long x = Long.valueOf(partA[i] != null ? partA[i] : "0") + Long.valueOf(partB[i] != null ? partB[i] : "0") + carry; String y = String.valueOf(x); output[i] = y.length() <= 10 ? y : y.substring(y.length()-10); if(y.length() <= 10 && partA[i+1] == null && partB[i+1] == null) break; carry = y.length() <= 10 ? 0L : Long.valueOf(y.substring(0, y.length()-10)); cnt++; } if(cnt==8){ String buf = ""; for(int i=8; 0<=i; i--) { buf += output[i] != null ? output[i] : ""; } if(buf.length()==80){ System.out.println(buf); } } if(partA[8] != null || partB[8] != null || 8 <= cnt) { System.out.println("overflow"); } else { for(int i=7; 0<=i; i--) { System.out.print(output[i] != null ? output[i] : ""); } System.out.println(); } } public static String[] slice(String a) { int len = a.length(); String[] ret = new String[10]; int cnt = 0; while(10 < len) { ret[cnt++] = a.substring(len-10, len); len = len - 10; } ret[cnt] = a.substring(0, len); return ret; }
Main.java:76: error: reached end of file while parsing } ^ 1 error
s983794194
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static main(String argv[]) { int num; BigDecimal bd1; BigDecimal bd2; BigDecimal sum; BufferReader br = new BufferReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigDecimal(ln1); bd2 = new BigDecimal(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:7: error: invalid method declaration; return type required public static main(String argv[]) { ^ 1 error
s171643877
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigDecimal bd1; BigDecimal bd2; BigDecimal sum; BufferReader br = new BufferReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigDecimal(ln1); bd2 = new BigDecimal(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:10: error: cannot find symbol BigDecimal bd1; ^ symbol: class BigDecimal location: class Main Main.java:11: error: cannot find symbol BigDecimal bd2; ^ symbol: class BigDecimal location: class Main Main.java:12: error: cannot find symbol BigDecimal sum; ^ symbol: class BigDecimal location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class InputStream location: class Main Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigDecimal(ln1); ^ symbol: class BigDecimal location: class Main Main.java:23: error: cannot find symbol bd1 = new BigDecimal(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigDecimal(ln2); ^ symbol: class BigDecimal location: class Main Main.java:24: error: cannot find symbol bd2 = new BigDecimal(ln2); ^ symbol: variable ln2 location: class Main Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 18 errors
s470473141
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferReader br = new BufferReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class InputStream location: class Main Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 14 errors
s430809426
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferReader br = new BufferReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class InputStream location: class Main Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 14 errors
s248317854
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferReader br = new BufferReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class BufferReader location: class Main Main.java:14: error: cannot find symbol BufferReader br = new BufferReader(new InputStream(System.in)); ^ symbol: class InputStream location: class Main Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 14 errors
s224945917
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:14: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStream(System.in)); ^ symbol: class InputStream location: class Main Main.java:15: error: cannot find symbol num = Integer.perseInt(br.readLine()); ^ symbol: method perseInt(String) location: class Integer Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 13 errors
s366393139
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStream(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:14: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStream(System.in)); ^ symbol: class InputStream location: class Main Main.java:15: error: cannot find symbol num = Integer.perseInt(br.readLine()); ^ symbol: method perseInt(String) location: class Integer Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 13 errors
s077079403
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.perseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:15: error: cannot find symbol num = Integer.perseInt(br.readLine()); ^ symbol: method perseInt(String) location: class Integer Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 12 errors
s682514886
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (num--) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:16: error: incompatible types: int cannot be converted to boolean while (num--) { ^ Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 11 errors
s954715626
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { ln1 = br.readLine(); ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:17: error: cannot find symbol ln1 = br.readLine(); ^ symbol: variable ln1 location: class Main Main.java:18: error: cannot find symbol ln2 = br.readLine(); ^ symbol: variable ln2 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln1 location: class Main Main.java:19: error: cannot find symbol if (ln1 == null || ln2 == null) break; ^ symbol: variable ln2 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln1 location: class Main Main.java:20: error: cannot find symbol if (ln1.length() > 80 || ln2.length() > 80) { ^ symbol: variable ln2 location: class Main Main.java:23: error: cannot find symbol bd1 = new BigInteger(ln1); ^ symbol: variable ln1 location: class Main Main.java:24: error: cannot find symbol bd2 = new BigInteger(ln2); ^ symbol: variable ln2 location: class Main Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 10 errors
s817981142
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:26: error: cannot find symbol if (sum.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 2 errors
s018110194
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); sum = bd1.add(bd2); if (sum.getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:26: error: cannot find symbol if (sum.getLength() > 80) { ^ symbol: method getLength() location: variable sum of type BigInteger Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 2 errors
s856719457
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); bd1.add(bd2); if (bd1.toString().getLength() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:26: error: cannot find symbol if (bd1.toString().getLength() > 80) { ^ symbol: method getLength() location: class String Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 2 errors
s774882971
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); bd1.add(bd2); if (bd1.toString().length() > 80) { Stream.in.println("overflow"); } System.out.println(sum); } } }
Main.java:27: error: package Stream does not exist Stream.in.println("overflow"); ^ 1 error
s320721474
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BigInteger sum; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); bd1.add(bd2); if (bd1.toString().length() > 80) { System.out.println("overflow"); } System.out.println(sum); } } }
Main.java:29: error: variable sum might not have been initialized System.out.println(sum); ^ Main.java:15: error: unreported exception IOException; must be caught or declared to be thrown num = Integer.parseInt(br.readLine()); ^ Main.java:17: error: unreported exception IOException; must be caught or declared to be thrown String ln1 = br.readLine(); ^ Main.java:18: error: unreported exception IOException; must be caught or declared to be thrown String ln2 = br.readLine(); ^ 4 errors
s557611411
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1 == null || ln2 == null) break; if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); bd1.add(bd2); if (bd1.toString().length() > 80) { System.out.println("overflow"); } System.out.println(bd1.toString()); } } }
Main.java:14: error: unreported exception IOException; must be caught or declared to be thrown num = Integer.parseInt(br.readLine()); ^ Main.java:16: error: unreported exception IOException; must be caught or declared to be thrown String ln1 = br.readLine(); ^ Main.java:17: error: unreported exception IOException; must be caught or declared to be thrown String ln2 = br.readLine(); ^ 3 errors
s393320673
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String argv[]) { int num; BigInteger bd1; BigInteger bd2; try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { String ln1 = br.readLine(); String ln2 = br.readLine(); if (ln1.length() > 80 || ln2.length() > 80) { System.out.println("overflow"); } bd1 = new BigInteger(ln1); bd2 = new BigInteger(ln2); bd1.add(bd2); if (bd1.toString().length() > 80) { System.out.println("overflow"); } System.out.println(bd1.toString()); } } catch Exception e) { } } }
Main.java:32: error: '(' expected catch Exception e) { ^ 1 error
s651841320
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String[] args) { int num; BigInteger bi1; BigInteger bi2; try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); num = Integer.parseInt(br.readLine()); while (--num >= 0) { bi1 = new BigInteger(br.readLine()); bi2 = new BigInteger(br.readLine()); if (bd1.toString().length() > 80 || bd2.toString().length() > 80) { System.out.println("overflow"); } bi1 = bi1.add(bi2); System.out.println((bi1.toString().length() > 80)? "overflow" : bi1.toString()); } } catch (Exception e) {} } }
Main.java:16: error: cannot find symbol if (bd1.toString().length() > 80 || bd2.toString().length() > 80) { ^ symbol: variable bd1 location: class Main Main.java:16: error: cannot find symbol if (bd1.toString().length() > 80 || bd2.toString().length() > 80) { ^ symbol: variable bd2 location: class Main 2 errors
s462471208
p00015
Java
public class Main { public static void main(String[] args) throws Exception { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(bf.readLine()); while(n-->0){ String n1=bf.readLine(); String n2=bf.readLine(); int[][] a = new int[3][81]; if(n1.length()>80||n2.length()>80){ System.out.println("overflow"); continue; } for(int i=0;i<81;i++)a[0][i]=a[1][i]=a[2][i]=0; for(int i=81-n1.length(),j=0;i<81;i++,j++)a[0][i]=Integer.parseInt(n1.substring(j,j+1)); for(int i=81-n2.length(),j=0;i<81;i++,j++)a[1][i]=Integer.parseInt(n2.substring(j,j+1)); for(int i=80;i>0;i--){ a[2][i]+=a[0][i]+a[1][i]; if(a[2][i]>=10){a[2][i]-=10;a[2][i-1]++;} } if(a[2][0]>0){ System.out.println("overflow"); }else{ int i=0; while(i<80&&a[2][++i]==0); while(i<81)System.out.print(a[2][i++]); System.out.print("\n"); } } } }
Main.java:3: error: cannot find symbol BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main 3 errors
s273332835
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.nextString(), b = scanner.nextString(); BigInteger sum = BigInteger(a) + BigInteger(b); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } if (sum >= BigInteger(n_80)) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:9: error: cannot find symbol String a = scanner.nextString(), b = scanner.nextString(); ^ symbol: method nextString() location: variable scanner of type Scanner Main.java:9: error: cannot find symbol String a = scanner.nextString(), b = scanner.nextString(); ^ symbol: method nextString() location: variable scanner of type Scanner Main.java:10: error: cannot find symbol BigInteger sum = BigInteger(a) + BigInteger(b); ^ symbol: method BigInteger(String) location: class Main Main.java:10: error: cannot find symbol BigInteger sum = BigInteger(a) + BigInteger(b); ^ symbol: method BigInteger(String) location: class Main Main.java:15: error: cannot find symbol if (sum >= BigInteger(n_80)) { ^ symbol: method BigInteger(String) location: class Main 5 errors
s538324493
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.nextString(), b = scanner.nextString(); BigInteger sum = add(BigInteger(a) , BigInteger(b)); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } if (sum.compareTo(BigInteger(n_80), >=, 0)) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:15: error: illegal start of expression if (sum.compareTo(BigInteger(n_80), >=, 0)) { ^ Main.java:15: error: illegal start of expression if (sum.compareTo(BigInteger(n_80), >=, 0)) { ^ 2 errors
s625167456
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.nextString(), b = scanner.nextString(); BigInteger sum = add(BigInteger(a) , BigInteger(b)); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } if (sum.compareTo(BigInteger(n_80)) >= 0) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:9: error: cannot find symbol String a = scanner.nextString(), b = scanner.nextString(); ^ symbol: method nextString() location: variable scanner of type Scanner Main.java:9: error: cannot find symbol String a = scanner.nextString(), b = scanner.nextString(); ^ symbol: method nextString() location: variable scanner of type Scanner Main.java:10: error: cannot find symbol BigInteger sum = add(BigInteger(a) , BigInteger(b)); ^ symbol: method BigInteger(String) location: class Main Main.java:10: error: cannot find symbol BigInteger sum = add(BigInteger(a) , BigInteger(b)); ^ symbol: method BigInteger(String) location: class Main Main.java:15: error: cannot find symbol if (sum.compareTo(BigInteger(n_80)) >= 0) { ^ symbol: method BigInteger(String) location: class Main 5 errors
s670641241
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.nextString(), b = scanner.nextString(); BigInteger sum = BigInteger.add(BigInteger(a) , BigInteger(b)); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } if (sum.compareTo(BigInteger(n_80)) >= 0) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:9: error: cannot find symbol String a = scanner.nextString(), b = scanner.nextString(); ^ symbol: method nextString() location: variable scanner of type Scanner Main.java:9: error: cannot find symbol String a = scanner.nextString(), b = scanner.nextString(); ^ symbol: method nextString() location: variable scanner of type Scanner Main.java:10: error: cannot find symbol BigInteger sum = BigInteger.add(BigInteger(a) , BigInteger(b)); ^ symbol: method BigInteger(String) location: class Main Main.java:10: error: cannot find symbol BigInteger sum = BigInteger.add(BigInteger(a) , BigInteger(b)); ^ symbol: method BigInteger(String) location: class Main Main.java:15: error: cannot find symbol if (sum.compareTo(BigInteger(n_80)) >= 0) { ^ symbol: method BigInteger(String) location: class Main 5 errors
s443211899
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.next(), b = scanner.next(); BigInteger A(a), B(b); BigInteger sum = BigInteger.add(A, B); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } BigInteger N_80(n_80); if (sum.compareTo(N_80) >= 0) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:10: error: ';' expected BigInteger A(a), B(b); ^ Main.java:10: error: not a statement BigInteger A(a), B(b); ^ Main.java:10: error: ';' expected BigInteger A(a), B(b); ^ Main.java:16: error: ';' expected BigInteger N_80(n_80); ^ Main.java:16: error: not a statement BigInteger N_80(n_80); ^ Main.java:16: error: ';' expected BigInteger N_80(n_80); ^ 6 errors
s486773023
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.next(), b = scanner.next(); BigInteger A = BigInteger(a), B = BigInteger(b); BigInteger sum = BigInteger.add(A, B); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } BigInteger N_80 = BigInteger(n_80); if (sum.compareTo(N_80) >= 0) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:10: error: cannot find symbol BigInteger A = BigInteger(a), B = BigInteger(b); ^ symbol: method BigInteger(String) location: class Main Main.java:10: error: cannot find symbol BigInteger A = BigInteger(a), B = BigInteger(b); ^ symbol: method BigInteger(String) location: class Main Main.java:11: error: no suitable method found for add(BigInteger,BigInteger) BigInteger sum = BigInteger.add(A, B); ^ method BigInteger.add(int[],long) is not applicable (argument mismatch; BigInteger cannot be converted to int[]) method BigInteger.add(int[],int[]) is not applicable (argument mismatch; BigInteger cannot be converted to int[]) Main.java:16: error: cannot find symbol BigInteger N_80 = BigInteger(n_80); ^ symbol: method BigInteger(String) location: class Main Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 4 errors
s829810145
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.next(), b = scanner.next(); BigInteger A = new BigInteger(a), B = new BigInteger(b); BigInteger sum = BigInteger.add(A, B); String n_80 = "1"; for (int j = 0; j < 79; j++) { n_80 += "0"; } BigInteger N_80 = new BigInteger(n_80); if (sum.compareTo(N_80) >= 0) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:11: error: no suitable method found for add(BigInteger,BigInteger) BigInteger sum = BigInteger.add(A, B); ^ method BigInteger.add(int[],long) is not applicable (argument mismatch; BigInteger cannot be converted to int[]) method BigInteger.add(int[],int[]) is not applicable (argument mismatch; BigInteger cannot be converted to int[]) Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s334162590
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.next(), b = scanner.next(); BigInteger sum = new BigInteger(a), A = new BigInteger(b); sum.add(A); if ((sum.toString()).length > 80) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:13: error: cannot find symbol if ((sum.toString()).length > 80) { ^ symbol: variable length location: class String 1 error
s353665285
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class a0015{ public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); for (int i = 0; i < N; i++) { String a = scanner.next(), b = scanner.next(); BigInteger A = new BigInteger(a), B = new BigInteger(b); BigInteger sum = A.add(B); if ((sum.toString()).length() > 80) { System.out.println("overflow"); } else { System.out.println(sum.toString()); } } } }
Main.java:4: error: class a0015 is public, should be declared in a file named a0015.java public class a0015{ ^ 1 error
s200285508
p00015
Java
main(){ int n,c,d,x,y,z,o=0,e; char p[100],q[100],r[100]; scanf("%d",&n); while(n>0) { e=c=d=0; scanf("%s %s",p,q); while(p[++c]!='\0'){} c--; while(q[++d]!='\0'){} d--; // printf("%c %c\n",p[c],q[d]); // if(c>=80 ) while(c>=0 || d>=0 || o>0) { if(c>=0) x=(int)p[c--]-'0'; else x=0; if(d>=0) y=(int)q[d--]-'0'; else y=0; z=x+y+o; if(z>9) o=1; else o=0; r[e++]=(char)('0'+(z%10)); } e--; for(;e>=0;e--) printf("%c",r[e]); printf("\n"); n--; } return 0; }
Main.java:1: error: class, interface, enum, or record expected main(){ ^ Main.java:3: error: class, interface, enum, or record expected char p[100],q[100],r[100]; ^ Main.java:4: error: class, interface, enum, or record expected scanf("%d",&n); ^ Main.java:5: error: class, interface, enum, or record expected while(n>0) ^ Main.java:8: error: class, interface, enum, or record expected scanf("%s %s",p,q); ^ Main.java:9: error: class, interface, enum, or record expected while(p[++c]!='\0'){} ^ Main.java:11: error: class, interface, enum, or record expected while(q[++d]!='\0'){} ^ Main.java:15: error: class, interface, enum, or record expected while(c>=0 || d>=0 || o>0) ^ Main.java:19: error: class, interface, enum, or record expected else ^ Main.java:21: error: class, interface, enum, or record expected if(d>=0) ^ Main.java:23: error: class, interface, enum, or record expected else ^ Main.java:25: error: class, interface, enum, or record expected z=x+y+o; ^ Main.java:26: error: class, interface, enum, or record expected if(z>9) ^ Main.java:28: error: class, interface, enum, or record expected else ^ Main.java:30: error: class, interface, enum, or record expected r[e++]=(char)('0'+(z%10)); ^ Main.java:32: error: class, interface, enum, or record expected } ^ Main.java:34: error: class, interface, enum, or record expected for(;e>=0;e--) ^ Main.java:34: error: class, interface, enum, or record expected for(;e>=0;e--) ^ Main.java:34: error: class, interface, enum, or record expected for(;e>=0;e--) ^ Main.java:36: error: class, interface, enum, or record expected printf("\n"); ^ Main.java:37: error: class, interface, enum, or record expected n--; ^ Main.java:38: error: class, interface, enum, or record expected } ^ Main.java:40: error: class, interface, enum, or record expected } ^ 23 errors
s633033551
p00015
Java
import java.math.BigDecimal; import java.util.Scanner; public class p0015{ public p0015(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++){ BigDecimal f = new BigDecimal(sc.next()); BigDecimal s = new BigDecimal(sc.next()); f = f.add(s); System.out.println(f); } } public static void main(String[] args){ p0015 test = new p0015(); } }
Main.java:4: error: class p0015 is public, should be declared in a file named p0015.java public class p0015{ ^ 1 error
s047992915
p00015
Java
import java.math.BigDecimal; import java.util.Scanner; public class p0015{ public p0015(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++){ BigDecimal f = new BigDecimal(sc.next()); BigDecimal s = new BigDecimal(sc.next()); f = f.add(s); String str = f.toString(); if(str.length() > 80){ System.out.println("overflow"); } else { System.out.println(str); } } } public static void main(String[] args){ p0015 test = new p0015(); } }
Main.java:4: error: class p0015 is public, should be declared in a file named p0015.java public class p0015{ ^ 1 error
s489521646
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class SubMain { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); BigInteger a,b,c; while(n--!=0){ a=sc.nextBigInteger(); b=sc.nextBigInteger(); c=a.add(b); if(c.toString().length()>80){ System.out.println("overflow"); } else{ System.out.println(c); } } } }
Main.java:3: error: class SubMain is public, should be declared in a file named SubMain.java public class SubMain { ^ 1 error
s580976301
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class AOJ0015 { public static void main(String[] args){ String numstr = ""; for(int i = 0; i < 79; i++){ numstr += "9"; } int n; BigInteger a,b,c; BigInteger max = new BigInteger(numstr); //numstr : 9999 ... 999 Scanner sc = new Scanner(System.in); n = sc.nextInt(); for(int i = 0; i < n; i++){ a = sc.nextBigInteger(); b = sc.nextBigInteger(); c = a.add(b); if(c.compareTo(max) > 0){ System.out.println("overflow"); }else{ System.out.println(c.toString()); } } } }
Main.java:4: error: class AOJ0015 is public, should be declared in a file named AOJ0015.java public class AOJ0015 { ^ 1 error
s604937696
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class Main { public static void main(String[] args){ String numstr = ""; for(int i = 0; i < 80; i++){ numstr += "9"; } int n; BigInteger a,b,c; BigInteger max = new BigInteger(numstr); //numstr : 9999 ... 999 Scanner sc = new Scanner(System.in); n = sc.nextInt(); for(int i = 0; i < n; i++){ a = sc.nextBigInteger(); b = sc.nextBigInteger(); c = a.add(b); if(c.compareTo(max) > 0){ System.out.println("overflow"); }else{ System.out.println(c.toString()); } } }
Main.java:25: error: reached end of file while parsing } ^ 1 error
s844235449
p00015
Java
import java.uitl.*; import java.math.BigDecimal; public class Main{ public static void main(String[] args){ Scanner sc = new Scaner(System.in); int n = sc.nextInt(); while(n!=0){ BigDecimal a = new BigDecimal(sc.next()); BigDecimal b = new BigDecimal(sc.next()); BigDecimal sum = a.add(b); if(a.toString().length()>80 || b.toString().length()>80 || sum.toString().length()>80){ System.out.println("overflow"); }else{ System.out.println(ans); } n--; } } }
Main.java:1: error: package java.uitl does not exist import java.uitl.*; ^ Main.java:6: error: cannot find symbol Scanner sc = new Scaner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol Scanner sc = new Scaner(System.in); ^ symbol: class Scaner location: class Main Main.java:18: error: cannot find symbol System.out.println(ans); ^ symbol: variable ans location: class Main 4 errors
s617731354
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class aoj0015 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int num = s.nextInt(); for(int i=0 ; i<num ; i++){ BigInteger a = new BigInteger(s.next()); BigInteger b = new BigInteger(s.next()); BigInteger c = a.add(b); String d = c.toString(); if(d.length()>80) System.out.println("overflow"); else System.out.println(c); } } }
Main.java:4: error: class aoj0015 is public, should be declared in a file named aoj0015.java public class aoj0015 { ^ 1 error
s337528435
p00015
Java
import java.util.Scanner; public class Main { private static final int _8KETA = 100000000; // あえてBigIntegerは使わない方法で public static void main(String[] args) { Scanner in = new Scanner(System.in); for (int dataSet = in.nextInt(); dataSet > 0; dataSet--) { String a = in.next(); String b = in.next(); boolean isOverflow = a.length() > 80 || b.length() > 80; int[] cal = new int[10]; if (!isOverflow) { int[] aVal = makeIntArray(a); int[] bVal = makeIntArray(b); for (int i = 0; i < 10; i++) { int ai = aVal[i]; int bi = bVal[i]; int cali = ai + bi; cal[i] = cali % _8KETA; if (cali >= _8KETA) { if (i == 9) isOverflow = true; else aVal[i + 1] += cali / _8KETA; } } } if (isOverflow) { System.out.println("overflow"); } else { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 10; i++) { sb.insert(0, cal[i]); if (cal[i] < 1000000) { sb.insert(0, "00000000", 0, 8 - (sb.length() % 8)); } } while (sb.charAt(0) == '0' && sb.length() != 1) { sb.deleteCharAt(0); } System.out.println(sb); } } }
Main.java:45: error: reached end of file while parsing } ^ 1 error
s552248327
p00015
Java
import java.util.Arrays; import java.util.Scanner; public class Main0015 { private static Scanner scan; public static void main(String[] args) { scan = new Scanner(System.in); int a[] = new int[80]; int b[] = new int[80]; int c[] = new int[81]; int n = Integer.parseInt(scan.next()); for(int i = 0;i < n;i++){ Arrays.fill(a,0); Arrays.fill(b,0); Arrays.fill(c,0); String as = scan.next(); String bs = scan.next(); int al = as.length(); int bl = bs.length(); if(al > 80 || bl > 80){ System.out.println("pverflow"); continue; } int cl = Math.max(al,bl); int m = 79; while(al > 0 || bl > 0){ if(al > 0){ al--; a[m] = Integer.parseInt("" + as.charAt(al)); } if(bl > 0){ bl--; b[m] = Integer.parseInt("" + bs.charAt(bl)); } m--; } for(int j = 79;j >= 79 - cl + 1;j--){ c[j + 1] = c[j + 1] + a[j] + b[j]; if(c[j + 1] >= 10){ c[j] = c[j] + 1; c[j + 1] = c[j + 1] - 10; } } if(c[0] != 0){ System.out.println("overflow"); }else{ for(int j = 0 ;j <= 80;j++){ if(c[j] != 0){ for(int k = j;k <= 80;k++){ System.out.print(c[k]); } break; } } } System.out.println(); } System.exit(0); } }
Main.java:4: error: class Main0015 is public, should be declared in a file named Main0015.java public class Main0015 { ^ 1 error
s770941895
p00015
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); for(int i = 0; i < N; i++) { char[] a = in.next().toCharArray(), b = in.next().toCharArray(); System.out.println(solve(a,b)); } } static String solve(char[] ac, char[] bc) { StringBuilder ans = new StringBuilder(); if(ac.length > 80 || bc.length > 80) return "overflow"; int[] sum = new int[100]; int max = max(ac.length, bc.length); int[] a = new int[max], b = new int[max]; int count = 0; for(int i = max-ac.length; i < max ; i++) { a[i] = Character.digit(ac[count++],10); } count = 0; for(int i = max-bc.length; i < max ; i++) { b[i] = Character.digit(bc[count++],10); } int num = sum.length-1; for(int i = max-1; i>=0; i--) { int x = sum[num]+a[i]+b[i]; if(x<10) { sum[num]=x; } else { char[] s = String.valueOf(x).toCharArray(); sum[num - 1] += Character.digit(s[0], 10); sum[num] = Character.digit(s[1], 10); } num--; } boolean flg = false; for(int x : sum){ if(!flg && x!=0) flg=true; if(flg) ans.append(x); } return ans.length() > 80 ? "overflow" : ans.toString(); } }
Main.java:15: error: cannot find symbol int max = max(ac.length, bc.length); ^ symbol: method max(int,int) location: class Main 1 error
s555496337
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class Test{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); for(int i = 0;i<n;i++){ String inputBigInt1 = stdIn.next(); String inputBigInt2 = stdIn.next(); if(inputBigInt1.length() >= 80 | inputBigInt2.length() >= 80){ System.out.println("overflow"); break; } BigInteger bigInt1 = new BigInteger(inputBigInt1); BigInteger bigInt2 = new BigInteger(inputBigInt2); BigInteger sumBigInt = bigInt1.add(bigInt2); if(sumBigInt.toString().length() >= 80){ System.out.println("overflow"); break; } System.out.println(sumBigInt); } } }
Main.java:4: error: class Test is public, should be declared in a file named Test.java public class Test{ ^ 1 error
s160979697
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class Test{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); for(int i = 0;i<n;i++){ String inputBigInt1 = stdIn.next(); String inputBigInt2 = stdIn.next(); if(inputBigInt1.length() >= 80 | inputBigInt2.length() >= 80){ System.out.println("overflow"); break; } BigInteger bigInt1 = new BigInteger(inputBigInt1); BigInteger bigInt2 = new BigInteger(inputBigInt2); BigInteger sumBigInt = bigInt1.add(bigInt2); if(sumBigInt.toString().length() >= 80){ System.out.println("overflow"); break; } System.out.println(sumBigInt); } } }
Main.java:4: error: class Test is public, should be declared in a file named Test.java public class Test{ ^ 1 error
s870458922
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class Test{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); for(int i = 0;i<n;i++){ String inputBigInt1 = stdIn.next(); String inputBigInt2 = stdIn.next(); if(inputBigInt1.length() >= 80 | inputBigInt2.length() >= 80){ System.out.println("overflow"); continue; } BigInteger bigInt1 = new BigInteger(inputBigInt1); BigInteger bigInt2 = new BigInteger(inputBigInt2); BigInteger sumBigInt = bigInt1.add(bigInt2); if(sumBigInt.toString().length() >= 80){ System.out.println("overflow"); continue; } System.out.println(sumBigInt); } } }
Main.java:4: error: class Test is public, should be declared in a file named Test.java public class Test{ ^ 1 error
s435786886
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class Test{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); for(int i = 0;i<n;i++){ String inputBigInt1 = stdIn.next(); String inputBigInt2 = stdIn.next(); if(inputBigInt1.length() > 80 | inputBigInt2.length() > 80){ System.out.println("overflow"); continue; } BigInteger bigInt1 = new BigInteger(inputBigInt1); BigInteger bigInt2 = new BigInteger(inputBigInt2); BigInteger sumBigInt = bigInt1.add(bigInt2); if(sumBigInt.toString().length() > 80){ System.out.println("overflow"); continue; } System.out.println(sumBigInt); } } }
Main.java:4: error: class Test is public, should be declared in a file named Test.java public class Test{ ^ 1 error
s304743889
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.Stack; public class B3 { public static void main(String[] arg) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for(int i=0; i<n; i++) { String s1 = br.readLine(); String s2 = br.readLine(); if(s1.length() > 80 || s2.length() > 80) System.out.println("overflow"); else if ((s1.length() < 10) && (s2.length() < 10)) { System.out.println(Integer.parseInt(s1.toString()) + Integer.parseInt(s2.toString())); } else { Stack budget = cal(s1,s2); int m = budget.size(); if( m > 80 ) System.out.println("overflow"); else { for(int j=0; j<m; j++) System.out.print(budget.pop()); System.out.println(); } } } } private static Stack cal(String s1, String s2) { Stack<Integer> a = new Stack<Integer>(); Stack<Integer> b = new Stack<Integer>(); Stack<Integer> c = new Stack<Integer>(); char[] char1 = s1.toCharArray(); char[] char2 = s2.toCharArray(); int lenA = char1.length, lenB = char2.length, max = Math.max(lenA, lenB); for(int i=0; i< lenA; i++) a.push(Integer.parseInt(char1[i]+"")); for(int i=0; i< lenB; i++) b.push(Integer.parseInt(char2[i]+"")); int temp=0, roundup=0; //determine whether round up is needed for(int i=0; i<max; i++) { if( !a.isEmpty() && !b.isEmpty() ) { temp = a.pop() + b.pop() + roundup; } else if( a.isEmpty() ) { temp = b.pop() + roundup; } else { temp = a.pop() + roundup; } if(temp>9) {roundup = 1; temp-=10;} else roundup = 0; c.push(temp); if(i==max-1 && roundup == 1) c.push(1); } return c; } }
Main.java:6: error: class B3 is public, should be declared in a file named B3.java public class B3 ^ 1 error
s609400969
p00015
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.Stack; public class Main { public static void main(String[] arg) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for(int i=0; i<n; i++) { String s1 = br.readLine(); String s2 = br.readLine(); if(s1.length() > 80 || s2.length() > 80) System.out.println("overflow"); else if ((s1.length() < 10) && (s2.length() < 10)) { System.out.println(Integer.parseInt(s1.toString()) + Integer.parseInt(s2.toString())); } else { Stack budget = cal(s1,s2); int m = budget.size(); if( m > 80 ) System.out.println("overflow"); else { for(int j=0; j<m; j++) System.out.print(budget.pop()); System.out.println(); } } } } private static Stack cal(String s1, String s2) { Stack<Byte> a = new Stack<Byte>(); Stack<Byte> b = new Stack<Byte>(); Stack<Byte> c = new Stack<Byte>(); char[] char1 = s1.toCharArray(); char[] char2 = s2.toCharArray(); int lenA = char1.length, lenB = char2.length, max = Math.max(lenA, lenB); for(int i=0; i< lenA; i++) a.push(Byte.parseByte(char1[i]+"")); for(int i=0; i< lenB; i++) b.push(Byte.parseByte(char2[i]+"")); byte temp=0, roundup=0; //determine whether round up is needed for(int i=0; i<max; i++) { if( !a.isEmpty() && !b.isEmpty() ) { temp = a.pop() + b.pop() + roundup; } else if( a.isEmpty() ) { temp = b.pop() + roundup; } else { temp = a.pop() + roundup; } if(temp>9) {roundup = 1; temp-=10;} else roundup = 0; c.push(temp); if(i==max-1 && roundup == 1) c.push((byte)1); } return c; } }
Main.java:52: error: incompatible types: possible lossy conversion from int to byte temp = a.pop() + b.pop() + roundup; ^ Main.java:54: error: incompatible types: possible lossy conversion from int to byte temp = b.pop() + roundup; ^ Main.java:56: error: incompatible types: possible lossy conversion from int to byte temp = a.pop() + roundup; ^ 3 errors
s246928297
p00015
Java
mport java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner input = new Scanner(System.in); int n = input.nextInt(); input.nextLine(); for(int i = 0 ; i < n ; i++){ BigInteger a = new BigInteger(input.nextLine()); BigInteger b = new BigInteger(input.nextLine()); if(a.add(b).toString().length() < 80){ System.out.println(a.add(b)); }else{ System.out.println("overflow"); } } } }
Main.java:1: error: class, interface, enum, or record expected mport java.math.BigInteger; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.Scanner; ^ 2 errors
s972513410
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class Aoj0015 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int dataset = scan.nextInt(); for(int i = 0; i < dataset; i++) { BigInteger a = scan.nextBigInteger(); BigInteger b = scan.nextBigInteger(); System.out.println(a.add(b)); } } }
Main.java:5: error: class Aoj0015 is public, should be declared in a file named Aoj0015.java public class Aoj0015 ^ 1 error
s130413148
p00015
Java
import java.math.BigInteger; import java.util.Scanner; public class main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int dataset = scan.nextInt(); for(int i = 0; i < dataset; i++) { BigInteger a = scan.nextBigInteger(); BigInteger b = scan.nextBigInteger(); System.out.println(a.add(b)); } } }
Main.java:5: error: class main is public, should be declared in a file named main.java public class main ^ 1 error
s412161524
p00015
Java
public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(in.readLine()); BigInteger a,b; for (int i = 0; i < N; i++) { a = new BigInteger(in.readLine()); b = new BigInteger(in.readLine()); if(a.toString().length()>80||b.toString().length()>80) System.out.println("overflow"); a=a.add(b); if(a.toString().length()>80) System.out.println("overflow"); else { System.out.println(a.toString()); } } } }
Main.java:2: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:3: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:5: error: cannot find symbol BigInteger a,b; ^ symbol: class BigInteger location: class Main Main.java:7: error: cannot find symbol a = new BigInteger(in.readLine()); ^ symbol: class BigInteger location: class Main Main.java:8: error: cannot find symbol b = new BigInteger(in.readLine()); ^ symbol: class BigInteger location: class Main 7 errors
s745357606
p00015
Java
public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(in.readLine()); BigInteger a,b; for (int i = 0; i < N; i++) { a = new BigInteger(in.readLine()); b = new BigInteger(in.readLine()); if(a.toString().length()>80||b.toString().length()>80){ System.out.println("overflow"); continue; } a=a.add(b); if(a.toString().length()>80) System.out.println("overflow"); else { System.out.println(a.toString()); } } } }
Main.java:2: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:3: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:5: error: cannot find symbol BigInteger a,b; ^ symbol: class BigInteger location: class Main Main.java:7: error: cannot find symbol a = new BigInteger(in.readLine()); ^ symbol: class BigInteger location: class Main Main.java:8: error: cannot find symbol b = new BigInteger(in.readLine()); ^ symbol: class BigInteger location: class Main 7 errors
s490950146
p00015
Java
import java.util.Scanner; import java.math.BigInteger; public class p0015{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; ++i){ BigInteger bi1 = new BigInteger(sc.next()); BigInteger bi2 = new BigInteger(sc.next()); String result = (bi1.add(bi2)).toString(); if(result.length() > 80){ result = "overflow"; } System.out.println(result); } } }
Main.java:4: error: class p0015 is public, should be declared in a file named p0015.java public class p0015{ ^ 1 error
s724039342
p00015
Java
mport java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t--!=0){ BigInteger b = sc.nextBigInteger().add(sc.nextBigInteger()); System.out.println(b.toString().length()>80?"overflow":b.toString()); } } }
Main.java:1: error: class, interface, enum, or record expected mport java.math.BigInteger; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.Scanner; ^ 2 errors
s772427360
p00015
Java
import java.util.*; import java.math.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int rep = sc.nextInt(); for(int u = 0; u < rep; u++){ String a = sc.next(); String b = sc.next(); int longer; if(a.length() > b.length()){ longer = a.length(); }else{ longer = b.length(); } int[] sum = new int[longer+1]; int memory = 0; for(int i = 1; i <= longer; i++){ if(a.length() >= i && b.length() >= i){ memory = Integer.parseInt("" + a.charAt(a.length()-i)) + Integer.parseInt("" + b.charAt(b.length()-i)) + memory; sum[i-1] = memory % 10; memory = memory / 10; }else if(a.length() >= i && b.length() < i){ memory = Integer.parseInt("" + a.charAt(a.length()-i)) + memory; sum[i-1] = memory % 10; memory = memory / 10; }else{ memory = Integer.parseInt("" + b.charAt(b.length()-i)) + memory; sum[i-1] = memory % 10; memory = memory / 10; } } sum[longer] = memory; if(longer > 80 || (longer == 80 && sum[80] > 0)){ System.out.println("overflow") continue; } boolean zero_check = true; for(int i = longer; i > 0; i--){ if(zero_check && sum[i] == 0){ continue; }else if(zero_check && sum[i] > 0){ zero_check = false; System.out.print(sum[i]); }else{ System.out.print(sum[i]); } } System.out.println(sum[0]); } } }
Main.java:41: error: ';' expected System.out.println("overflow") ^ 1 error
s567139519
p00015
C
# include <stdio.h> # include <math.h> # include <string> #define digit_max 80 #define N 50 int main(){ int sample = 0; scanf("%d",&sample); for (int i = 0; i < sample; i++) { char temp1[101],temp2[101]; scanf("%s%s",temp1, temp2); int len1 = strlen(temp1); int len2 = strlen(temp2); int number[101] = {0}; int l = 0; if (len1 > 80 || len2 > 80) { printf("%s", "overflow"); } else if (len1 > len2) { l = len1; for (int i = 0; i < len1; i++) { if (i < len2) { int a = (temp1[len1-1-i] - '0'); int b = (temp2[len2-1-i] - '0'); number[i] = a+b; } else { int a = (temp1[len1-1-i] - '0'); number[i] = a; } }//for for (int i=0; i < len1; i ++) { if (number[i] > 9) { number[i+1]++; number[i] = number[i]-10; } } } else { l = len2; for (int i = 0; i < len2; i++) { if (i < len1) { int a = (temp1[len1-1-i] - '0'); int b = (temp2[len2-1-i] - '0'); number[i] = a+b; } else { int a = (temp2[len2-1-i] - '0'); number[i] = a; } }//for for (int i=0; i < len2; i ++) { if (number[i] > 9) { number[i+1]++; number[i] = number[i]-10; } } } if (number[l] != 0) printf("%d", number[l]); for (int i = 0; i < l; i++) { printf("%d", number[l-i-1]); } printf("\n"); } return 0; }
main.c:3:11: fatal error: string: No such file or directory 3 | # include <string> | ^~~~~~~~ compilation terminated.
s261431382
p00015
C
#include<stdio.h> #include<string.h> int c[100]; void add(char*a, char*b) //鮟倩ョ、a豈巴髟ソ { int i,j; for(i=0; i<100;i++) c[i]=0;//蜥檎噪蜷?ス咲スョ髮カ int la=strlen(a), lb=strlen(b); for( i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス? { c[i]+=a[i-1]-'0'+b[j-1]-'0'; if(c[i]>9) { c[i]-=10; c[i-1]++; } } for( i=la-lb;i>0;i--) { c[i]+=a[i-1]-'0'; if(c[i]>9) { c[i]-=10; c[i-1]++; } } if(la==80&&c[0]==1) { printf("overflow\n"); } else { if(c[0]==0) { for(i=1;i<=la;i++) printf("%d",c[i]); printf("\n"); } else { for(i=0;i<=la;i++) printf("%d",c[i]); printf("\n"); } } } int main() { char a[100], b[100]; int n; scanf("%d",&n); while(n--){ scanf("%s%s",a,b); int la = strlen(a), lb = strlen(b); if(la>80 || lb>80) printf("overflow\n"); else if(la>lb) add(a,b); else add(b,a); } return 0; }
main.c:20:5: error: expected identifier or '(' before 'for' 20 | for( i=la-lb;i>0;i--) | ^~~ main.c:20:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token 20 | for( i=la-lb;i>0;i--) | ^ main.c:20:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token 20 | for( i=la-lb;i>0;i--) | ^~ main.c:30:5: error: expected identifier or '(' before 'if' 30 | if(la==80&&c[0]==1) | ^~ main.c:34:5: error: expected identifier or '(' before 'else' 34 | else | ^~~~ main.c:49:1: error: expected identifier or '(' before '}' token 49 | } | ^
s674222746
p00015
C
#include<stdio.h> #include<string.h> int c[100]; void add(char*a, char*b) //鮟倩ョ、a豈巴髟ソ { int i,j; for(i=0; i<100;i++) c[i]=0;//蜥檎噪蜷?ス咲スョ髮カ int la=strlen(a), lb=strlen(b); for( i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス? { c[i]+=a[i-1]-'0'+b[j-1]-'0'; if(c[i]>9) { c[i]-=10; c[i-1]++; } } for(i=la-lb;i>0;i--) { c[i]+=a[i-1]-'0'; if(c[i]>9) { c[i]-=10; c[i-1]++; } } if(la==80&&c[0]==1) { printf("overflow\n"); } else { if(c[0]==0) { for(i=1;i<=la;i++) printf("%d",c[i]); printf("\n"); } else { for(i=0;i<=la;i++) printf("%d",c[i]); printf("\n"); } } } int main() { char a[100], b[100]; int n; scanf("%d",&n); while(n--){ scanf("%s%s",a,b); int la = strlen(a), lb = strlen(b); if(la>80 || lb>80) printf("overflow\n"); else if(la>lb) add(a,b); else add(b,a); } return 0; }
main.c:21:5: error: expected identifier or '(' before 'for' 21 | for(i=la-lb;i>0;i--) | ^~~ main.c:21:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token 21 | for(i=la-lb;i>0;i--) | ^ main.c:21:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token 21 | for(i=la-lb;i>0;i--) | ^~ main.c:31:5: error: expected identifier or '(' before 'if' 31 | if(la==80&&c[0]==1) | ^~ main.c:35:5: error: expected identifier or '(' before 'else' 35 | else | ^~~~ main.c:50:1: error: expected identifier or '(' before '}' token 50 | } | ^
s966753167
p00015
C
#include<stdio.h> #include<string.h> int c[100]; void add(char*a, char*b) //鮟倩ョ、a豈巴髟ソ { int i,j; int la=strlen(a), lb=strlen(b); for(i=0; i<=la;i++) c[i]=0;//蜥檎噪蜷?ス咲スョ髮カ for( i=la,j=lb;i>la-lb&&j>0;i--,j--) // 菫晉蕗c豈泌刈謨ー譛?柄荳イ螟壻ク?ス? { c[i]+=a[i-1]+b[j-1]-96; if(c[i]>9) { c[i]-=10; c[i-1]++; } } for( i=la-lb;i>0;i--) { c[i]+=a[i-1]-'0'; if(c[i]>9) { c[i]-=10; c[i-1]++; } } if(la==80&&c[0]==1) printf("overflow\n"); else { if(c[0]==0) { for(i=1;i<=la;i++) printf("%d",c[i]); printf("\n"); } else { for(i=0;i<=la;i++) printf("%d",c[i]); printf("\n"); } } } int main() { char a[100], b[100]; int n; scanf("%d",&n); while(n--) { scanf("%s%s",a,b); int la = strlen(a), lb = strlen(b); if(la>80 || lb>80) printf("overflow\n"); else if(la>lb) add(a,b); else add(b,a); } return 0; }
main.c:18:5: error: expected identifier or '(' before 'for' 18 | for( i=la-lb;i>0;i--) | ^~~ main.c:18:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token 18 | for( i=la-lb;i>0;i--) | ^ main.c:18:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token 18 | for( i=la-lb;i>0;i--) | ^~ main.c:27:5: error: expected identifier or '(' before 'if' 27 | if(la==80&&c[0]==1) | ^~ main.c:29:5: error: expected identifier or '(' before 'else' 29 | else | ^~~~ main.c:44:1: error: expected identifier or '(' before '}' token 44 | } | ^
s200274212
p00015
C
#include <stdio.h> #include <string.h> &#160; #define LEN(x) (strlen(x)) int main(){ &#160;&#160;int n, i, j, fp, sp, ans[100], carry; &#160;&#160;char f[1000], s[1000]; &#160;&#160;scanf("%d", &n); &#160;&#160;while(n--){ &#160;&#160;&#160;&#160;scanf("%s%s", f, s); &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); &#160;&#160;&#160;&#160;&#160;&#160;continue; &#160;&#160;&#160;&#160;} &#160;&#160;&#160;&#160;fp = LEN(f); &#160;&#160;&#160;&#160;sp = LEN(s); &#160;&#160;&#160;&#160;j = carry = 0; &#160;&#160;&#160;&#160;while(fp || sp){ &#160;&#160;&#160;&#160;&#160;&#160;ans[j] = carry; &#160;&#160;&#160;&#160;&#160;&#160;if(fp) ans[j] += f[--fp] - '0'; &#160;&#160;&#160;&#160;&#160;&#160;if(sp) ans[j] += s[--sp] - '0'; &#160;&#160;&#160;&#160;&#160;&#160;carry = ans[j] / 10; &#160;&#160;&#160;&#160;&#160;&#160;ans[j++] %= 10; &#160;&#160;&#160;&#160;} &#160;&#160;&#160;&#160;if(carry) ans[j] = 1; &#160;&#160;&#160;&#160;else j--; &#160;&#160;&#160;&#160;if(j >= 80){ &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); &#160;&#160;&#160;&#160;&#160;&#160;continue; &#160;&#160;&#160;&#160;} &#160; &#160;&#160;&#160;&#160;for(;j >= 0;j--) &#160;&#160;&#160;&#160;&#160;&#160;printf("%d", ans[j]); &#160;&#160;&#160;&#160;puts(""); &#160;&#160;} &#160;&#160;return 0; }
main.c:3:1: error: expected identifier or '(' before '&' token 3 | &#160; | ^ main.c:3:2: error: stray '#' in program 3 | &#160; | ^ main.c: In function 'main': main.c:6:2: error: stray '#' in program 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:6:1: error: lvalue required as unary '&' operand 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:6:8: error: stray '#' in program 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:6:7: error: lvalue required as unary '&' operand 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:7:2: error: stray '#' in program 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:7:1: error: lvalue required as unary '&' operand 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:7:8: error: stray '#' in program 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:7:7: error: lvalue required as unary '&' operand 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:8:2: error: stray '#' in program 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:8:1: error: lvalue required as unary '&' operand 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:8:8: error: stray '#' in program 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:8:7: error: lvalue required as unary '&' operand 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:9:2: error: stray '#' in program 9 | &#160;&#160;while(n--){ | ^ main.c:9:1: error: lvalue required as unary '&' operand 9 | &#160;&#160;while(n--){ | ^ main.c:9:8: error: stray '#' in program 9 | &#160;&#160;while(n--){ | ^ main.c:9:7: error: lvalue required as unary '&' operand 9 | &#160;&#160;while(n--){ | ^ main.c:10:2: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:1: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:8: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:7: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:14: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:13: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:20: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:19: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:11:2: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:1: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:8: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:7: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:14: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:13: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:20: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:19: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:12:2: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:1: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:8: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:7: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:14: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:13: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:20: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:19: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:26: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:25: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:32: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:31: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:13:2: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:1: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:8: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:7: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:14: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:13: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:20: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:19: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:26: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:25: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:32: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:31: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:14:2: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:1: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:8: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:7: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:14: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:13: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:20: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:19: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:15:2: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:1: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:8: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:7: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:14: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:13: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:20: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:19: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:16:2: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:1: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:8: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:7: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:14: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:13: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:20: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:19: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:17:2: error: stray '#' in program 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:1: error: lvalue required as unary '&' operand 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:8: error: stray '#' in program 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:7: error: lvalue required as unary '&' operand 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:14: error: stray '#' in program 17 | &#160;&#160;&#160;&#160
s180913028
p00015
C
#include <stdio.h> #include <string.h> &#160; #define LEN(x) (strlen(x)) int main(){ &#160;&#160;int n, i, j, fp, sp, ans[100], carry; &#160;&#160;char f[1000], s[1000]; &#160;&#160;scanf("%d", &n); &#160;&#160;while(n--){ &#160;&#160;&#160;&#160;scanf("%s%s", f, s); &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); &#160;&#160;&#160;&#160;&#160;&#160;continue; &#160;&#160;&#160;&#160;} &#160;&#160;&#160;&#160;fp = LEN(f); &#160;&#160;&#160;&#160;sp = LEN(s); &#160;&#160;&#160;&#160;j = carry = 0; &#160;&#160;&#160;&#160;while(fp || sp){ &#160;&#160;&#160;&#160;&#160;&#160;ans[j] = carry; &#160;&#160;&#160;&#160;&#160;&#160;if(fp) ans[j] += f[--fp] - '0'; &#160;&#160;&#160;&#160;&#160;&#160;if(sp) ans[j] += s[--sp] - '0'; &#160;&#160;&#160;&#160;&#160;&#160;carry = ans[j] / 10; &#160;&#160;&#160;&#160;&#160;&#160;ans[j++] %= 10; &#160;&#160;&#160;&#160;} &#160;&#160;&#160;&#160;if(carry) ans[j] = 1; &#160;&#160;&#160;&#160;else j--; &#160;&#160;&#160;&#160;if(j >= 80){ &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); &#160;&#160;&#160;&#160;&#160;&#160;continue; &#160;&#160;&#160;&#160;} &#160; &#160;&#160;&#160;&#160;for(;j >= 0;j--) &#160;&#160;&#160;&#160;&#160;&#160;printf("%d", ans[j]); &#160;&#160;&#160;&#160;puts(""); &#160;&#160;} &#160;&#160;return 0; }
main.c:3:1: error: expected identifier or '(' before '&' token 3 | &#160; | ^ main.c:3:2: error: stray '#' in program 3 | &#160; | ^ main.c: In function 'main': main.c:6:2: error: stray '#' in program 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:6:1: error: lvalue required as unary '&' operand 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:6:8: error: stray '#' in program 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:6:7: error: lvalue required as unary '&' operand 6 | &#160;&#160;int n, i, j, fp, sp, ans[100], carry; | ^ main.c:7:2: error: stray '#' in program 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:7:1: error: lvalue required as unary '&' operand 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:7:8: error: stray '#' in program 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:7:7: error: lvalue required as unary '&' operand 7 | &#160;&#160;char f[1000], s[1000]; | ^ main.c:8:2: error: stray '#' in program 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:8:1: error: lvalue required as unary '&' operand 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:8:8: error: stray '#' in program 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:8:7: error: lvalue required as unary '&' operand 8 | &#160;&#160;scanf("%d", &n); | ^ main.c:9:2: error: stray '#' in program 9 | &#160;&#160;while(n--){ | ^ main.c:9:1: error: lvalue required as unary '&' operand 9 | &#160;&#160;while(n--){ | ^ main.c:9:8: error: stray '#' in program 9 | &#160;&#160;while(n--){ | ^ main.c:9:7: error: lvalue required as unary '&' operand 9 | &#160;&#160;while(n--){ | ^ main.c:10:2: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:1: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:8: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:7: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:14: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:13: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:20: error: stray '#' in program 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:10:19: error: lvalue required as unary '&' operand 10 | &#160;&#160;&#160;&#160;scanf("%s%s", f, s); | ^ main.c:11:2: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:1: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:8: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:7: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:14: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:13: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:20: error: stray '#' in program 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:11:19: error: lvalue required as unary '&' operand 11 | &#160;&#160;&#160;&#160;if(LEN(f) > 80 || LEN(s) > 80){ | ^ main.c:12:2: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:1: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:8: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:7: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:14: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:13: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:20: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:19: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:26: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:25: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:32: error: stray '#' in program 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:12:31: error: lvalue required as unary '&' operand 12 | &#160;&#160;&#160;&#160;&#160;&#160;puts("overflow"); | ^ main.c:13:2: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:1: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:8: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:7: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:14: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:13: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:20: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:19: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:26: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:25: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:32: error: stray '#' in program 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:13:31: error: lvalue required as unary '&' operand 13 | &#160;&#160;&#160;&#160;&#160;&#160;continue; | ^ main.c:14:2: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:1: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:8: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:7: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:14: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:13: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:20: error: stray '#' in program 14 | &#160;&#160;&#160;&#160;} | ^ main.c:14:19: error: lvalue required as unary '&' operand 14 | &#160;&#160;&#160;&#160;} | ^ main.c:15:2: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:1: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:8: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:7: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:14: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:13: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:20: error: stray '#' in program 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:15:19: error: lvalue required as unary '&' operand 15 | &#160;&#160;&#160;&#160;fp = LEN(f); | ^ main.c:16:2: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:1: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:8: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:7: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:14: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:13: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:20: error: stray '#' in program 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:16:19: error: lvalue required as unary '&' operand 16 | &#160;&#160;&#160;&#160;sp = LEN(s); | ^ main.c:17:2: error: stray '#' in program 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:1: error: lvalue required as unary '&' operand 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:8: error: stray '#' in program 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:7: error: lvalue required as unary '&' operand 17 | &#160;&#160;&#160;&#160;j = carry = 0; | ^ main.c:17:14: error: stray '#' in program 17 | &#160;&#160;&#160;&#160
s742297805
p00015
C
#include <stdio.h> #include <string.h> void fun1(); void fun2(int len1,int len2,int j); char str1[100],str2[100]; int Ans[82]; int main(void) { int len1,len2,len_Ans,i,j,n; scanf("%d",&n); for(i=0;i<n;i++){ fun1(); scanf("%s",str1); scanf(" %s",str2); len1=strlen(str1); len2=strlen(str2); if(len1>=80 || len2>=80) puts("overflow"); else{ len1--; len2--; for(j=0;len1>=0 || len2>=0;j++,len1--,len2--){ fun2(len1,len2,j); } if(Ans[j]==0) j--; for(;j>=0;j--){ printf("%d",Ans[j]); } printf("\n"); } } return 0; } void fun1() { int i; for(i=0;i<100;i++){ str1[i]='\0'; str2[i]='\0'; } for(i=0;i<82;i++){ Ans[i]=0; } return ; } void fun2(int len1,int len2,int j) { if(len1>=0 && len2>=0){ Ans[j]+=(str1[len1]-'0')+(str2[len2]-'0'); Ans[j+1]+=Ans[j]/10; Ans[j]=Ans[j]%10; } else if(len1>=0 && len2<0){ Ans[j]+=str1[len1]-'0'; Ans[j+1]+=Ans[j]/10; Ans[j]=Ans[j]%10; } else if(len1<0 && len2>=0){ Ans[j]+=str2[len2]-'0'; Ans[j+1]=Ans[j]/10; Ans[j]=Ans[j]%10; }
main.c: In function 'fun2': main.c:64:17: error: expected declaration or statement at end of input 64 | } | ^
s097830686
p00015
C
#include<stdio.h> int main() { char a[100], b[100], c[100]; int i, j, k, n, s; char m; scanf("%d", &n); for (s = 0; s < n; s ++) { for (i = 0; i < 84; i ++) { a[i] = 0; b[i] = 0; } scanf(" %s", c); for (i = 0; c[i] != 0; i ++); if(i => 80){ printf("overflow\n"); continue; } for (j = 0; j < i; j ++) a[j] = c[i - j - 1]; k = i; scanf(" %s", c); for (i = 0; c[i] != 0; i ++); if(i => 80){ printf("overflow\n"); continue; } for (j = 0; j < i; j ++) b[j] = c[i - j - 1]; if (k > i) { for (j = i; j < k; j ++) b[j] = '0'; } else if (i > k) { for (j = k; j < i; j ++) a[j] = '0'; } for (i = 0; i < 81; i ++) c[i] = 0; for (i = 0; a[i] || b[i]; i ++) { if (i == 80) { printf("overflow"); i++; break; } m = a[i] - '0' + b[i] - '0'; if (m > 9) { if (a[i + 1]) { a[i + 1] += 1; } else { a[i + 1] = '1'; b[i + 1] = '0'; } m -= 10; } m += '0'; c[i] = m; } i --; for (; i < 80 && i > -1; i --) printf("%c", c[i]); printf("\n"); } return 0; }
main.c: In function 'main': main.c:14:11: error: expected expression before '>' token 14 | if(i => 80){ | ^ main.c:22:11: error: expected expression before '>' token 22 | if(i => 80){ | ^
s659745314
p00015
C
#include <stdio.h> #include <string.h> int main(){ int N; scanf("%d\n",&N); while(N){ char a[81],b[81],c[82]; int al,bl,cl;File Edit Options Buffers Tools C Help #include <stdio.h> #include <string.h> int main(){ int N; scanf("%d\n",&N); while(N){ char a[81],b[81],c[82]; int al,bl,cl; scanf("%s\n",a); scanf("%s\n",b); al=strlen(a);bl=strlen(b);cl=81; if((al>80)||(bl>80)) puts("overflow"); else { int i=82; memset(c,0,82); while(al||bl|i){ int an,bn; if(al>0) an=a[--al]-'0'; else an=0; if(bl>0) bn=b[--bl]-'0'; else bn=0; c[--cl]=c[cl]+an+bn; if(c[cl]>9){ c[cl-1]=1;c[cl]=c[cl]%10+'0'; } else{ c[cl-1]=0; c[cl]=c[cl]+'0'; } i--; } if (c[cl-1]) c[cl-1]='1'; if (!cl) puts("overflow"); else if(!c[cl-1]) puts(&c[cl]); else puts(&c[cl-1]); } N--; } return 0; } scanf("%s\n",a); scanf("%s\n",b); al=strlen(a);bl=strlen(b);cl=81; if((al>80)||(bl>80)) puts("overflow"); else { int i=82; memset(c,0,82); while(al||bl|i){ int an,bn; if(al) an=a[--al]-'0'; else an=0; if(bl) bn=b[--bl]-'0'; else bn=0; c[--cl]=c[cl]+an+bn; if(c[cl]>9){ c[cl-1]=1;c[cl]=c[cl]%10+'0'; } else{ c[cl-1]=0; c[cl]=c[cl]+'0'; } i--; } if (c[cl-1]) c[cl-1]='1'; if (!cl) puts("overflow"); else if(!c[cl-1]) puts(&c[cl]); else puts(&c[cl-1]); } N--; } return 0; }
main.c: In function 'main': main.c:8:18: error: unknown type name 'File' 8 | int al,bl,cl;File Edit Options Buffers Tools C Help | ^~~~ main.c:8:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Options' 8 | int al,bl,cl;File Edit Options Buffers Tools C Help | ^~~~~~~
s834287715
p00015
C
#include <stdio.h> #include <string.h> int main(){ int N; scanf("%d\n",&N); while(N){ char a[81],b[81],c[82]; int al,bl,cl;File Edit Options Buffers Tools C Help #include <stdio.h> #include <string.h> int main(){ int N; scanf("%d\n",&N); while(N){ char a[81],b[81],c[82]; int al,bl,cl; scanf("%s\n",a); scanf("%s\n",b); al=strlen(a);bl=strlen(b);cl=81; if((al>80)||(bl>80)) puts("overflow"); else { int i=82; memset(c,0,82); while(al||bl|i){ int an,bn; if(al>0) an=a[--al]-'0'; else an=0; if(bl>0) bn=b[--bl]-'0'; else bn=0; c[--cl]=c[cl]+an+bn; if(c[cl]>9){ c[cl-1]=1;c[cl]=c[cl]%10+'0'; } else{ c[cl-1]=0; c[cl]=c[cl]+'0'; } i--; } if (c[cl-1]) c[cl-1]='1'; if (!cl) puts("overflow"); else if(!c[cl-1]) puts(&c[cl]); else puts(&c[cl-1]); } N--; } return 0; } scanf("%s\n",a); scanf("%s\n",b); al=strlen(a);bl=strlen(b);cl=81; if((al>80)||(bl>80)) puts("overflow"); else { int i=82; memset(c,0,82); while(al||bl|i){ int an,bn; if(al) an=a[--al]-'0'; else an=0; if(bl) bn=b[--bl]-'0'; else bn=0; c[--cl]=c[cl]+an+bn; if(c[cl]>9){ c[cl-1]=1;c[cl]=c[cl]%10+'0'; } else{ c[cl-1]=0; c[cl]=c[cl]+'0'; } i--; } if (c[cl-1]) c[cl-1]='1'; if (!cl) puts("overflow"); else if(!c[cl-1]) puts(&c[cl]); else puts(&c[cl-1]); } N--; } return 0; }
main.c: In function 'main': main.c:8:18: error: unknown type name 'File' 8 | int al,bl,cl;File Edit Options Buffers Tools C Help | ^~~~ main.c:8:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Options' 8 | int al,bl,cl;File Edit Options Buffers Tools C Help | ^~~~~~~
s500820553
p00015
C
#include <string.h> int main(){ int N,n; char inbuf[256]; fgets(inbuf, 82, stdin); sscanf(inbuf,"%d\n",&N); for(n=0;n<N;n++){ char a[85],b[85],c[82]; int al,bl,cl; fgets(inbuf, 82, stdin); sscanf(inbuf,"%s\n",a); fgets(inbuf, 82, stdin); sscanf(inbuf,"%s\n",b); al=strlen(a);bl=strlen(b);cl=80; if((al>80)||(bl>80)) puts("overflow"); else { memset(c,0,82); while(al||bl){ int an,bn; if(al>0) an=a[--al]-'0';else an=0; if(bl>0) bn=b[--bl]-'0';else bn=0; c[cl]+=an+bn; if(c[cl]>9){ c[cl-1]=1; c[cl]=c[cl]%10+'0'; } else{ c[cl-1]=0; c[cl]=c[cl]+'0'; } cl--; } if (c[0]) puts("overflow"); else { if (!c[cl]) cl++; if (c[cl]==1) c[cl]='1'; puts(&c[cl]); } } } return 0; }
main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 6 | fgets(inbuf, 82, stdin); | ^~~~~ main.c:6:20: error: 'stdin' undeclared (first use in this function) 6 | fgets(inbuf, 82, stdin); | ^~~~~ main.c:2:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' 1 | #include <string.h> +++ |+#include <stdio.h> 2 | main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in 6 | fgets(inbuf, 82, stdin); | ^~~~~ main.c:7:3: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration] 7 | sscanf(inbuf,"%d\n",&N); | ^~~~~~ main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'sscanf' main.c:7:3: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch] main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'sscanf' main.c:14:26: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 14 | if((al>80)||(bl>80)) puts("overflow"); | ^~~~ main.c:14:26: note: include '<stdio.h>' or provide a declaration of 'puts'
s550820904
p00015
C
def writeSum number1 = gets.to_i number2 = gets.to_i sum = number1 + number2 if sum >= 10 ** 81 puts "overflow" else puts sum end end dataSet = gets.to_i 1.upto(dataSet) do |i| writeSum() end
main.c:1:1: error: unknown type name 'def' 1 | def writeSum | ^~~ main.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'number1' 2 | number1 = gets.to_i | ^~~~~~~ main.c:13:1: error: invalid suffix "upto" on floating constant 13 | 1.upto(dataSet) do |i| | ^~~~~~
s741150562
p00015
C
#include <stdio.h> #include <string.h> int main() { char a[1024], b[1024], c[1024]; int i, j, n, p; int a1, b1; int leaf; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < 80; j++) { a[j] = b[j] = '\0'; } scanf("%s", a); scanf("%s", b); if (strlen(a) > 80 || strlen(b) > 80) { puts("overflow"); continue; } strrev(a); strrev(b); leaf = 0; for (j = 0; j < 80; j++) { a1 = a[j] == '\0' ? 0 : a[j] - '0'; b1 = b[j] == '\0' ? 0 : b[j] - '0'; c[j] = (a1 + b1 + leaf) % 10 + '0'; leaf = (a1 + b1 + leaf) / 10; } if (leaf == 1) { puts("overflow"); continue; } p = 0; for (j = 79; c[j] == '0'; j--) { } c[j + 1] = '\0'; strrev(c); printf("%s\n", c); } return 0; }
main.c: In function 'main': main.c:22:17: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration] 22 | strrev(a); | ^~~~~~ | strsep
s759117487
p00015
C
#include <stdio.h> #include <string.h> int main() { char a[1024], b[1024], c[1024]; int i, j, n, p; int a1, b1; int leaf; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < 80; j++) { a[j] = b[j] = '\0'; } scanf("%s", a); scanf("%s", b); if (strlen(a) > 80 || strlen(b) > 80) { puts("overflow"); continue; } strrev(a); strrev(b); leaf = 0; for (j = 0; j < 80; j++) { a1 = a[j] == '\0' ? 0 : a[j] - '0'; b1 = b[j] == '\0' ? 0 : b[j] - '0'; c[j] = (a1 + b1 + leaf) % 10 + '0'; leaf = (a1 + b1 + leaf) / 10; } if (leaf == 1) { puts("overflow"); continue; } p = 0; for (j = 79; c[j] == '0'; j--) { } c[j + 1] = '\0'; strrev(c); printf("%s\n", c); } return 0; }
main.c: In function 'main': main.c:22:17: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration] 22 | strrev(a); | ^~~~~~ | strsep
s772274584
p00015
C
n = input() for i in range(n): a = input(), b = input() print a + b
main.c:1:1: warning: data definition has no type or storage class 1 | n = input() | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration] 1 | n = input() | ^~~~~ main.c:1:5: error: initializer element is not constant main.c:3:1: error: expected ',' or ';' before 'for' 3 | for i in range(n): | ^~~
s870351193
p00015
C
#include<stdio.h> int main(void) { int a,i,flag=0; char s[81]={0}; char t[80]={0}; char x[2]={0}; char y[2]={0}; char ans[100] while(scanf("%80s%1s%*s%80s%1s%*s",&s,&x,&t,&y)!=EOF){ flag=0; for(i=0;i<80;i++){ a=s[i]+t[i]; if(a>=10){ }
main.c: In function 'main': main.c:12:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'while' 12 | while(scanf("%80s%1s%*s%80s%1s%*s",&s,&x,&t,&y)!=EOF){ | ^~~~~ main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^ main.c:18:1: error: expected declaration or statement at end of input main.c:18:1: error: expected declaration or statement at end of input
s498640256
p00015
C
#include <stdio.h> #include <string.h> #include <stdlib.h> int makeBigInt80(char*, const char*); int sumBigInt80(char*, const char*, const char*); int main(void){ int i, n; char buf[81], a[81], b[81]; scanf("%d", &n); while(n--){ scanf(" %s", buf); //makeBigInt80(a, buf); scanf(" %s", buf); //makeBigInt80(b, buf); //if(sumBigInt80(buf, a, b)) printf("overflow\n"); //else{ // for(i = 0; i < 81; i++) // if(buf[i] != '0') break; // printf("%s\n", buf + i); } } } int makeBigInt80(char *s, const char *t){ int l, i; l = 80 - strlen(t); for(i = 0; i < l; i++) s[i] = '0'; strcpy(s + l, t); return 0; } int sumBigInt80(char *sum, const char *a, const char *b){ int i, n; int m = 0; for(i = 79; i >= 0; i--){ n = (a[i] - '0') + (b[i] - '0') + m; m = n / 10; sum[i] = (n % 10) + '0'; } sum[80] = '\0'; return (m ? -1 : 0); }
main.c:30:1: error: expected identifier or '(' before '}' token 30 | } | ^
s471654627
p00015
C
#define _CRT_SECURE_NO_WARNINGS #define M_PI 3.14159265358979 #include <iostream> #include <stdio.h> #include <string> #include <math.h> #include<iomanip> #include<vector> #include<cmath> #include <algorithm> using namespace std; int main(){ int n; string x, y; int a, b, c; cin >> n; for (int i = 0; i < n; i++){ cin >> x >> y; if (x.length() > 80 || y.length() > 80){ cout << "overflow" << endl; } else{ a = stoi(x); b = stoi(x); if (to_string(a + b).length() > 80){ cout << "overflow" << endl; } else cout << a + b << endl; } } return 0; }
main.c:3:10: fatal error: iostream: No such file or directory 3 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s303821510
p00015
C
#include <stdio.h> #include <string.h> ???? int main(void) { ????????int n, i, j, len, s, c; ????????char f[90], f2[90], t[90], t2[90], ans[90]; ???????????? ????????scanf("%d", &n); ???????????? ????????for (i = 0; i < n; i++){ ???????????????????? ????????????????for (j = 0; j < 90; j++){ ????????????????????????t[j] = '0'; ????????????????????????t2[j] = '0'; ????????????????} ???????????????????? ????????????????scanf("%81s", f); ????????????????scanf("%81s", f2); ???????????????????? ????????????????if (strlen(f) > 80 || strlen(f2) > 80){ ????????????????????????printf("overflow\n"); ????????????????????????continue; ????????????????} ???????????????????? ????????????????if (strlen(f) > strlen(f2))len = strlen(f); ???????????????????? ????????????????else len =?? strlen(f2); ???????????????????? ????????????????for (j = 0; j < strlen(f); j++){ ????????????????????????t[j] = f[strlen(f) -1 - j]; ????????????????} ???????????????????? ????????????????for (j = 0; j < strlen(f2); j++){ ????????????????????????t2[j] = f2[strlen(f2) -1 - j]; ????????????????} ???????????????????? ???????????????????? ????????????????for (j = 0; j < len; j++){ ????????????????????????t[j] += t2[j] - '0'; ???????????????????????????? ????????????????????????if (t[j] > '9'){ ????????????????????????????????t[j] -= 10; ????????????????????????????????t[j + 1]++; ????????????????????????} ????????????????} ???????????????????? ????????????????if (t[len] != '0')t[len + 1] = '\0'; ???????????????????? ???????????????????? ????????????????else t[len] = '\0'; ???????????????????? ????????????????for(j = 0; j < strlen(t); j++){ ????????????????????????ans[j] = t[strlen(t) - 1 - j]; ????????????????} ????????????????ans[strlen(t)] = '\0'; ???????????????????? ????????????????if (strlen(ans) > 80){ ????????????????????????printf("overflow\n"); ????????????????????????continue; ????????????????} ???????????????????? ????????????????printf("%s\n", ans); ????????} ????????return (0); ???????????? }
main.c:3:1: error: expected identifier or '(' before '?' token 3 | ???? | ^
s703802892
p00015
C
#include <stdio.h> #include <string.h> ???? int main(void) { ????????int n, i, j, len, s, c; ????????char f[90], f2[90], t[90], t2[90], ans[90]; ???????????? ????????scanf("%d", &n); ???????????? ????????for (i = 0; i < n; i++){ ???????????????????? ????????????????for (j = 0; j < 90; j++){ ????????????????????????t[j] = '0'; ????????????????????????t2[j] = '0'; ????????????????} ???????????????????? ????????????????scanf("%81s", f); ????????????????scanf("%81s", f2); ???????????????????? ????????????????if (strlen(f) > 80 || strlen(f2) > 80){ ????????????????????????printf("overflow\n"); ????????????????????????continue; ????????????????} ???????????????????? ????????????????if (strlen(f) > strlen(f2))len = strlen(f); ???????????????????? ????????????????else len =?? strlen(f2); ???????????????????? ????????????????for (j = 0; j < strlen(f); j++){ ????????????????????????t[j] = f[strlen(f) -1 - j]; ????????????????} ???????????????????? ????????????????for (j = 0; j < strlen(f2); j++){ ????????????????????????t2[j] = f2[strlen(f2) -1 - j]; ????????????????} ???????????????????? ???????????????????? ????????????????for (j = 0; j < len; j++){ ????????????????????????t[j] += t2[j] - '0'; ???????????????????????????? ????????????????????????if (t[j] > '9'){ ????????????????????????????????t[j] -= 10; ????????????????????????????????t[j + 1]++; ????????????????????????} ????????????????} ???????????????????? ????????????????if (t[len] != '0')t[len + 1] = '\0'; ???????????????????? ???????????????????? ????????????????else t[len] = '\0'; ???????????????????? ????????????????for(j = 0; j < strlen(t); j++){ ????????????????????????ans[j] = t[strlen(t) - 1 - j]; ????????????????} ????????????????ans[strlen(t)] = '\0'; ???????????????????? ????????????????if (strlen(ans) > 80){ ????????????????????????printf("overflow\n"); ????????????????????????continue; ????????????????} ???????????????????? ????????????????printf("%s\n", ans); ????????} ????????return 0; ???????????? }
main.c:3:1: error: expected identifier or '(' before '?' token 3 | ???? | ^
s265658523
p00015
C
#include<stdio.h> #include<stdlib.h> #define KETA 101 int main(void) { int n = 0, i = 0, j = 0; int *sum; int goukei = 0; int keta_max = 0; int countsum = 0; char *money1; char *money2; int count1 = 0, count2 = 0; int *money_int1; int *money_int2; int t=0; scanf("%d",&n); for(t = 0; t < n; t++) { money1 = (char *)malloc(sizeof(char) * KETA); money2 = (char *)malloc(sizeof(char) * KETA); money_int1 = (int *)malloc(sizeof(int) * KETA); money_int2 = (int *)malloc(sizeof(int) * KETA); sum = (int *)malloc(sizeof(int) * KETA); scanf("%s", money1); while(1) { if(money1[count1] == '\0') { break; } count1++; } scanf("%s", money2); while(1) { if(money2[count2] == '\0') { break; } count2++; } j = count1 - 1; for(i = 0; i < count1; i++) { money_int1[j] = money1[i] - 0x30; j--; } j = count2 - 1; for(i = 0; i < count2; i++) { money_int2[j] = money2[i] - 0x30; j--; } free(money1); free(money2); /* for(i = 0; i < count1; i++) printf("%d", money_int1[i]); printf("\n"); for(i = 0; i < count2; i++) printf("%d", money_int2[i]); printf("\n"); */ i = 0; if(count1 > count2) { keta_max = count1; } else { keta_max = count2; } while(1) { if((i >= keta_max) && (money_int1[i] == 0 && money_int2[i] == 0)) { countsum = i-1; break; } goukei = money_int1[i] + money_int2[i]; if(goukei >= 10) { sum[i] = goukei%10; money_int1[i+1] = money_int1[i+1] + 1 ; } else { sum[i] = goukei; } i++; } for(i = countsum; i >= 0 ;i--) { printf("%d",sum[i]); } printf("\n"); if(countsum > 80) { printf("overflow\n"); } free(sum); free(money_int1); free(money_int2); } return 0;
main.c: In function 'main': main.c:126:9: error: expected declaration or statement at end of input 126 | return 0; | ^~~~~~
s729698142
p00015
C
#include<stdio.h> #include<stdlib.h> #define KETA 101 int main(void) { int n = 0, i = 0, j = 0; int *sum; int goukei = 0; int keta_max = 0; int countsum = 0; char *money1; char *money2; int count1 = 0, count2 = 0; int *money_int1; int *money_int2; int t = 0,p = 0; scanf("%d",&n); for(t = 0; t < n; t++) { money1 = (char *)malloc(sizeof(char) * KETA); money2 = (char *)malloc(sizeof(char) * KETA); money_int1 = (int *)malloc(sizeof(int) * KETA); money_int2 = (int *)malloc(sizeof(int) * KETA); sum = (int *)malloc(sizeof(int) * KETA); /*for( p = 0; p < KETA; p++) { printf("m1:%d m2:%d sum:%d\n", money_int1[p], money_int2[p], sum[p]); } printf("%s\n%s\n", money1, money2); */ for(i = 0 ;i < KETA; i++) { money1[i]='0'; money2[i]='0'; money_int1[i]=0; money_int2[i]=0; sum[i] = 0; } scanf("%s", money1); while(1) { if(money1[count1] == '\0') { break; } count1++; } scanf("%s", money2); while(1) { if(money2[count2] == '\0') { break; } count2++; } j = count1 - 1; for(i = 0; i < count1; i++) { money_int1[j] = money1[i] - 0x30; j--; } j = count2 - 1; for(i = 0; i < count2; i++) { money_int2[j] = money2[i] - 0x30; j--; } i = 0; if(count1 > count2) { keta_max = count1; } else { keta_max = count2; } while(1) { if((i >= keta_max) && (money_int1[i] == 0 && money_int2[i] == 0)) { countsum = i-1; break; } goukei = money_int1[i] + money_int2[i]; if(goukei >= 10) { sum[i] = goukei%10; money_int1[i+1] = money_int1[i+1] + 1 ; } else { sum[i] = goukei; } i++; } for(i = countsum; i >= 0 ;i--) { printf("%d",sum[i]); } printf("\n"); if(countsum > 80) { printf("overflow\n"); } goukei = 0; i = 0; j = 0; keta_max = 0; countsum = 0; count1 = 0; count2 = 0; free(money1); free(money2); free(sum); free(money_int1); free(money_int2); } return 0;
main.c: In function 'main': main.c:138:9: error: expected declaration or statement at end of input 138 | return 0; | ^~~~~~
s215586409
p00015
C
#include<stdio.h> int main(){ int n,a,s_sum,digit = 0; scanf("%d",&n); while(scanf("%d",&a)!=EOF){ for(i=1;i<=n;i++) { s_sum=s_sum+a; } /* ?????°????¨???? */ while(number!=0){ number = number / 10; ++digit; } if(digit<=80){ printf("%d\n", s_sum); }else{ printf("overflow\n"); } } return 0; }
main.c: In function 'main': main.c:8:9: error: 'i' undeclared (first use in this function) 8 | for(i=1;i<=n;i++) | ^ main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in main.c:14:9: error: 'number' undeclared (first use in this function) 14 | while(number!=0){ | ^~~~~~
s344424684
p00015
C
de<stdio.h> #include<string.h> int main(void){ char str1[100],str2[100]; int a,b; int i,j,k,l,m,n,v,x,y; int s1,s2,s3; int up=0; int sum[100]; int count; scanf("%d",&count); if((count>50)||(count<0)){ return 0; } for(x=0;x<count;x++){ scanf("%s",str1); scanf("%s",str2); a = strlen(str1); b = strlen(str2); if(a<=b){ j = 0; k = b-1; l = 0; //?????????????????????????¶???? for(i=a-1;i>=0;i--){ s1 = str1[i]-'0'; s2 = str2[k-l]-'0'; //?¶????????????????????????\?????? if(s1+s2+up<10){ sum[j] = s1+s2+up; up = 0; }else{ sum[j] = (s1+s2+up)%10; up = 1; } j++; l++; } if(a != b){ n = 0; for(m=b-a-1;m>=0;m--){ s3 = str2[m]; if(((s3-'0')+up)<10){ sum[a+n] = (s3-'0')+up; up = 0; }else{ sum[a+n] = ((s3-'0')+up)%10; up = 1; } n++; } } if(up == 1){ sum[b] = 1; if(b>=80){ printf("overflow"); }else{ for(v=b;v>=0;v--){ printf("%d",sum[v]); } } }else{ if(b>=81){ printf("overflow"); }else{ for(v=b-1;v>=0;v--){ printf("%d",sum[v]); } } } up = 0; printf("\n"); }else{ j = 0; k = a-1; l = 0; for(i=b-1;i>=0;i--){ s1 = str1[k-l]-'0'; s2 = str2[i]-'0'; if(s1+s2+up<10){ sum[j] = s1+s2+up; up = 0; }else{ sum[j] = (s1+s2+up)%10; up = 1; } j++; l++; } n = 0; for(m=a-b-1;m>=0;m--){ s3 = str1[m]; if(((s3-'0')+up)<10){ sum[b+n] = (s3-'0')+up; up = 0; }else{ sum[b+n] = ((s3-'0')+up)%10; up = 1; } n++; } if(up == 1){ sum[a] = 1; if(a>=80){ printf("overflow"); }else{ for(v=a;v>=0;v--){ printf("%d",sum[v]); } } }else{ if(a>=81){ printf("overflow"); }else{ for(v=a-1;v>=0;v--){ printf("%d",sum[v]); } } } up = 0; printf("\n"); } for(y=0;y<100;y++){ sum[y]=0; } memset(str1,'\0',a); memset(str2,'\0',b); } return 0; }
main.c:1:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | de<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type name 'size_t'