submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s441967484
p00019
Java
package Factorial; import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int number = in.nextInt(); if (number <= 1 || number >= 20) { } else { System.out.println(factorial(number)); } } } public static int factorial(int num) { if (num <= 1) { return 1; } else { return num * factorial(num - 1); } } }
Main.java:5: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial { ^ 1 error
s781644676
p00019
Java
import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int number = in.nextInt(); if (number <= 1 || number >= 20) { } else { System.out.println(factorial(number)); } } } public static int factorial(int num) { if (num == 0) { return 1; } if (num == 1) { return 1; } else { return num * factorial(num - 1); } } }
Main.java:3: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial { ^ 1 error
s395868129
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int number = sc.nextInt(); int factorial = number; for(int i = 1; i < number; i++){ factorial = factorial*(number - i); } System.out.println(factorial); } } }
Main.java:9: error: cannot find symbol int number = sc.nextInt(); ^ symbol: variable sc location: class Main 1 error
s935080431
p00019
Java
public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = sc.nextInt(); int factorial = number; for(int i = 1; i < n; i++){ factorial = factorial*(number - i); } System.out.println(factorial); }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) 1 error
s635267033
p00019
Java
public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = sc.nextInt(); int factorial = number; for(int i = 1; i < n; i++){ factorial = factorial*(number - i); } System.out.println(factorial); }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) 1 error
s891581056
p00019
Java
class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = sc.nextInt(); int factorial = number; for(int i = 1; i < n; i++){ factorial = factorial*(number - i); } System.out.println(factorial); } }
Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol int number = sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:9: error: cannot find symbol for(int i = 1; i < n; i++){ ^ symbol: variable n location: class Main 4 errors
s120821359
p00019
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = sc.nextInt(); int factorial = number; for(int i=1; i < n; i++){ factorial = factorial * (number - i); } System.out.println(factorial); } }
Main.java:8: error: cannot find symbol int number = sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:11: error: cannot find symbol for(int i=1; i < n; i++){ ^ symbol: variable n location: class Main 2 errors
s209854048
p00019
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = sc.nextInt(); int factorial = number; for(int i = 1; i < number; i++){ factorial = factorial*(number - i); } System.out.println(factorial); } }
Main.java:7: error: cannot find symbol int number = sc.nextInt(); ^ symbol: variable sc location: class Main 1 error
s033520214
p00019
Java
class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = in.nextInt(); int factorial = number; for(int i = 1; i < number; i++){ factorial = factorial*(number - i); } System.out.println(factorial); } }
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s245110609
p00019
Java
class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int number = in.nextInt(); int factorial = number; for(int i = 1; i < number; i++){ factorial = factorial*(number - i); } System.out.println(factorial); } }
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s776534063
p00019
Java
import java.util.*; import java.math.*; 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(); BigInteger b = BigInteger.valueOf(1); for(int i = n; i > 0; i--){ b *= b.multiply(BigInteger.valueOf(i)); } System.out.printf("%s\n", b.toString()); } } }
Main.java:13: error: bad operand types for binary operator '*' b *= b.multiply(BigInteger.valueOf(i)); ^ first type: BigInteger second type: BigInteger 1 error
s831561215
p00019
Java
package practice; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Factorial { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int n = Integer.parseInt(str); System.out.println(math(n)); } static int math(int n){ for(int i = n ; 1 < i ; i--) { if (i == 0){ break; } n *= (i-1); } return n; } }
Main.java:7: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial { ^ 1 error
s277353750
p00019
Java
import java.util.*; /* Main class for AOJ where there is no input. */ public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = Integer.parseInt(sc.nextLine()); System.out.println(factorial(n)); }//main public static long factorial(long n){ if(n == 1){ return 1; }else{ return n * factorial(n - 1); } }
Main.java:18: error: reached end of file while parsing } ^ 1 error
s965901592
p00019
Java
import java.util.Scanner; public class p0019{ public p0019(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int t = 1; while(n > 1){ t *= n--; } System.out.println(t); } public static void main(String[] args){ p0019 test = new p0019(); } }
Main.java:3: error: class p0019 is public, should be declared in a file named p0019.java public class p0019{ ^ 1 error
s381429300
p00019
Java
public class Main { Scanner sc = new Scanner(System.in); int rep(int n){ if(n == 0){ return 1; }else{ return rep(n-1)*n; } } void run(){ int n = sc.nextInt(); System.out.println(rep(n)); } public static void main(String[] args){ Main m = new Main(); m.run(); } }
Main.java:2: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:2: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s058326035
p00019
Java
public class ku { /** * @param args */ public static void main(String[] args) throws java.io.IOException{ int n=System.in.read(); System.out.print(fact(n)); // TODO 自動生成されたメソッド・スタブ } public static int fact(int n){ if(n==0) return 1; return n*fact(n-1); } }
Main.java:1: error: class ku is public, should be declared in a file named ku.java public class ku { ^ 1 error
s228942238
p00019
Java
class Main{ public static void main(String[] args) throws java.io.IOException{ BufferedReader d = new BufferedReader(new InputStreamReader(System.in)); String n=d.readLine(); System.out.print(fact(Integer.parseInt(n))); // TODO 自動生成されたメソッド・スタブ } public static int fact(int n){ if(n==0) return 1; return n*fact(n-1); }; }}
Main.java:17: error: class, interface, enum, or record expected }} ^ 1 error
s968078248
p00019
Java
class Main{public static void main(String[] args) throws java.io.IOException{ BufferedReader d = new BufferedReader(new InputStreamReader(System.in)); String n=d.readLine(); System.out.print(fact(Integer.parseInt(n))); // TODO 自動生成されたメソッド・スタブ } public static long fact(int n){ if(n==0) return 1; return n*fact(n-1); }
Main.java:13: error: reached end of file while parsing } ^ 1 error
s603134865
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int fact = sc.nextInt(); for(int i = fact-1;i >= 1;i--){ fact *= i; } System.out.println(fact); exit(0); } }
Main.java:11: error: cannot find symbol exit(0); ^ symbol: method exit(int) location: class Main 1 error
s303490821
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int fact = factorial(sc.nextInt()); System.out.println(fact); } public static int factorial(int n){ for(int i = fact-1;i >= 1;i--){ fact *= i; } } }
Main.java:12: error: cannot find symbol for(int i = fact-1;i >= 1;i--){ ^ symbol: variable fact location: class Main Main.java:13: error: cannot find symbol fact *= i; ^ symbol: variable fact location: class Main 2 errors
s899890032
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int fact = factorial(sc.nextInt()); System.out.println(fact); } public static int factorial(int n){ for(int i = fact-1;i >= 1;i--){ fact *= i; } return fact; } }
Main.java:12: error: cannot find symbol for(int i = fact-1;i >= 1;i--){ ^ symbol: variable fact location: class Main Main.java:13: error: cannot find symbol fact *= i; ^ symbol: variable fact location: class Main Main.java:15: error: cannot find symbol return fact; ^ symbol: variable fact location: class Main 3 errors
s234324192
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long fact = factorial(sc.nextInt()); System.out.println(fact); } public static int factorial(long fact){ if(fact == 0){ fact = 1; }else{ for(int i = fact-1;i >= 1;i--){ fact *= i; } } return fact; } }
Main.java:14: error: incompatible types: possible lossy conversion from long to int for(int i = fact-1;i >= 1;i--){ ^ Main.java:18: error: incompatible types: possible lossy conversion from long to int return fact; ^ 2 errors
s716930700
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long fact = factorial((long)sc.nextInt()); System.out.println(fact); } public static int factorial(long fact){ if(fact == 0){ fact = 1; }else{ for(int i = fact-1;i >= 1;i--){ fact *= i; } } return fact; } }
Main.java:14: error: incompatible types: possible lossy conversion from long to int for(int i = fact-1;i >= 1;i--){ ^ Main.java:18: error: incompatible types: possible lossy conversion from long to int return fact; ^ 2 errors
s849853883
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long fact = factorial(sc.nextLong()); System.out.println(fact); } public static int factorial(long fact){ if(fact == 0){ fact = 1; }else{ for(int i = fact-1;i >= 1;i--){ fact *= i; } } return fact; } }
Main.java:14: error: incompatible types: possible lossy conversion from long to int for(int i = fact-1;i >= 1;i--){ ^ Main.java:18: error: incompatible types: possible lossy conversion from long to int return fact; ^ 2 errors
s294649590
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long fact = factorial(sc.nextLong()); System.out.println(fact); } public static int factorial(long fact){ if(fact == 0){ fact = 1; }else{ for(int i = fact-1;i >= 1;i--){ fact *= i; } } return fact; } }
Main.java:14: error: incompatible types: possible lossy conversion from long to int for(int i = fact-1;i >= 1;i--){ ^ Main.java:18: error: incompatible types: possible lossy conversion from long to int return fact; ^ 2 errors
s408486477
p00019
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long fact = factorial(sc.nextLong()); System.out.println(fact); } public static long factorial(long fact){ if(fact == 0){ fact = 1; }else{ for(int i = fact-1;i >= 1;i--){ fact *= i; } } return fact; } }
Main.java:14: error: incompatible types: possible lossy conversion from long to int for(int i = fact-1;i >= 1;i--){ ^ 1 error
s272497692
p00019
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int ans = 1; for(int i = 2; i<=n; i++) ans*=i; System.out.println(ans); } }
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s565283742
p00019
Java
import java.util.Scanner; public class aoj0019{ public static void main(String args[]){ Scanner s=new Scanner(System.in); long n=s.nextInt(),a=1; for(int i=1;i<=n;++i)a*=i; System.out.println(a); } }
Main.java:3: error: class aoj0019 is public, should be declared in a file named aoj0019.java public class aoj0019{ ^ 1 error
s228151122
p00019
Java
class Main { public static void main(String[] args) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(reader.readLine()); int fact = 1; for(int i = n;i >= 1;i--) { fact *= i; } System.out.println(fact); } catch(IOException e) { System.out.println(e); } } }
Main.java:4: error: cannot find symbol BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:12: error: cannot find symbol catch(IOException e) { ^ symbol: class IOException location: class Main 4 errors
s613503052
p00019
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package march17; /** * * @author Daffodil */ public class Factorial { public static void main(String[] args) { int a = 5; int fact = 1; for (int i = 1; i <= 5; i++) { fact = (fact * i); } System.out.println("Fact=" + fact); } }
Main.java:11: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial { ^ 1 error
s088255090
p00019
C
#include<stdio.h> long long int jou(long long int n); int main(){ long long int n; scanf("%lld",&n); printf("%lld\n",jou(n)); return 0; } int jou(int n){ if(n == 1 || n == 0){ return 1; } else{ return(n*jou(n-1)); } }
main.c:10:5: error: conflicting types for 'jou'; have 'int(int)' 10 | int jou(int n){ | ^~~ main.c:2:15: note: previous declaration of 'jou' with type 'long long int(long long int)' 2 | long long int jou(long long int n); | ^~~
s807990545
p00019
C
#include<stdio.h> main(){ int n,j=1; scanf("%d",&n); for(i=2;i<=n;i++){ j = j*i; } printf("%d\n",j); return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:5:7: error: 'i' undeclared (first use in this function) 5 | for(i=2;i<=n;i++){ | ^ main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
s396195517
p00019
C
#include <stdio.h> int main(void) { int n; __int64 f = 1;; scanf("%d", &n); while (n > 1){ f *= n; n--; } printf("%I64d\n", f); return 0; }
main.c: In function 'main': main.c:6:9: error: unknown type name '__int64'; did you mean '__int64_t'? 6 | __int64 f = 1;; | ^~~~~~~ | __int64_t
s015364631
p00019
C
#include<stdio.h> int f(int x){ if( x == 0 || x == 1) return 1; return x * f(x-1); } int main(void){ int n; scanf("%d",&n); printf("%d\n",f(n)); return 0; } scanf("%d",&n); printf("%d\n",f(n)); return 0; }
main.c:20:11: error: expected declaration specifiers or '...' before string constant 20 | scanf("%d",&n); | ^~~~ main.c:20:16: error: expected declaration specifiers or '...' before '&' token 20 | scanf("%d",&n); | ^ main.c:22:12: error: expected declaration specifiers or '...' before string constant 22 | printf("%d\n",f(n)); | ^~~~~~ main.c:22:19: error: expected declaration specifiers or '...' before 'f' 22 | printf("%d\n",f(n)); | ^ main.c:24:5: error: expected identifier or '(' before 'return' 24 | return 0; | ^~~~~~ main.c:25:3: error: expected identifier or '(' before '}' token 25 | } | ^
s888606199
p00019
C
#include <stdio.h> int main(void){ int n,t,a=1; scanf("%d",&n); for(t=2;t<=n;t++){ a = a*t } printf("%d",a); return 0; }
main.c: In function 'main': main.c:7:13: error: expected ';' before '}' token 7 | a = a*t | ^ | ; 8 | } | ~
s481811164
p00019
C
#nclude <stdio.h> #include<math.h> int main() { long long int t,s fac=1; scanf(%lld,&t); for(s=t;s>=1;s--) { fac=fac*s; } printf("%lld"\n,fac); return 0; }
main.c:1:2: error: invalid preprocessing directive #nclude; did you mean #include? 1 | #nclude <stdio.h> | ^~~~~~ | include main.c: In function 'main': main.c:5:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fac' 5 | long long int t,s fac=1; | ^~~ main.c:6:4: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf(%lld,&t); | ^~~~~ main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 2 | #include<math.h> +++ |+#include <stdio.h> 3 | int main() main.c:6:4: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf(%lld,&t); | ^~~~~ main.c:6:4: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:10: error: expected expression before '%' token 6 | scanf(%lld,&t); | ^ main.c:8:8: error: 's' undeclared (first use in this function) 8 | for(s=t;s>=1;s--) | ^ main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in main.c:10:8: error: 'fac' undeclared (first use in this function) 10 | fac=fac*s; | ^~~ main.c:12:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | printf("%lld"\n,fac); | ^~~~~~ main.c:12:4: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:12:4: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:17: error: stray '\' in program 12 | printf("%lld"\n,fac); | ^ main.c:12:17: error: expected ')' before 'n' 12 | printf("%lld"\n,fac); | ~ ^~ | )
s737148577
p00019
C
#nclude <stdio.h> #include<math.h> int main() { long long int t,s fac=1; scanf(%lld,&t); for(s=t;s>=1;s--) { fac=fac*s; } printf("%lld"\n,fac); return 0; }
main.c:1:2: error: invalid preprocessing directive #nclude; did you mean #include? 1 | #nclude <stdio.h> | ^~~~~~ | include main.c: In function 'main': main.c:5:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fac' 5 | long long int t,s fac=1; | ^~~ main.c:6:4: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf(%lld,&t); | ^~~~~ main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 2 | #include<math.h> +++ |+#include <stdio.h> 3 | int main() main.c:6:4: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf(%lld,&t); | ^~~~~ main.c:6:4: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:10: error: expected expression before '%' token 6 | scanf(%lld,&t); | ^ main.c:8:8: error: 's' undeclared (first use in this function) 8 | for(s=t;s>=1;s--) | ^ main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in main.c:10:8: error: 'fac' undeclared (first use in this function) 10 | fac=fac*s; | ^~~ main.c:12:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | printf("%lld"\n,fac); | ^~~~~~ main.c:12:4: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:12:4: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:17: error: stray '\' in program 12 | printf("%lld"\n,fac); | ^ main.c:12:17: error: expected ')' before 'n' 12 | printf("%lld"\n,fac); | ~ ^~ | )
s196317159
p00019
C
#include <stdio.h> #include<math.h> int main() { long long int t,s fac=1; scanf(%lld,&t); for(s=t;s>=1;s--) { fac=fac*s; } printf("%lld"\n,fac); return 0; }
main.c: In function 'main': main.c:6:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fac' 6 | long long int t,s fac=1; | ^~~ main.c:7:10: error: expected expression before '%' token 7 | scanf(%lld,&t); | ^ main.c:9:8: error: 's' undeclared (first use in this function) 9 | for(s=t;s>=1;s--) | ^ main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in main.c:11:8: error: 'fac' undeclared (first use in this function) 11 | fac=fac*s; | ^~~ main.c:13:17: error: stray '\' in program 13 | printf("%lld"\n,fac); | ^ main.c:13:17: error: expected ')' before 'n' 13 | printf("%lld"\n,fac); | ~ ^~ | )
s441529102
p00019
C
#include<stdio.h> int main() { long int fact,i,n; fact=1; for(i=1; i<=n; i++){ fact=fact*i; } printf("%ld\n",fact); } return 0; }
main.c:18:5: error: expected identifier or '(' before 'return' 18 | return 0; | ^~~~~~ main.c:19:1: error: expected identifier or '(' before '}' token 19 | } | ^
s375820924
p00019
C
#include<stdio.h> #include<math.h> int main() { long long i,n; long long rlt=1; scanf("%lld",&n); for(i=1;i<=n;i++){ rslt*=i; } printf("%lld\n",rslt); return 0; }
main.c: In function 'main': main.c:10:13: error: 'rslt' undeclared (first use in this function); did you mean 'rlt'? 10 | rslt*=i; | ^~~~ | rlt main.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
s269652252
p00019
C
#include <stdio.h> int main(void) { int n; int i; long sum; sum = 1; scanf("%d", &n); for (i = 1; i <= n; i++){ sum *= i; } printf("%d\n", sum); } return (0); }
main.c:19:9: error: expected identifier or '(' before 'return' 19 | return (0); | ^~~~~~ main.c:20:1: error: expected identifier or '(' before '}' token 20 | } | ^
s141818186
p00019
C
include<stdio.h> #include<inttypes.h> int main(int argc, char *argv[]) { uint_fast8_t i; uint_fast64_t a; scanf("%"SCNdFAST64, &a); for (i = a - 1; i > 0; i--) a *= i; printf("%"PRIdFAST64"\n", a); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ main.c: In function 'main': main.c:10:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%"SCNdFAST64, &a); | ^~~~~ main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 2 | #include<inttypes.h> +++ |+#include <stdio.h> 3 | main.c:10:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | scanf("%"SCNdFAST64, &a); | ^~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | printf("%"PRIdFAST64"\n", a); | ^~~~~~ main.c:13:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:13:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s160675146
p00019
C
#include<stdio.h> int main(){ double n,i,kai; kai=1; scanf("%d",&n); for (i = 1; i <= n; i++) { kai = kai*i; } printf("%d\n",int(kai)); return 0; }
main.c: In function 'main': main.c:14:17: error: expected expression before 'int' 14 | printf("%d\n",int(kai)); | ^~~
s976962456
p00019
C
#include <stdio.h> int main(void) { int n,fact=1,i; scanf("%d",&n); for(i=2;i<=n;i++) fact=fact*i; printf("%d",fact); retrurn 0; }
main.c: In function 'main': main.c:9:1: error: 'retrurn' undeclared (first use in this function) 9 | retrurn 0; | ^~~~~~~ main.c:9:1: note: each undeclared identifier is reported only once for each function it appears in main.c:9:8: error: expected ';' before numeric constant 9 | retrurn 0; | ^~ | ;
s589876764
p00019
C
#include<stdio.h> int main(void){ int n, i; long sum; scanf("%d", &n) for ( i = 1; i <= n; i++ ) { sum *= n; } printf("%ld", sum); return 0; }
main.c: In function 'main': main.c:5:19: error: expected ';' before 'for' 5 | scanf("%d", &n) | ^ | ; 6 | for ( i = 1; i <= n; i++ ) { | ~~~
s532907992
p00019
C
#include<stdio.h> int main() { int n; unsigned long long f=1; scanf("%d",&n); for(n;n>=1;n--) { f=n*f; } printf("%lu\n",f); return 0;
main.c: In function 'main': main.c:13:3: error: expected declaration or statement at end of input 13 | return 0; | ^~~~~~
s904698477
p00019
C
Select Code #include<stdio.h> int main() { unsigned long long int a,b=1; scanf("%llu",&a); for(a;a>=1;a--) { b=b*a; } printf("%llu\n",b); return 0; }
main.c:1:1: error: unknown type name 'Select' 1 | Select Code | ^~~~~~ main.c:1:12: error: expected ';' before 'typedef' 1 | Select Code | ^ | ;
s187664638
p00019
C
#include<stdio.h> int main(){ int n; long ans; ans = 1; scanf("%d",&n); if(n==0){ans=1;} else{ for(i=1;i<=n;i++)ans*=i; } printf("%ld",ans); return 0; }
main.c: In function 'main': main.c:13:6: error: 'i' undeclared (first use in this function) 13 | for(i=1;i<=n;i++)ans*=i; | ^ main.c:13:6: note: each undeclared identifier is reported only once for each function it appears in
s473389991
p00019
C
#include <stdio.h> int main(void){ int n,i,P; P=1; n<=1&&n<=20 scanf("%d",&n); for(i=1;i<=n;i++){ P=P*i; } printf("%d\n",P); return 0; }
main.c: In function 'main': main.c:5:15: error: expected ';' before 'scanf' 5 | n<=1&&n<=20 | ^ | ; 6 | scanf("%d",&n); | ~~~~~
s948158841
p00019
C
#include <stdio.h> int main(){ int i,n,k; k=1; scanf("%d",&n); for(i=1;i<=n;i++){ k=k*i; } printf("%d\n",k); returun 0; }
main.c: In function 'main': main.c:11:1: error: 'returun' undeclared (first use in this function) 11 | returun 0; | ^~~~~~~ main.c:11:1: note: each undeclared identifier is reported only once for each function it appears in main.c:11:8: error: expected ';' before numeric constant 11 | returun 0; | ^~ | ;
s818613404
p00019
C
#include<stdio.h> scanf("%d",&n); int kaizi(int a){ if(a>0) return (n*kaizi(n-1)); else return 1;} int main(){ int n; scanf("%d",&n); printf("%d",kaizi(n)); return 0; }
main.c:2:7: error: expected declaration specifiers or '...' before string constant 2 | scanf("%d",&n); | ^~~~ main.c:2:12: error: expected declaration specifiers or '...' before '&' token 2 | scanf("%d",&n); | ^ main.c: In function 'kaizi': main.c:5:9: error: 'n' undeclared (first use in this function) 5 | return (n*kaizi(n-1)); | ^ main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
s104737628
p00019
C
#include<stdio.h> int kaizi(int a){ if(a>0) return (n*kaizi(n-1)); else return 1;} int main(){ int n; scanf("%d",&n); printf("%d",kaizi(n)); return 0; }
main.c: In function 'kaizi': main.c:4:9: error: 'n' undeclared (first use in this function) 4 | return (n*kaizi(n-1)); | ^ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
s621638973
p00019
C
#include<stdio.h> #include<stdlib.h> int main(int argc,char *argv[]){ int cnt ,i,kaeru; long long int num; char total[10]; gets(total); kaeru= atoi(total); for( cnt = 1 ; cnt <=kaeru ; cnt++ ){ num = 1; for( i = cnt ; i >= 1 ; i-- ){ num *= i; } printf("%d! = %lld\n", cnt, num); } }
main.c: In function 'main': main.c:9:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 9 | gets(total); | ^~~~ | fgets
s698258403
p00019
C
#include<stdio.h> #include<stdlib.h> int main(){ int cnt ,i,kaeru; long long int num; char total[10]; gets(total); kaeru= atoi(total); for( cnt = 1 ; cnt <=kaeru ; cnt++ ){ num = 1; for( i = cnt ; i >= 1 ; i-- ){ num *= i; } printf("%d! = %lld\n", cnt, num); } return 0; }
main.c: In function 'main': main.c:9:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 9 | gets(total); | ^~~~ | fgets
s755755885
p00019
C
#include<stdio.h> #include<stdlib.h> int i,n; __int64 ans[25]; int main(){ scanf("%d",&n); ans[1]=1; for(i=2;i<=n;i++)ans[i]=ans[i-1]*i; printf("%lld",ans[n]); return 0; }
main.c:5:1: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 ans[25]; | ^~~~~~~ | __int64_t
s513236095
p00019
C
#include<stdio.h> #include<stdlib.h> int i,n; __int64 ans[25]; int main(){ scanf("%d",&n); ans[1]=1; for(i=2;i<=n;i++)ans[i]=ans[i-1]*i; printf("%lld",ans[n]); return 0; }
main.c:5:1: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 ans[25]; | ^~~~~~~ | __int64_t
s422645459
p00019
C
#include<stdio.h> #include<stdlib.h> int i,n; __int64 ans[25]; int main(){ scanf("%d",&n); ans[1]=1; for(i=2;i<=n;i++)ans[i]=ans[i-1]*i; printf("%lld",ans[n]); return 0; }
main.c:5:1: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 ans[25]; | ^~~~~~~ | __int64_t
s337225385
p00019
C
#include<stdio.h> main(){ int n,sum=1; scanf ("%d",&n){ while(n!=1){ sum*=n; n--; } } printf("%d\n",sum); return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:4:18: error: expected ';' before '{' token 4 | scanf ("%d",&n){ | ^ | ;
s990569404
p00019
C
#include<stdio.h> main(){ int n,sum=1; scanf ("%d",&n)ツ; while(n!=1){ sum*=n; n--; } } printf("%d\n",sum); return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:4:18: error: expected ';' before '\U000030c4\U0000ff1b' 4 | scanf ("%d",&n)ツ; | ^~~~ | ; main.c: At top level: main.c:10:10: error: expected declaration specifiers or '...' before string constant 10 | printf("%d\n",sum); | ^~~~~~ main.c:10:17: error: unknown type name 'sum' 10 | printf("%d\n",sum); | ^~~ main.c:11:3: error: expected identifier or '(' before 'return' 11 | return 0; | ^~~~~~ main.c:12:1: error: expected identifier or '(' before '}' token 12 | } | ^
s461992191
p00019
C
#include<stdio.h> main(){ int n,sum=1; scanf ("%d",&n); while(n!=1){ sum*=n; n--; } } printf("%d\n",sum); return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c:10:10: error: expected declaration specifiers or '...' before string constant 10 | printf("%d\n",sum); | ^~~~~~ main.c:10:17: error: unknown type name 'sum' 10 | printf("%d\n",sum); | ^~~ main.c:11:3: error: expected identifier or '(' before 'return' 11 | return 0; | ^~~~~~ main.c:12:1: error: expected identifier or '(' before '}' token 12 | } | ^
s860228200
p00019
C
n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));}
main.c:1:1: warning: data definition has no type or storage class 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:3: warning: data definition has no type or storage class 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~ main.c:1:3: error: type defaults to 'int' in declaration of 'gets' [-Wimplicit-int] main.c:1:10: error: return type defaults to 'int' [-Wimplicit-int] 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~ main.c: In function 'main': main.c:1:20: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} main.c:1:20: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~~~ main.c:1:20: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:35: error: implicit declaration of function 'tgamma' [-Wimplicit-function-declaration] 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'tgamma' +++ |+#include <math.h> 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} main.c:1:35: warning: incompatible implicit declaration of built-in function 'tgamma' [-Wbuiltin-declaration-mismatch] 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~~~ main.c:1:35: note: include '<math.h>' or provide a declaration of 'tgamma' main.c:1:42: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration] 1 | n;gets();main(){n=!printf("%.f\n",tgamma(atoi(gets())+1));} | ^~~~
s104420243
p00019
C
n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));}
main.c:1:1: warning: data definition has no type or storage class 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} | ^~~~ main.c: In function 'main': main.c:1:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} main.c:1:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} | ^~~~~ main.c:1:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:28: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} | ^~~~~~ main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:28: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:43: error: implicit declaration of function 'tgammma' [-Wimplicit-function-declaration] 1 | n;main(){scanf("%d",&n);n=!printf("%.f\n",tgammma(n+1));} | ^~~~~~~
s921054058
p00019
C
#include<stdio.h> typedef long long ll; ll func(ll); ll memo[21]; int main(void){ ll x,i; for(i=0;2<21;i++) memo[n]=0; scanf("%lld",&x); printf("%lld\n",func(x)); return 0; } ll func(ll n){ if(n==0)return 1; if(memo[n]!=0)return memo[n]; return memo[n]=n * func(n-1); }
main.c: In function 'main': main.c:9:6: error: 'n' undeclared (first use in this function) 9 | memo[n]=0; | ^ main.c:9:6: note: each undeclared identifier is reported only once for each function it appears in
s312684809
p00019
C
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(void){ char*(*f)(char*) = gets; char s[20]; f(s); printf("%.f\n",tgamma(atoi(s)+1)); return 0; }
main.c: In function 'main': main.c:5:28: error: 'gets' undeclared (first use in this function); did you mean 'fgets'? 5 | char*(*f)(char*) = gets; | ^~~~ | fgets main.c:5:28: note: each undeclared identifier is reported only once for each function it appears in
s591770966
p00019
C
import java.io.*; class Main{ public static void main(String[] args) throws java.io.IOException{ BufferedReader d = new BufferedReader(new InputStreamReader(System.in)); String n=d.readLine(); System.out.print(fact(Integer.parseInt(n))); // TODO 自動生成されたメソッド・スタブ } public static int fact(int n){ if(n==0) return 1; return n*fact(n-1); } }
main.c:1:1: error: unknown type name 'import' 1 | import java.io.*; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.io.*; | ^ main.c:3:1: error: unknown type name 'class' 3 | class Main{ | ^~~~~ main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 3 | class Main{ | ^
s129445316
p00019
C
import java.io.*; import java.math.*; public class Main { /** * @param args */ public static void main(String[] args) throws java.io.IOException{ BufferedReader d = new BufferedReader(new InputStreamReader(System.in)); String n=d.readLine(); System.out.println(fact(Integer.parseInt(n))); // TODO 自動生成されたメソッド・スタブ } public static long fact(int n){ if(n==0) return 1; return n*fact(n-1); } }
main.c:1:1: error: unknown type name 'import' 1 | import java.io.*; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.io.*; | ^ main.c:2:1: error: unknown type name 'import' 2 | import java.math.*; | ^~~~~~ main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | import java.math.*; | ^ main.c:3:1: error: unknown type name 'public' 3 | public class Main { | ^~~~~~ main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 3 | public class Main { | ^~~~
s208077438
p00019
C
include <stdio.h> int main() { long m=1,n; scanf("%ld",&n); while(n>1)m=m*n--; printf("%ld\n",m); return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s229492669
p00019
C
include <stdio.h> int main() { long n,o=1; scanf("%ld",&n); while(n>1)o=o*n--; printf("%ld\n",o); return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s822119439
p00019
C
#include<stdio.h>int main(void){int n,i,out=1;scanf("%d",&n);for(i=1;i<=n;i++)out=out*i;printf("%d",out);return 0:}
main.c:1:18: warning: extra tokens at end of #include directive 1 | #include<stdio.h>int main(void){int n,i,out=1;scanf("%d",&n);for(i=1;i<=n;i++)out=out*i;printf("%d",out);return 0:} | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s030341580
p00019
C
double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);}
main.c: In function 'factorial': main.c:1:40: error: invalid type argument of unary '*' (have 'double') 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~~~~~~~~~~~~ main.c: At top level: main.c:1:71: error: return type defaults to 'int' [-Wimplicit-int] 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~ main.c: In function 'main': main.c:1:87: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} main.c:1:87: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~~ main.c:1:87: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:103: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~~~ main.c:1:103: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:103: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:103: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:132: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} main.c:1:132: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | double factorial(double n){if(n)return *factorial(n-1);else return 1;}main(){double n;scanf("%lf",&n);printf("%.f\n",factorial(n));exit(0);} | ^~~~ main.c:1:132: note: include '<stdlib.h>' or provide a declaration of 'exit'
s292146682
p00019
C
#include <stdio.h> #include <math.h> int main() { int n; int result=1; while(1){ scanf("%d",&n); if(1<=n<=20){ break; } for(n=n; n>=1; n--){ result*=n; } printf("%d\n",result); return 0; }
main.c: In function 'main': main.c:17:1: error: expected declaration or statement at end of input 17 | } | ^
s159859599
p00019
C
#include<stdio.h> #include<math.h> int main(void){ long long int a=1; int n,i; scanf("%d",n); for(i=2; i<=n; i++;){ a*=i; } printf("%lld\n",a); return 0; }
main.c: In function 'main': main.c:7:23: error: expected ')' before ';' token 7 | for(i=2; i<=n; i++;){ | ~ ^ | )
s443043948
p00019
C
} int main(){ int n,r; scanf("%d",&n); r = fact(n); printf("%d\n",r); return 0; }
main.c:2:1: error: expected identifier or '(' before '}' token 2 | } | ^ main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d",&n); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:13: error: implicit declaration of function 'fact' [-Wimplicit-function-declaration] 6 | r = fact(n); | ^~~~ main.c:7:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("%d\n",r); | ^~~~~~ main.c:7:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:7:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:7:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s464689689
p00019
C
#include<stdio.h> int main(){ int num; scanf("%d",&num); int i=1,result=1; for(;i<=n;i++) result*=i; printf("%d\n",result); return 0; }
main.c: In function 'main': main.c:6:9: error: 'n' undeclared (first use in this function) 6 | for(;i<=n;i++) | ^ main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
s263491387
p00019
C
#include<stdio.h> int main() { int i,n; scanaf("%d",&n); for(i=1;i<=n;i++) { n=n*i; printf("d",n); }
main.c: In function 'main': main.c:5:3: error: implicit declaration of function 'scanaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scanaf("%d",&n); | ^~~~~~ | scanf main.c:10:2: error: expected declaration or statement at end of input 10 | } | ^
s370015938
p00019
C
#include <iostream> using namespace std; int main() { int num, fact=1; cin >> num; for(int j=1 ; j<=num; j++) { fact *= j; } cout << "\n\nThe factorial of " << num << " is " << fact << endl; cout <<"\n"; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s758812140
p00019
C
#include<iostream> using namespace std; int f(int n) { if ( n == 1) return 1; if ( n == 2) return 2; return n * f(n-1); } int main() { f(5); return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s250943512
p00019
C
#include <iostream> using namespace std; long long fact(int n) { if(n==1) return 1; if(n==2) return 2; return n*fact(n-1); } int main() { int n; cin >> n; cout << fact(n) << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s943132735
p00019
C
#include<iostream> using namespace std; int main() { int num,factorial=1; cin>>num; for(int a=1;a<=num;a++) { factorial=factorial*a; } cout<<factorial; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s328175782
p00019
C
#include<cstdio> using namespace std; int main () { int n,s=1; scanf("%d",&n); for(int i=n;i>=1;i--) { s=s*i; } printf("%d",s); }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s946403997
p00019
C
#include <cstdio> long long fac(int a) { if(a==0)return (long long)1; else return (long long)a * fac(a - 1) ; } int main() { int n; scanf("%d",&n); printf("%lld\n",fac(n)); }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s334511539
p00019
C
#include <iostream> int fact(int n); using namespace std; int main () { int m; int factoriel; cout<<"Enter number: "; cin>>m; factoriel=fact(m); cout<<""<<factoriel<<endl; cin.get(); cin.get(); return 0; } int fact(int n) { int fact=1; int i; for (i=1; i<=n; i++) fact*=i; return fact; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s886824139
p00019
C
#include<stdio.h> typedef unsigned long long long ULONG; void func_fact(int n, ULONG *result); main() { int input = 0; ULONG result = 1; scanf("%d", &input); func_fact(input, &result); printf("%ld\n", result); return 0; } void func_fact(int n, ULONG *result) { static int i = 1; *result = *result * i; i++; if(i > n) { return; } else { func_fact(n, result); } }
main.c:3:28: error: 'long long long' is too long for GCC 3 | typedef unsigned long long long ULONG; | ^~~~ main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int] 6 | main() | ^~~~
s891514543
p00019
C
#include<stdio.h> #include<conio.h> void main() { int n; float sum,i; sum=1; i=1; scanf("%d",&n); if(n<=20) { while(i<=n) { sum=sum*i; i=i+1; } printf("%f",sum); } getch(); }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s651221318
p00019
C
#include<stdio.h> #include<conio.h> int main() { int n; float sum,i; sum=1; i=1; scanf("%d",&n); if(n<=20) { while(i<=n) { sum=sum*i; i=i+1; } printf("%f",sum); } getch(); return o; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s051138113
p00019
C
#include<stdio.h> #include<conio.h> int main() { int n; float sum,i; sum=1; i=1; scanf("%d",&n); if(n<=20) { while(i<=n) { sum=sum*i; i=i+1; } printf("%.0f",sum); } getch(); return 0; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s770239252
p00019
C
#include<stdio.h> #include<conio.h> int main() { int n,i=1; long long int sum; sum=1; i=1; scanf("%d",&n); if(n<=20) { while(i<=n) { sum=sum*i; i=i+1; } printf("%lld",sum); } getch(); return 0; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s050917689
p00019
C
#include<stdio.h> #include<conio.h> int main() { int n,i=1; long long int sum; sum=1; i=1; printf("\n\n"); scanf("%d",&n); if(n<=20) {while(i<=n) { sum=sum*i; i=i+1; } printf("\n\n%lld",sum); } else printf(" "); getch(); return 0; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s679948175
p00019
C
#include<stdio.h> #include<conio.h> int main() { int n,i=1; long long sum; sum=1; i=1; scanf("%d",&n); if(n<=20) {while(i<=n) { sum=sum*i; i=i+1; } printf("%lld",sum); } getch(); return 0; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s071502559
p00019
C
#include<stdio.h> #include<conio.h> int main() { int i,n,f; while(scanf("%d",&n)!=EOF){ f=1; for(i=1;i<=n;i++) f=f*i; printf("%d\n",f); } getch(); return 0; }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s645409815
p00019
C
#include <stdio.h> int fact (int n) { if(n==0) return 1; else return i*fact(n-1); } int main(void) { int i; scanf("%d", &i); printf("%d", fact(i)); return 0; }
main.c: In function 'fact': main.c:5:21: error: 'i' undeclared (first use in this function) 5 | else return i*fact(n-1); | ^ main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
s236208085
p00019
C
#include <stdio.h> int main(){ double n, ans = 1; int i; scanf("%lf",&n); for(i=1; i<=n; i++) ans *= i; printf("%0.f\n, ans); return 0; }
main.c: In function 'main': main.c:8:12: warning: missing terminating " character 8 | printf("%0.f\n, ans); | ^ main.c:8:12: error: missing terminating " character 8 | printf("%0.f\n, ans); | ^~~~~~~~~~~~~~ main.c:10:5: error: expected expression before 'return' 10 | return 0; | ^~~~~~ main.c:10:14: error: expected ';' before '}' token 10 | return 0; | ^ | ; 11 | } | ~
s861538553
p00019
C++
#include<iostream> using namespace std; int main() { int n, sum = 1; cin >> n; for (int i = 1;i <= n;i++) { sum = sum * i; } cout << sum << endl; return 0;
a.cc: In function 'int main()': a.cc:12:18: error: expected '}' at end of input 12 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s078440331
p00019
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; long long int ans; for(int i=1; i<=n; int i++) ans *= i; cout << ans << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:9:21: error: expected primary-expression before 'int' 9 | for(int i=1; i<=n; int i++) ans *= i; | ^~~ a.cc:9:20: error: expected ')' before 'int' 9 | for(int i=1; i<=n; int i++) ans *= i; | ~ ^~~~ | ) a.cc:9:26: error: expected initializer before '++' token 9 | for(int i=1; i<=n; int i++) ans *= i; | ^~
s992737167
p00019
C++
#include <iostream> using namespace std; int main() { int n; cin >> n int total=1; for(int i = 1; i <= n; i++){ total *= i; } cout << total << endl; return (0); }
a.cc: In function 'int main()': a.cc:8:17: error: expected ';' before 'int' 8 | cin >> n | ^ | ; 9 | int total=1; | ~~~ a.cc:12:25: error: 'total' was not declared in this scope 12 | total *= i; | ^~~~~ a.cc:15:25: error: 'total' was not declared in this scope 15 | cout << total << endl; | ^~~~~
s296697462
p00019
C++
#include<stdio.h> void main() { int a,b=1; clrscr(); printf("Please enter any number to find its factorial\n"); scanf("%d",&a); while(a>1) { b=b*a; a--; } printf("factorial is %d",b); getch(); }
a.cc:2:1: error: '::main' must return 'int' 2 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:5:1: error: 'clrscr' was not declared in this scope 5 | clrscr(); | ^~~~~~ a.cc:14:1: error: 'getch' was not declared in this scope; did you mean 'getc'? 14 | getch(); | ^~~~~ | getc
s114383911
p00019
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); long x = 1; for (int i = 2; i <= n; i++) { x = x * i; } System.out.println(x); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s131767579
p00019
C++
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); long x = 1; for (int i = 2; i <= n; i++) { x = x * i; } System.out.println(x); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class main { | ^~~~~~
s119459586
p00019
C++
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); long x = 1; for (int i = 2; i <= n; i++) { x = x * i; } System.out.println(x); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class main { | ^~~~~~
s276531869
p00019
C++
#include<iostream> using namesapce std; int main(){ int x; cin>>x; long long ans=1; for(int i=1;i<=x;i++)ans*=i; cout<<ans<<endl; }
a.cc:3:7: error: expected nested-name-specifier before 'namesapce' 3 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin>>x; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | cout<<ans<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:10:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 10 | cout<<ans<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~