submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s327352062 | p00004 | C++ | #include <iostream>
using namespace std;
int main() {
double a, b, c, d, e, f, x, y, t;
while(cin >> a >> b >> c >> d >> e >> f) {
t = 1.0 / (a*e - b*d);
x = (e*c - b*f) * t;
y = (a*f - d*c) * t;
cout << x << setprecision(3) << y << setprecision(3) << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:30: error: 'setprecision' was not declared in this scope
11 | cout << x << setprecision(3) << y << setprecision(3) << endl;
| ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably ... |
s512317149 | p00004 | C++ | #include <stdio.h>
#include<string>
#include<string.h>
#include <math.h>
#include<iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace std;
/*
//my header
#include "define.h"
#include "geometry.h"*/
void init()
{
#ifdef _WIN32
freopen("1.txt", "r", stdin);
#endif
}
voi... | a.cc:43:42: error: macro "MyAbs" passed 2 arguments, but takes just 1
43 | if(MyEqualDoule(a*e-b*d,0))
| ^
a.cc:35:9: note: macro "MyAbs" defined here
35 | #define MyAbs(a) ((a)>0?(a):-(a))
| ^~~~~
a.cc:48:42: error: macro "MyEqualDoule"... |
s716447114 | p00004 | C++ | #include <stdio.h>
#include<string>
#include<string.h>
#include <math.h>
#include<iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace std;
/*
//my header
#include "define.h"
#include "geometry.h"*/
#define MyAbs(a) ((a)>0?(a):-(a))
#define MyEqualDoule(a,b) (MyAbs(a-b)<1... | a.cc:49:42: error: macro "MyEqualDoule" requires 2 arguments, but only 1 given
49 | if(MyEqualDoule(b*d - a*e),0)
| ^
a.cc:19:9: note: macro "MyEqualDoule" defined here
19 | #define MyEqualDoule(a,b) (MyAbs(a-b)<1e-6)
| ^~~~~~~~~~~~
a.cc... |
s293954648 | p00004 | C++ | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
string toStr(int n);
string intToToStr(int n);
int main() {
int a, b, c, d, e, f;
while(cin >> a >> b >> c >> d >> e >> f) {
a = a * 10000;
b = b * 10000;
c = c * 10000;
d = d * 10000;
e = e * 10000;
f = f * 10000;... | a.cc: In function 'std::string toStr(int)':
a.cc:33:10: error: 'intToString' was not declared in this scope
33 | return intToString(ipart) + "." + intToString(fpart).substr(0, 3);
| ^~~~~~~~~~~
a.cc: In function 'std::string intToString(int)':
a.cc:37:17: error: expected initializer before 'ss'
3... |
s883283869 | p00004 | C++ | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
string toStr(int n);
string intToToString(int n);
int main() {
int a, b, c, d, e, f;
while(cin >> a >> b >> c >> d >> e >> f) {
a = a * 10000;
b = b * 10000;
c = c * 10000;
d = d * 10000;
e = e * 10000;
f = f * 100... | a.cc: In function 'std::string toStr(int)':
a.cc:33:10: error: 'intToString' was not declared in this scope; did you mean 'intToToString'?
33 | return intToString(ipart) + "." + intToString(fpart).substr(0, 3);
| ^~~~~~~~~~~
| intToToString
a.cc: In function 'std::string intToString(i... |
s808084163 | p00004 | C++ | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
string toStr(int n);
string intToString(int n);
int main() {
int a, b, c, d, e, f;
while(cin >> a >> b >> c >> d >> e >> f) {
a = a * 10000;
b = b * 10000;
c = c * 10000;
d = d * 10000;
e = e * 10000;
f = f * 10000... | a.cc: In function 'std::string intToString(int)':
a.cc:39:13: error: cannot resolve overloaded function 'str' based on conversion to type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
39 | return ss.str;
| ^~~
|
s857662388 | p00004 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,c,d,e,f;
while(cin >> a >> b >> c >> d >> e >> f){
double x = (e*c - b*f)/(e*a - b*d) + 1e-10;
double y = (d*c - a*f)/(d*b - a*e) + 1e-10;
cout << fixed << setprecision(3) << x << " " << y << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:22: error: 'setprecision' was not declared in this scope
9 | cout << fixed << setprecision(3) << x << " " << y << endl;
| ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#incl... |
s616662364 | p00004 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,c,d,e,f;
while(cin >> a >> b >> c >> d >> e >> f){
double x = (e*c - b*f)/(e*a - b*d) + 1e-10;
double y = (d*c - a*f)/(d*b - a*e) + 1e-10;
cout << fixed << setprecision(3) << x << " " << y << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:22: error: 'setprecision' was not declared in this scope
9 | cout << fixed << setprecision(3) << x << " " << y << endl;
| ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#incl... |
s397176157 | p00004 | C++ |
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
double a,b,c,d,e,f;
double x,y;
while(cin >> a >> b >> c >> d >> e >> f){
if(b*d - a*e != 0)
double tmp1 = (c*e - b*f),tmp2 = (a*e - b*d),tmp3 = (c*d - a*f),tmp4=(b*d - a*e);
tmp1 = tmp1/tmp2;
... | a.cc: In function 'int main()':
a.cc:15:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'?
15 | tmp1 = tmp1/tmp2;
| ^~~~
| tm
a.cc:15:21: error: 'tmp2' was not declared in this scope; did you mean 'tm'?
15 | tmp1 = tmp1/tmp2;
| ... |
s338241831 | p00004 | C++ | #include<cstdio>
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
double a,b,c,d,e,f,x,y;
while( cin >>a>>b>>c>>d>>e>>f){
x = (c*e - b*f)/(a*e - b*d);
y = (a*f - c*d)/(a*e - b*d);
cout <<fixed<<setorecision(3)<<x<<" "<<y<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:19: error: 'setorecision' was not declared in this scope
12 | cout <<fixed<<setorecision(3)<<x<<" "<<y<<endl;
| ^~~~~~~~~~~~
|
s611182213 | p00004 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int a,b,p,c,d,q;
float x,y;
while(cin >> a >> b >> c >> d >> e >> f)
{
x=(float)(d*p-b*q) / (a*d - b*c);
y=(float)(a*q-c*p) / (a*d - b*c);
x *= 1000;
x +=0,5;
x = (int)x;
x /= 1000;
y *= 1000;
... | a.cc: In function 'int main()':
a.cc:8:37: error: 'e' was not declared in this scope
8 | while(cin >> a >> b >> c >> d >> e >> f)
| ^
a.cc:8:42: error: 'f' was not declared in this scope
8 | while(cin >> a >> b >> c >> d >> e >> f)
| ... |
s033938486 | p00005 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner cin=new Scanner(System.in);
int a,b;
while(cin.hasNext()){
a=cin.nextInt();
b=cin.nextInt();
System.out.printf("%d\n%d... | Main.java:17: error: non-static method GCD(int,int) cannot be referenced from a static context
System.out.printf("%d\n%d\n",GCD(a,b),LCM(a,b));
^
Main.java:17: error: non-static method LCM(int,int) cannot be referenced from a static context
System.out.printf("%d\n%d\n",GCD(a,b),LCM... |
s111786769 | p00005 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(scan.hasNext())
{
long a,b,a1,b1;
a=sc.nextInt();
b=sc.nextInt();
a1=a;
b1=b;
if(b>a)
{
long tmp=b;
b=a;
a=tmp;
}
... | Main.java:6: error: cannot find symbol
while(scan.hasNext())
^
symbol: variable scan
location: class Main
1 error
|
s865316520 | p00005 | Java | public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a =scan.nextInt();
int b =scan.nextInt();
int gcd;
if(a>b){
gcd = gcd(a,b);
}else{
gcd = gcd(b, a);
}
int gld = a*b/gcd;
System.out.println(gcd + " " + gld);
scan.close();
}
private stat... | Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s282627275 | p00005 | Java | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
class Main {
public static void main(String[] arg) throws NumberFormatException,
IOException {
BufferedReader br = new Buffere... | Main.java:12: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class InputStreamReader
location: class Main
1 error
|
s258789234 | p00005 | Java | package sample;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
class Main {
public static void main(String[] arg) throws NumberFormatException,
IOException {
BufferedReader... | Main.java:14: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class InputStreamReader
location: class Main
1 error
|
s175586099 | p00005 | Java | import java.util.Scanner;
public class Solution {
public static void main(String[] args)
{
Scanner ab = new Scanner(System.in);
while( ab.hasNext())
{
long n,x,y,a,b,c,p;
a = ab.nextLong();
x = a;
b = ab.nextLong();
y = b;
while( a!=... | Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
1 error
|
s601471764 | p00005 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int a=sc.nextInt();
int b=sc.nextInt();
int c=gcd(a,b);
System.out.printf("%d %d%n",c,a*b/c);
}
}
int gcd(int x,inty){
int max=Math.max(x,y);
int min=Math.min(x,y);
if(max%min==0){return m... | Main.java:13: error: <identifier> expected
int gcd(int x,inty){
^
1 error
|
s828026138 | p00005 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int a=sc.nextInt();
int b=sc.nextInt();
int c=gcd(a,b);
System.out.printf("%d %d%n",c,a*b/c);
}
}
public static int gcd(int x,inty){
int max=Math.max(x,y);
int min=Math.min(x,y);
if(max%mi... | Main.java:13: error: <identifier> expected
public static int gcd(int x,inty){
^
1 error
|
s942967854 | p00005 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int a=sc.nextInt();
int b=sc.nextInt();
int c=gcd(a,b);
int d=a*b/c;
System.out.println(c+" "+d);
}
}
public static int gcd(int x,int y){
int max=Math.max(x,y);
int min=Math.min(x,y);
int ... | Main.java:17: error: ';' expected
int amari=max%min
^
1 error
|
s753539334 | p00005 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextLong()){
long a=sc.nextLong();
long b=sc.nextLong();
long c=gcd(a,b);
long d=(a*b)/c;
System.out.println(c+" "+d);
}
}
public static long gcd(int x,int y){
long max=Math.max(x,y);
long min=Math.mi... | Main.java:9: error: incompatible types: possible lossy conversion from long to int
long c=gcd(a,b);
^
Main.java:19: error: incompatible types: possible lossy conversion from long to int
else{return gcd(min,amari);}
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to ... |
s189533636 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
/**
* ???????????\????????£?????´??° a, b ?????\???????????¨??????a ??¨ b ????????§??¬?´???°??¨????°???¬?????°???????????????????????????????????°????????????????????????????????? ????????????a ??¨
* b ???????°???¬?????°??? 20 ???????¶??????????????????¨?????????... | Main.java:3: error: class GCDandLCM is public, should be declared in a file named GCDandLCM.java
public class GCDandLCM {
^
1 error
|
s865412193 | p00005 | Java | import java.util.Scanner;
public class HelloWorld{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int m = scanner.nextInt();
int n = scanner.nextInt();
int gcd = getGCD(m, n);
while(m <= 2000000000 && n <= 2000000000){
System.out.println(getLCM(m, n, gcd));
System.o... | Main.java:3: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld{
^
1 error
|
s704962918 | p00005 | Java | import java.util.Scanner;
public class HelloWorld{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int m = scanner.nextInt();
int n = scanner.nextInt();
int gcd = getGCD(m, n);
while(m <= 2000000000 && n <= 2000000000){
System.out.print(getLCM(m, n, gcd));
System.out... | Main.java:3: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld{
^
1 error
|
s878421400 | p00005 | Java | public class Lesson1_2 {
public static void main(String args[]){
int x;
int y;
System.out.println("2 number input...");
x = new java.util.Scanner(System.in).nextInt();
y = new java.util.Scanner(System.in).nextInt();
final int OVER = 2000000000;
int end = 0;
int ov = 0;
if(x < y){
ov = y;
}else{
... | Main.java:1: error: class Lesson1_2 is public, should be declared in a file named Lesson1_2.java
public class Lesson1_2 {
^
1 error
|
s727178202 | p00005 | Java | import java.util.NoSuchElementException;
import java.util.Scanner;
public class AOJ_0005 {
private static Scanner sc;
static int getGCD(int a,int b){
if(b>a){
int tmp=a;
a=b;
b=tmp;
}
while(b!=0){
int tmp=b;
b=a%b;
a=tmp;
}
return a;
}
static int getLCM(int a,int b){
return a/getGCD(a... | Main.java:4: error: class AOJ_0005 is public, should be declared in a file named AOJ_0005.java
public class AOJ_0005 {
^
1 error
|
s244559097 | p00005 | Java | import java.util.*;
public class R48p1 {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
long x, y;
while (in.hasNext()) {
x = in.nextLong();
y = in.nextLong();
System.out.println(gcd(x, y) + " " + lcm(x, y));
}
}
static long gcd(long x, long y) {
if ... | Main.java:2: error: class R48p1 is public, should be declared in a file named R48p1.java
public class R48p1 {
^
1 error
|
s214596111 | p00005 | Java | import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main (String [] args){
Scanner input = new Scanner (System.in);
while(input.hasNextInt()){
int a,b;
a=input.nextInt();
b=input.nextInt();
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
static int gcd (int a, in... | Main.java:24: error: reached end of file while parsing
}
^
1 error
|
s830091402 | p00005 | Java | import java.io.*;
class Main {
public static void main (String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
while (str != null) {
String[] strArrays = str.split("\\s", 0);
long a = Long.parseLong(strArrays[0]);
long b... | Main.java:26: error: cannot find symbol
Str = br.readLine();
^
symbol: variable Str
location: class Main
1 error
|
s565900137 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner s = new Scanner(System.in);
int max,min;
int a,b;
String str ;
String[] result;
int counter = 0;
while(true){
str = s.nextLine();
if(str.length... | Main.java:43: error: reached end of file while parsing
}
^
1 error
|
s209947942 | p00005 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class LCMextended {
public static int numint[];
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
... | Main.java:5: error: class LCMextended is public, should be declared in a file named LCMextended.java
public class LCMextended {
^
1 error
|
s532448976 | p00005 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ArrayList<String> ans = new ArrayList<>();
while(sc.hasNext()){
int a = sc.nextInt(),b = sc.nextInt();
ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)))... | Main.java:11: error: cannot find symbol
for(Int i = 0,size = ans.size();i < size;i++){
^
symbol: class Int
location: class Main
1 error
|
s284627640 | p00005 | Java | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static long gcd(long a, long b){
if(a < b){
long tmp = a;
a = b;
b = tmp;
}
while(b > 0){
int r = a % b;
a = b;
b = r;
}
return a;
}
public static long lcm(long a, long b, long g)... | Main.java:13: error: incompatible types: possible lossy conversion from long to int
int r = a % b;
^
1 error
|
s825716219 | p00005 | Java | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
List<Integer> listG = new ArrayList<Integer>();
List<Integer> listL = new ArrayList<Integer>();
while(scan.hasNext()){
int a = scan.nextInt();
int b = scan.nextInt()... | Main.java:27: error: ';' expected
if(b != 0)return gcd(b, a % b)
^
1 error
|
s131466335 | p00005 | Java | class Main
{
public static void main( String[] args )
{
java.util.Scanner sc = new java.util.Scanner( System.in );
int a = sc.nextInt();
int b = sc.nextInt();
System.out.printf( "%d %d\n" , ??¬?´???°??????( a, b ), ??¬?????°??????( a, b ) );
}
static int ??¬?????°??????( int a, int b )
{
int ac = a... | Main.java:10: error: illegal start of expression
System.out.printf( "%d %d\n" , ???????????????( a, b ), ???????????????( a, b ) );
^
Main.java:10: error: illegal start of expression
System.out.printf( "%d %d\n" , ???????????????( a, b ), ???????????????( a, b ) );
... |
s045524307 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNextLine()) {
String inputData = scan.nextLine();
if ("".equals(inputData)) {
scan.close();
brea... | Main.java:3: error: class GCDandLCM is public, should be declared in a file named GCDandLCM.java
public class GCDandLCM {
^
1 error
|
s228709640 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String inputData;
while ((inputData = scan.nextLine()) != null || !"".equals(inputData)) {
String[] inputDataSP = inputData.split(" ");
... | Main.java:3: error: class GCDandLCM is public, should be declared in a file named GCDandLCM.java
public class GCDandLCM {
^
1 error
|
s093317525 | p00005 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] a) throws IOException{
String strLine ="";
BufferedReader stdReader =
new BufferedReader(new InputStreamReader(System.in));
int i = 0;
int max = 50;
Strin... | Main.java:99: error: reached end of file while parsing
}
^
1 error
|
s900777448 | p00005 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] a) throws IOException{
String strLine ="";
BufferedReader stdReader =
new BufferedReader(new InputStreamReader(System.in));
int i = 0;
int max = 50;
int[]... | Main.java:42: error: cannot find symbol
int maxBaisu = maxYakusu * temp1 * temp2;
^
symbol: variable temp1
location: class Main
Main.java:42: error: cannot find symbol
int maxBaisu = maxYakusu * temp1 * temp2;
^
symbol: variable tem... |
s468125015 | p00005 | Java | import java.util.Scanner;
import java.math.BigDecimal;
public class Gcd{
public static long saidai(long a , long b){
long c,s,t;
s = a;
t = b;
while(true){
if(s == t){
c = s;
break;
}else if(s == 0){
c = t;
break;
}else if(t == 0){
c = s;
break;
}else if(s ... | Main.java:4: error: class Gcd is public, should be declared in a file named Gcd.java
public class Gcd{
^
1 error
|
s492523088 | p00005 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamRe... | Main.java:25: error: incompatible types: possible lossy conversion from long to int
int candidate = a;
^
Main.java:27: error: incompatible types: possible lossy conversion from long to int
candidate = b % a;
^
2 errors
|
s440584271 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
//?????°??£?¨?
Scanner sc;
int a; //??\???????????°
int b;
int c=1;
int d; //????????????????????????
int i = 0; //????????????
//int[] haco; //??¨?????¨?????????
//String haco = iter.next();
//int [][] haco... | Main.java:84: error: cannot find symbol
System.out.print(haco[j][0] + " ");
^
symbol: variable haco
location: class Main
Main.java:87: error: cannot find symbol
System.out.println(haco[0][h]);
^
symbol: variable haco
location: class Main
2 errors
|
s765434831 | p00005 | Java | import java.util.Scanner;
public Main{
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
int[] a = new int[50];
int[] b = new int[50];
int[] newA = new int[50];
int[] newB = new int[50];
int[] gcd = new int[50];
int[] lcm = new int[50];
int num = 0;
System.out.print... | Main.java:3: error: class, interface, enum, or record expected
public Main{
^
Main.java:5: 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)
Main.java:76: error: class, interface,... |
s176157239 | p00005 | Java | import java.util.Scanner;
public class Main
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
long a = 0;
long b = 0;
long ab = 0;
long r = 0;
long gcd = 0;
long lcm = 0;
long temp = 0;
while(stdin.hasNext()) {
a = stdin.nextInt();
b = stdin.nextInt();
ab... | Main.java:3: error: '{' expected
public class Main
^
Main.java:4: 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)
Main.java:43: error: class, interface, enum, or recor... |
s186076399 | p00005 | Java | package P2_6_Exer_1;
import java.util.Scanner;
public class A0005 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = "";
while((line=sc.nextLine())!=null&&!(line.trim().equals(""))) {
String[] temp = line.split(" ");
int a = Integer.parseInt(temp[0]);
int b... | Main.java:5: error: class A0005 is public, should be declared in a file named A0005.java
public class A0005 {
^
1 error
|
s768732521 | p00005 | Java | #include<stdio.h>
int main(void){
long int a,b,k,r,ab;
while(scanf("%ld %ld",&a,&b)!=EOF){
if(a<b){//a>b
k=a;
a=b;
b=k;
}
//最小公倍数*最大公約数=a*b
ab=a*b;
while((r=a%b)!=0){
a=b;
b=r;
}
printf("%ld %ld\n",b,ab/b);
}
return 0;
}
| Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:6: error: class, interface, enum, or record expected
while(scanf("%ld %ld",&a,&b)!=EOF){
^
Main.java:9: error: class, interface, enum, or record expecte... |
s108226373 | p00005 | Java | #include<stdio.h>
int main(void){
long int a,b,k,r,ab;
while(scanf("%ld %ld",&a,&b)!=EOF){
if(a<b){
k=a;
a=b;
b=k;
}
ab=a*b;
while((r=a%b)!=0){
a=b;
b=r;
}
printf("%ld %ld\n",b,ab/b);
}
return 0;
}
| Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:6: error: class, interface, enum, or record expected
while(scanf("%ld %ld",&a,&b)!=EOF){
^
Main.java:9: error: class, interface, enum, or record expecte... |
s982689214 | p00005 | Java | import java.io.*;
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
while(true){
String s = r.readLine();
if(s == null) break;
int i = s.indexOf(" ");
System.out.println(gcd(Integer.valueOf(s.substring(0, i))) + " " +... | Main.java:9: error: method gcd in class Main cannot be applied to given types;
System.out.println(gcd(Integer.valueOf(s.substring(0, i))) + " " + lcm(Integer.valueOf(s.substring(i+1))));
^
required: int,int
found: Integer
reason: actual and formal argument lists differ in length
Main.java:9:... |
s355744672 | p00005 | Java | import java.io.*;
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
while(true){
String s = r.readLine();
if(s == null) break;
int i = s.indexOf(" ");
int a = Integer.valueOf(s.substring(0, i));
int b = Integer.valueO... | Main.java:11: error: non-static method gcd(int,int) cannot be referenced from a static context
System.out.println(gcd(a, b) + " " + lcm(a, b));
^
Main.java:11: error: non-static method lcm(int,int) cannot be referenced from a static context
System.out.println(gcd(a, b) + " " + lcm(a, b));
... |
s369016390 | p00005 | Java | public class Main {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
// System.out.println("Hello world");
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
while(true){
int n = 2;
String c = br.readLine();
if... | Main.java:6: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
Main.java:8: error: cannot find symbol
InputStreamReader is = new InputStreamReader(System.in);
^
symbol: clas... |
s232620676 | p00005 | Java | public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a,b;
int gcd = 0;
int lcm = 0;
while ((scan.hasNext())) {
a = Integer.parseInt(scan.next());
b = Integer.parseInt(scan.next());
for (int i = 2; i <= Math.min(a, b); i++) {
//Ååöñ
i... | Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s905685927 | p00005 | Java | public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a, b, goc;
while (in.hasNext()) {
a = in.nextInt();
b = in.nextInt();
System.out.print(goc = goc(a, b));
System.out.print(" ");
System.out.println(a / goc * b);
}
}
static int goc(int a, int ... | 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
|
s162373971 | p00005 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
int gcd,lcm;
BufferedReader br=
new BufferedReader (new InputStreamReader(System.in));
String buf;
while(true){
if((buf=br.readLine())==null)break;
if(buf.length()==0)break;
String[] data=buf.split(" ")... | Main.java:32: error: variable gcd might not have been initialized
System.out.println(lcm+" "+gcd);
^
1 error
|
s949509257 | p00005 | Java | import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
BigDecimal bda = new BigDecimal(sc.nextDouble());
BigDecimal bdb = new BigDecimal(sc.nextDouble());
BigDecimal gcd = bda.gcd(b... | Main.java:9: error: cannot find symbol
BigDecimal gcd = bda.gcd(bdb);
^
symbol: method gcd(BigDecimal)
location: variable bda of type BigDecimal
Main.java:10: error: cannot find symbol
BigDecimal lcm = bda.multyply(bdb).divide(gcd);
^
symbol: met... |
s974195221 | p00005 | Java | import java.util.Scanner;
import java.math.BigInteger;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
BigInteger bda = new BigInteger(sc.nextDouble());
BigInteger bdb = new BigInteger(sc.nextDouble());
BigInteger gcd = bda.gcd(b... | Main.java:7: error: no suitable constructor found for BigInteger(double)
BigInteger bda = new BigInteger(sc.nextDouble());
^
constructor BigInteger.BigInteger(byte[]) is not applicable
(argument mismatch; double cannot be converted to byte[])
constructor BigInteger.BigInteger(... |
s897955204 | p00005 | Java | import java.util.Scanner;
import java.math.BigInteger;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
BigInteger bda = new BigInteger(sc.nextInt());
BigInteger bdb = new BigInteger(sc.nextInt());
BigInteger gcd = bda.gcd(bdb);
... | Main.java:7: error: no suitable constructor found for BigInteger(int)
BigInteger bda = new BigInteger(sc.nextInt());
^
constructor BigInteger.BigInteger(byte[]) is not applicable
(argument mismatch; int cannot be converted to byte[])
constructor BigInteger.BigInteger(int[]) is... |
s720364122 | p00005 | Java | import java.io.*
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%... | Main.java:1: error: ';' expected
import java.io.*
^
1 error
|
s719858260 | p00005 | Java | import java.io.*
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%... | Main.java:1: error: ';' expected
import java.io.*
^
1 error
|
s909478138 | p00005 | Java | import java.io.*
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%... | Main.java:1: error: ';' expected
import java.io.*
^
1 error
|
s336697364 | p00005 | Java | import java.io.*;
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)return a;
return gcd(b,a... | Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:8: error: cannot find symbol
int ... |
s220066951 | p00005 | Java | import java.io.*;
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)return a;
return gcd(b,a... | Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:8: error: cannot find symbol
int ... |
s445677909 | p00005 | Java | import java.io.*;
import java.util.*
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)retur... | Main.java:2: error: ';' expected
import java.util.*
^
1 error
|
s566958017 | p00005 | Java | import java.io.*;
import java.util.*;
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)retu... | Main.java:9: error: cannot find symbol
int a =nextInt();
^
symbol: method nextInt()
location: class Main
Main.java:10: error: cannot find symbol
int b = nextInt();
^
symbol: method nextInt()
location: class Main
2 errors
|
s631976212 | p00005 | Java | import java.io.*;
import java.util;
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int a =nextInt();
int b = nextInt();
System.out.println(gcd(a,b)+" "+a*b/gcd(a,b));
}
}
public static long gcd(int a,int b){
if(b==0)return... | Main.java:2: error: cannot find symbol
import java.util;
^
symbol: class util
location: package java
Main.java:7: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:7: error: cannot find symbol
Scanner scan = new Scanner(System.... |
s764444048 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
long numA = stdIn.nextLong();
long numB = stdIn.nextLong();
long GCD = getGCD(numA,numB);
long GCD = getGCD(numA,numB);
System.out.println(GCD + " " + LCM);
... | Main.java:11: error: variable GCD is already defined in method main(String[])
long GCD = getGCD(numA,numB);
^
Main.java:12: error: cannot find symbol
System.out.println(GCD + " " + LCM);
^
symbol: variable LCM
location: class Main
Main.java:24: error: incompatible t... |
s813485300 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
long numA = stdIn.nextLong();
long numB = stdIn.nextLong();
long GCD = getGCD(numA,numB);
long LCM = getLCM(numA,numB);
System.out.println(GCD + " " + LCM);
... | Main.java:24: error: incompatible types: possible lossy conversion from long to int
int temp= numA;
^
Main.java:31: error: cannot find symbol
if(NumA % bigNum == 0 && NumB % bigNum == 0){
^
symbol: variable NumA
location: class Main
Main.java:31: error: cannot find symbol
if(NumA ... |
s020032782 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
long numA = stdIn.nextLong();
long numB = stdIn.nextLong();
long GCD = getGCD(numA,numB);
long LCM = getLCM(numA,numB);
System.out.println(GCD + " " + LCM);
... | Main.java:24: error: incompatible types: possible lossy conversion from long to int
int temp= numA;
^
Main.java:31: error: cannot find symbol
if(NumA % bigNum == 0 && NumB % bigNum == 0){
^
symbol: variable NumA
location: class Main
Main.java:31: error: cannot find symbol
if(NumA ... |
s648296790 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
long numA = stdIn.nextLong();
long numB = stdIn.nextLong();
long GCD = getGCD(numA,numB);
long LCM = getLCM(numA,numB);
System.out.println(GCD + " " + LCM);
... | Main.java:24: error: incompatible types: possible lossy conversion from long to int
int temp= numA;
^
Main.java:31: error: cannot find symbol
if(NumA % bigNum == 0 && NumB % bigNum == 0){
^
symbol: variable NumA
location: class Main
Main.java:31: error: cannot find symbol
if(NumA ... |
s079678831 | p00005 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
long numA = stdIn.nextLong();
long numB = stdIn.nextLong();
long GCD = getGCD(numA,numB);
long LCM = getLCM(numA,numB);
System.out.println(GCD + " " + LCM);
... | Main.java:24: error: incompatible types: possible lossy conversion from long to int
int temp= numA;
^
Main.java:31: error: cannot find symbol
if(NumA % bigNum == 0 && NumB % bigNum == 0){
^
symbol: variable NumA
location: class Main
Main.java:31: error: cannot find symbol
if(NumA ... |
s566941461 | p00005 | Java | import java.util.Scanner;
 
//GCD and LCM
public class Main{
 
    public static long gcd(long a, long b){
        if(a < b){
            long tmp = a;
      &#... | Main.java:2: error: class, interface, enum, or record expected
 
^
Main.java:2: error: illegal character: '#'
 
^
Main.java:5: error: illegal start of type
 
^
Main.java:5: error: illegal character: '#'
 
^
Main.java:6: error: illegal start of type
    public static long gcd(lo... |
s714282757 | p00005 | Java | public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while(true){
Long m = scan.nextLong();
Long n = scan.nextLong();
Long g = gcd(m, n);
System.out.println(g+" "+(m*n/g));
}
}
private static Long gcd(Long a, Long b){
if(b == 0){
return... | Main.java:4: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s466445498 | p00005 | Java | import java.util.Scanner;
public class Main0005 {
public static void main(String[] args) {
long n, m, k;
Scanner in = new Scanner(System.in);
while (true) {
n = in.nextInt();
m = in.nextInt();
k=Math.max(n, m);
m=Math.min(n, m);
n=k;
System.out.println(gcd(n, m) + " "
+ (n * m) / ... | Main.java:3: error: class Main0005 is public, should be declared in a file named Main0005.java
public class Main0005 {
^
1 error
|
s116694360 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
private GCDandLCM() {
try(Scanner in = new Scanner(System.in)){
long a,b;
while(in.hasNext()){
a = in.nextInt();
b = in.nextInt();
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
}
public final long gcd(long a, long b) {
if(a==b){
re... | Main.java:3: error: class GCDandLCM is public, should be declared in a file named GCDandLCM.java
public class GCDandLCM {
^
1 error
|
s761237155 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
private GCDandLCM() {
Scanner in = new Scanner(System.in)
long a,b;
while(in.hasNext()){
a = in.nextInt();
b = in.nextInt();
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
public final long gcd(long a, long b) {
if(a==b){
return a;
} e... | Main.java:6: error: ';' expected
Scanner in = new Scanner(System.in)
^
1 error
|
s065362860 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
private GCDandLCM() {
Scanner in = new Scanner(System.in);
long a,b;
while(in.hasNext()){
a = in.nextInt();
b = in.nextInt();
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
/**
* 最大公約数の計算
* @param a
* @param b
* @return
*/
publi... | Main.java:3: error: class GCDandLCM is public, should be declared in a file named GCDandLCM.java
public class GCDandLCM {
^
1 error
|
s069268420 | p00005 | Java | import java.util.Scanner;
public class GCDandLCM {
private GCDandLCM() {
Scanner in = new Scanner(System.in);
long a,b;
while(in.hasNext()){
a = in.nextInt();
b = in.nextInt();
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
public long gcd(long a, long b) {
if(a==b){
return a;
} else if(a>... | Main.java:3: error: class GCDandLCM is public, should be declared in a file named GCDandLCM.java
public class GCDandLCM {
^
1 error
|
s225223502 | p00005 | Java | import java.util.Scanner;
public class aoj0005{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while(sc.hasNext())
{
long a = sc.nextLong();
long b = sc.nextLong();
long d = a * b;
long r = 0;
for(;a%b != 0;)
{
r = a % b;
a=b;
b=r;
... | Main.java:3: error: class aoj0005 is public, should be declared in a file named aoj0005.java
public class aoj0005{
^
1 error
|
s098067781 | p00005 | Java | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <queue>
#include <cstring>
#include <cmath>
#define cl(x) memset(x , 0 , sizeof(x))
typedef long long ll;
using namespace std;
const int N = 100010;
int n,m,k;
int w[N];
int t[N];
int pre[N];
void sol() {
scanf("%d%d%d",&n,&m,... | Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cstdio>
^
Main.java:3: error: illegal character: '#'
#include <algorithm>
^
Main.java:4: error: illegal character: '#'
#include <cstdlib>
^
Main.java:5: error: illegal character: '#'
#include <queue>
^
... |
s491065259 | p00005 | Java | 8 6
50000000 30000000 | Main.java:1: error: class, interface, enum, or record expected
8 6
^
1 error
|
s063140433 | p00005 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true){
String str = br.readLine();
if(str == null ... | Main.java:14: error: variable declaration not allowed here
String[] str1Ary = str.split(" ");
^
1 error
|
s774975029 | p00005 | Java | #include <iostream>
using namespace std;
long gcd(long a, long b) {
if(b == 0) return(a);
return(gcd(b, a % b));
}
long lcm(long m, long n) {
if(m == 0 || n == 0) return(0);
return((m * n) / gcd(m, n));
}
int main(void) {
long a, b;
while(scanf("%ld %ld", &a, &b) != EOF) {
cout << gcd... | Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
long gcd(long a, long b) {
^
(use --enable-preview to enable unnamed cla... |
s884433620 | p00005 | Java |
import java.io.IOException;
import java.util.Scanner;
public class GCD_and_LCM {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
long a = scan.nextLong();
long b = scan.nextLong();
long gcd = divide(a, b);
long lcm = a... | Main.java:7: error: class GCD_and_LCM is public, should be declared in a file named GCD_and_LCM.java
public class GCD_and_LCM {
^
1 error
|
s297382588 | p00005 | C | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int gcd(int a ,int b){
if(b==0) return a;
return gcd(b,a%b);
}
int lcm(int a,int b,int c){
return b/c*a;
}
int main(){
int a;
int b;
cin>>a>>b;
cout<<gcd(a,b)<<' '<<lcm(a,b,gcd(a,b));
return 0;
}
| main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s753212058 | p00005 | C | #include<bits/stdc++.h>
using namespace std;
int n,m;
int gcd(int a,int b){
return b?gcd(b,a%b):a;
}
int main()
{
while(cin>>n>>m){
int d=gcd(n,m);
int lcm=n/d*m;
cout<<d<<" "<<lcm<<endl;
}
return 0;
}
| main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s853752843 | p00005 | C | #include<iostream>
#include<cstdio>
using namespace std;
int a,b,temp;
int main()
{
while(cin>>a>>b)
{
temp=0;
if(a>b)
{
for(int i=1;i<=a;i++)
{
if(a%i==0&&b%i==0)
{
temp=i;
}
}
cout<<temp<<" ";
for(int i=a;;i++)
{
if(i%a==0&&i%b==0)
{
cout<<i;
break;
}
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s458972163 | p00005 | C | #include <stdio.h>
using namespace std;
int gcd(long num1,long num2) {
if (num2 == 0) {
return num1;
}return gcd(num2, num1 % num2);
}
int lcm(long num1,long num2) {
return num1 / (double)gcd(num1, num2) * num2;
}
int main() {
long a, b;
while (~scanf("%d %d",&a,&b)) {
if (b > a) {
int tmp = b;
b = a;... | main.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
|
s546361338 | p00005 | C | #include<stdio.h>
int main(void){
int a, b, n;
int i;
int c, d; //最大公約数,最小公倍数
while (scanf("%d %d", &a, &b) != EOF){ //Ctrl+Zが押されるまで繰り返す
if (a < b){ //a>bになるように入れ替える
n = a; a = b; b = n;
}
for (i = a; i>0; i--){ //最大公約数を求める
if (a / i == double(a) / double(i)){
if (b / i == double(b) / double(... | main.c: In function 'main':
main.c:15:38: error: expected expression before 'double'
15 | if (a / i == double(a) / double(i)){
| ^~~~~~
main.c:16:46: error: expected expression before 'double'
16 | if (b / i == doub... |
s845586844 | p00005 | C | #include<stdio.h>
int main(void){
int a, b, n,a1,a2,b1;
int i;
int c, d; //最大公約数,最小公倍数
while (scanf("%d %d", &a, &b) != EOF){ //Ctrl+Zが押されるまで繰り返す
if (a < b){ //a>bになるように入れ替える
n = a; a = b; b = n;
}
for (i = a; i>0; i--){ //最大公約数を求める
a1 = a / i;
a2 = double(a) / double(i);
if (a1==a2){
i... | main.c: In function 'main':
main.c:16:30: error: expected expression before 'double'
16 | a2 = double(a) / double(i);
| ^~~~~~
main.c:18:46: error: expected expression before 'double'
18 | if (b / i == double(b) / double(i)... |
s947389330 | p00005 | C | #include<stdio.h>
int main(void){
int a, b, n, a1, a2, b1;
int i;
int c, d; //最大公約数,最小公倍数
while (scanf("%d %d", &a, &b) != EOF){ //Ctrl+Zが押されるまで繰り返す
if (a < b){ //a>bになるように入れ替える
n = a; a = b; b = n;
}
for (i = a; i>0; i--){ //最大公約数を求める
a1 = a / i;
a2 = double(a) / i;
if (a1 == a2){
if (... | main.c: In function 'main':
main.c:16:30: error: expected expression before 'double'
16 | a2 = double(a) / i;
| ^~~~~~
main.c:18:46: error: expected expression before 'double'
18 | if (b / i == double(b) / double(i)){
... |
s545598428 | p00005 | C | #include<stdio.h>
a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
} | main.c:2:1: warning: data definition has no type or storage class
2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return type defaults to 'int' [-Wimplicit-int]
2 | a;... |
s381737160 | p00005 | C | include<stdio.h>
int main(){
long long a,b,c,d,e,ans2,ans1,i;
while(scanf("%lld %lld",&a,&b)!=EOF){
if(b>a){
c=a;
a=b;
b=c;
}
for(i=a;i<=a*b;i++){
if(i%a==0 && i%b==0){
ans2=i;
break;
}
}
while(1){
c=a%b;
a=b;
b=c;
... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s981804962 | p00005 | C | #include <stdio.h>
#define D(fmt,...) fprintf(stderr, fmt, ##__VA_ARGS__)
#define P(fmt,...) fprintf(stdout, fmt, ##__VA_ARGS__)
int gcd (int a, int b) {
int min = a < b ? a : b;
int gcd = 1;
int i = 0;
for (i = 1; i < min; i++) {
if (a % i == 0 && b % i == 0) {
a /= i; b /= i;
gcd *= i;
}... | main.c: In function 'main':
main.c:32:22: error: unterminated argument list invoking macro "P"
32 | P("%d %d\n", g, l
| ^
main.c:32:5: error: 'P' undeclared (first use in this function)
32 | P("%d %d\n", g, l
| ^
main.c:32:5: note: each undeclared identifier is reporte... |
s807783649 | p00005 | C | #include <stdio.h>
int rest(int x, int y);
int get_gcd(int x, int y);
int main(void)
{
int x, y, gcd, lcm;
while(scanf("%d %d", &x, &y)==2)
{
gcd = get_gcd(x, y);
lcm = x * y gcd;
printf("%d %d", gcd, lcm);
}
return 0;
}
int get_gcd(int x, int y)
{
if(x<y)
{
y = y % x;
}
while(x >= 1 && y >= 1... | main.c: In function 'main':
main.c:13:28: error: expected ';' before 'gcd'
13 | lcm = x * y gcd;
| ^~~~
| ;
|
s133440503 | p00005 | C | #include <stdio.h>
int gcd(int,int);
int lcm(int,int);
int main(){
int a,b;
while(scanf("%d %d",&a,&b) != EOF){
printf("%d %d\n",gcm(a,b),lcm(a,b));
}
return 0;
}
int gcd(int m, int n){
if(m == 0 || n == 0) return 0;
while(n != m){
if (m > n) m -= n;
else n -= m;
}
return n;
}
int lcm(int m, int n){
... | main.c: In function 'main':
main.c:9:34: error: implicit declaration of function 'gcm'; did you mean 'lcm'? [-Wimplicit-function-declaration]
9 | printf("%d %d\n",gcm(a,b),lcm(a,b));
| ^~~
| lcm
|
s257766681 | p00005 | C | int main(){
int a,b,g,l,i;
while (scanf("%d %d",&a,&b) !=EOF) {
g=1;
if (a<b) {i=a; a=b; b=i;}
for (i=1;i<=a;i++) {
if (a%i==0 && b%i==0) {g=i;}
}
for (i=a*b;i>=a;i--) {
if (i%a==0 && i%b==0) {l=i;}
}
printf("%d %d\n",g,l);
}
return 0;
} | main.c: In function 'main':
main.c:3:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | while (scanf("%d %d",&a,&b) !=EOF) {
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:3:8:... |
s390409765 | p00005 | C | #include<stdio.h>
int main(void){
int a,b,i,gcm=1,lcm=1;
while(scanf("%d %d",&a,&b) != EOF){
gcm=1;lcm=1;
for(i=2;(i<=a)||(i<=b);i++){
if(a%i==0&&b%i==0){
gcm*=i;
}
if(a%i==0||b%i==0){
lcm*=i;
}
if(a%i==0){
a=a/i;
}
if(b%i==0){
b=b/i;
}
if(a%i==0||b%i==0){
i=2;
}
}
... | main.c: In function 'main':
main.c:26:1: error: expected declaration or statement at end of input
26 | }
| ^
|
s837318314 | p00005 | C | #include <stdio.h>
#include <math.h>
int main(void){
int a,b,c,d,e;
while(scanf("%d %d",&a,&b) != EOF){
c = a*b;
while(1){
fmax(a,b) = fmax(a,b)%fmin(a,b);
if(fmin(a,b) == 0){
break;
}
}
printf("%d %d",fmax(a,b),c/fmax(a,b));
}
return 0;
} | main.c: In function 'main':
main.c:10:38: error: invalid operands to binary % (have 'double' and 'double')
10 | fmax(a,b) = fmax(a,b)%fmin(a,b);
| ~~~~~~~~~^~~~~~~~~~
| | |
| double double... |
s138495288 | p00005 | C | #include <iostream>
#include<math.h>
using namespace std;
int main()
{
long long int flag,a1,b1,t,k,a,b;
while(cin>>a>>b){
a1=a,b1=b;
if(a<b)
t=a,a=b,b=t;
for(;;){
k=a%b;
if(k==0)
break;
flag=k;
a=b;
b=k;
}
cout<<flag<<" "<<(a1/flag)*b1<<endl;
}
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s758617596 | p00005 | C | #include <stdio.h>
int gcd(int a, int b){
if(a<b){
int temp=a;
a=b;
b=temp;
}
int c;
do{
c=a%b;
a=b;
b=c;
}while(c!=0);
return a;
}
int lcm(int a, int b){
int c, va, vb;
c=gcm(a,b);
va=a/c;
vb=b/c;
return c*va*vb;
}
int main(void){
int a, b;
while(scanf("%d %d", &a, &b)!=-1){
printf("%d %d", gcd(a,b), lcm(... | main.c: In function 'lcm':
main.c:26:3: error: implicit declaration of function 'gcm'; did you mean 'lcm'? [-Wimplicit-function-declaration]
26 | c=gcm(a,b);
| ^~~
| lcm
|
s114333551 | p00005 | C | #include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
int gcd(int a, b) {
if(a == 0 || b == 0) return 0;
while(a != b) {
if(a > b) a -= b;
else b -= a;
}
return a;
}
int lcm(int a, int b) {
if(a == 0 || b == 0) return 0;
return (a / gcd(a, b)) * b;
}
int main() {
... | main.c:7:16: error: unknown type name 'b'
7 | int gcd(int a, b) {
| ^
main.c: In function 'lcm':
main.c:18:21: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
18 | return (a / gcd(a, b)) * b;
| ^~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.