submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s621428753 | p00005 | C | #include<stdio.h>
int main(void)
{
long long a, b, sum, temp;
while(scanf("%lld %lld",&a,&b)
{
if(a < b){
temp = a;
a = b;
b = temp;
}
sum = a * b;
while(b != 0)
{
a %= b;
temp = a;
a = b;
b = temp;
}
printf("%lld %lld\n",a,sum/a);
}
return 0;
} | main.c: In function 'main':
main.c:6:39: error: expected ')' before '{' token
6 | while(scanf("%lld %lld",&a,&b)
| ~ ^
| )
7 | {
| ~
main.c:24:1: error: expected expr... |
s521280412 | p00005 | C | #include<stdio.h>
int max(int,int);
int min(int,int);
int main(){
int n,m;
while(scanf("%d %d",&n,&m)!=EOF){
printf("%d %d\n",max(n,m),min(n,m));
}
return 0;
}
int max(int n,int m){
int tmp,i,j,num=0;
if(n>m){
tmp=n;
n=m;
m=tmp;
}
for(i=2;i<n;i++){
if(n%i==0&&m%i==0){
num=i;
... | main.c: In function 'min':
main.c:40:3: error: expected declaration or statement at end of input
40 | return num;
| ^~~~~~
|
s008053849 | p00005 | C | #include <stdio.h>
int gcd(int n1, int n2)
{
int n3;
while (n1 != 0){
n3 = n2;
n2 = n1;
n1 = n3 % n2;
}
return n2;
}
int main(void)
{
int a[1000], b[1000];
int i;
i = 0;
while (scanf("%d%d", &a[i], &b[i]) != EOF){
i++;
}
for (j = 0; j < i; j++){
printf("%d %d\n", gcd(a[j], ... | main.c: In function 'main':
main.c:26:8: error: 'j' undeclared (first use in this function)
26 | for (j = 0; j < i; j++){
| ^
main.c:26:8: note: each undeclared identifier is reported only once for each function it appears in
|
s829297676 | p00005 | C | #include <stdio.h>
unsigned int gcd(unsigned int n1, unsigned int n2)
{
  unsigned int n3;
  while (n1 != 0){
    n3 = n2;
    n2 = n1;
    n1 = n3 % n2;
  }
  return n2;
}
int main(void)
{
  unsigned int a, b;
  unsigned int i, j;
  i... | main.c: In function 'gcd':
main.c:8:2: error: stray '#' in program
8 |   unsigned int n3;
| ^
main.c:8:1: error: lvalue required as unary '&' operand
8 |   unsigned int n3;
| ^
main.c:13:2: error: stray '#' in program
13 |   while (n1 != 0){
| ^
main.c:13:1: error: lvalue r... |
s384934415 | p00005 | C | #include<stdio.h>
int gcd(long long, long long);
int gcd(long long a, long long b) {
if(b == 0) {
return a;
} else {
return gcd(b, a % b);
};
}
int main(0 {
long long a, b, temp, gcdr, lcmr;
scanf("%lld %lld", &a, &b);
if(a < b) {
temp = b;
b = a;
a = temp;
};
gcdr = gcd(a , b);
... | main.c:12:10: error: expected declaration specifiers or '...' before numeric constant
12 | int main(0 {
| ^
|
s864502999 | p00005 | C | #include <stdio.h>
#include <math.h>
int GCD(int x, int y){
int temp;
if(x <= y){
temp = x;
x = y;
y = temp;
}
if(y == 0) return x;
else{
temp = y;
y = x % y;
x = temp;
return GCD(x, y);
}
}
int LCM(int x, int y, int gcd){
return... | main.c: In function 'main':
main.c:33:5: error: expected declaration or statement at end of input
33 | return 0;
| ^~~~~~
|
s448464922 | p00005 | C | #include <iostream>
using namespace std;
int GCD(int a, int b)
{
int temp;
while(temp!=0)
{
temp=a%b;
a=b;
b=temp;
}
return a;
}
int main()
{
int a,b,lcm,gcd;
while(1)
{
cin>>a>>b
gcd=GCD(a,b);
lcm=a*b/gcd;
cout<<gcd<<" "<<lcm<<"\n";
}
return 0;... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s087328570 | p00005 | C | #include<stdio.h>
int main()
{
long m,n,t,h;
while(scanf("%d%d",&m,&n)!=EOF)
{
t=gcd(m,n);
h=m*(n/t);
printf("%d %d\n",t,h);
}
return 0;
}
long gcd(int a,int b)
{
long g;
if(!b)g=a;
else g=gcd(b,a%b);
return g;
} | main.c: In function 'main':
main.c:7:19: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
7 | t=gcd(m,n);
| ^~~
main.c: At top level:
main.c:13:6: error: conflicting types for 'gcd'; have 'long int(int, int)'
13 | long gcd(int a,int b)
... |
s320673114 | p00005 | C | #include <stdio.h>
int cmp_max(int a, int b){
if(a < b){
return (b);
}else{
return (a);
}
}
int cmp_min(int a, int b){
if(a < b){
return (a);
}else{
return (b);
}
}
int main(){
long long int a, b,t;
long long int result1, result2;
long long int min, max;
while(scanf("%lld %lld", &a... | main.c: In function 'main':
main.c:27:14: error: expected ';' before 'min'
27 | t = min
| ^
| ;
28 | min = max % min;
| ~~~
|
s465310124 | p00005 | C | #include<stdio.h>
int create_gcd(int,int);
int main(){
int a,b,ab,gcd,lcm;
while(scanf("%11d %11d",&a,&b) != EOF){
ab=a*b;
gcd=create_gcd(a,b);
lcm=ab/gcd;
printf("%11d %11d\n",gcd,lcm);
}
return 0;
}
}
int create_gcd(int a, int b){
int tmp;
int gcd=0;
if(a<=b){
while(1){
... | main.c:17:1: error: expected identifier or '(' before '}' token
17 | }
| ^
|
s755599372 | p00005 | C | #include<stdio.h>
int create_gcd(int,int);
int main(){
int a,b,ab,gcd,lcm;
while(scanf("%11d %11d",&a,&b) != EOF){
ab=a*b;
gcd=create_gcd(a,b);
lcm=ab/gcd;
printf("%11d %11d\n",gcd,lcm);
}
return 0;
}
int create_gcd(int a, int b){
int tmp;
if(a<b){
tmp=a;
a=b;
b=tmp;
}
... | main.c: In function 'create_gcd':
main.c:27:15: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
27 | else return gcd(b,a%b);
| ^~~
|
s381780303 | p00005 | C | #include<stdio.h>
int create_gcd(int,int);
int main(){
int a,b;
while(scanf("%d %d",&a,&b) != EOF){
printf("%d %d\n",create_gcd(a,b),a/gcd(a,b)*b);
}
return 0;
}
int create_gcd(int a, int b){
int tmp;
if(a<b){
tmp=a;
a=b;
b=tmp;
}
if(b==0) return a;
else return create_gcd(b,a%b)... | main.c: In function 'main':
main.c:9:40: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
9 | printf("%d %d\n",create_gcd(a,b),a/gcd(a,b)*b);
| ^~~
|
s234978241 | p00005 | C | #include <stdio.h>
int gcd(int a,int b)
{
int t;
if(a<b){
t=a;a=b;b=t;
}
while(b!=0){
r=a%b;
a=b;
b=r;
}
return a;
}
int lcm(int a,int b)
{
int i,t;
if(a<b){
t=a;a=b;b=t;
}
for(i=1;;i++){
if((a*i)%b==0){
return a*i;
}
}
}
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)... | main.c: In function 'gcd':
main.c:11:25: error: 'r' undeclared (first use in this function)
11 | r=a%b;
| ^
main.c:11:25: note: each undeclared identifier is reported only once for each function it appears in
|
s191619823 | p00005 | C | #include<stdio.h>
#include<math.h>
int main(){
unsigned long long int a, b, c, d;
unsigned long long int i, j;
if(a > b){
d = a;
a = b;
b = d;
}
while(scanf("%lld %lld", &a, &b) != EOF){
for(i = a; i < 200000000; i += a){
if(i < b) continue;
if(i % b == 0){
d = i;
break;
}
}
for(i = a... | main.c: In function 'main':
main.c:21:48: error: lvalue required as left operand of assignment
21 | if(a % i != 0 || b % i |= 0) continue;
| ^~
|
s294905619 | p00005 | C | #include<stdio.h>
#include<math.h>
int main(){
unsigned long long int a, b, c, d;
unsigned long long int i, j;
if(a > b){
d = a;
a = b;
b = d;
}
while(scanf("%lld %lld", &a, &b) != EOF){
for(i = a; i < 200000000; i += a){
if(i < b) continue;
if(i % b == 0){
d = i;
break;
}
}
for(i = a... | main.c: In function 'main':
main.c:21:48: error: lvalue required as left operand of assignment
21 | if(a % i != 0 || b % i |= 0){
| ^~
|
s451128338 | p00005 | C | #include <stdio.h>
/* 二つの整数x,yの最大公約数を求める関数(x>=y) */
unsigned long gcdf(unsinged long vx,unsinged long vy)
{
return (!vy) ? vy : gcdf(vy,vx%vy);
}
/* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */
unsigned long gcd(unsigned long vx,unsigned long vy)
{
return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
}
int main()
{
unsig... | main.c:3:20: error: unknown type name 'unsinged'; did you mean 'unsigned'?
3 | unsigned long gcdf(unsinged long vx,unsinged long vy)
| ^~~~~~~~
| unsigned
main.c:3:37: error: unknown type name 'unsinged'; did you mean 'unsigned'?
3 | unsigned long gcdf(unsinged ... |
s268645985 | p00005 | C | #include <stdio.h>
/* 二つの整数x,yの最大公約数を求める関数(x>=y) */
int gcdf(int vx,int vy)
{
return (!vy) ? vx : gcdf(vy,vx%vy);
}
/* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */
int gcd(int vx,int vy)
{
return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
}
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d %d\n",g... | main.c: In function 'main':
main.c:18:45: error: expected ')' before ';' token
18 | printf("%d %d\n",gcd(a,b),(a*b)/(gcd(a,b));
| ~ ^
| )
main.c:18:46: error: expected ';' before '}' token
18 | printf("%d %d\n",g... |
s383598174 | p00005 | C | #include <stdio.h>
/* 二つの整数x,yの最大公約数を求める関数(x>=y) */
int gcdf(int vx,int vy)
{
return (!vy) ? vx : gcdf(vy,vx%vy);
}
/* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */
int gcd(int vx,int vy)
{
return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
}
int main()
{
while(scanf("%d %d",&a,&b)!=EOF)
int a=0,b=0;
printf("%d %d\n... | main.c: In function 'main':
main.c:16:24: error: 'a' undeclared (first use in this function)
16 | while(scanf("%d %d",&a,&b)!=EOF)
| ^
main.c:16:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:27: error: 'b' undeclared (first use in ... |
s721952144 | p00005 | C | #include <stdio.h>
/* 二つの整数x,yの最大公約数を求める関数(x>=y)
int gcdf(int vx,int vy)
{
return (!vy) ? vy : gcdf(vy,vx%vy);
}
/* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */
int gcd(int vx,int vy)
{
return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
}
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
{
printf("%d %d\n",gc... | main.c: In function 'gcd':
main.c:11:19: error: implicit declaration of function 'gcdf'; did you mean 'gcd'? [-Wimplicit-function-declaration]
11 | return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
| ^~~~
| gcd
|
s387305692 | p00005 | C | #include<stdio.h>
/* 二つの整数x,yの最大公約数を求める関数(x>=y)
int gcdf(int vx,int vy)
{
return (!vy) ? vx : gcdf(vy,vx%vy);
}
/* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */
int gcd(int vx,int vy)
{
return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
}
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d %d",gc... | main.c: In function 'gcd':
main.c:11:19: error: implicit declaration of function 'gcdf'; did you mean 'gcd'? [-Wimplicit-function-declaration]
11 | return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx);
| ^~~~
| gcd
|
s801897045 | p00005 | C | #include<stdio.h>
int main(void){
int a,b,i;
for(scanf("%d%d",&a,&b)!=EOF){
if(a<b){
i=a;
a=b;
b=i;
}
i=b;
while((a%i)!=0 || (b%i)!=0 || i!=1;){
i--;
}
printf("%d %d\n",i,(a/i)*b);
}
return 0;
} | main.c: In function 'main':
main.c:4:33: error: expected ';' before ')' token
4 | for(scanf("%d%d",&a,&b)!=EOF){
| ^
main.c:4:33: error: expected expression before ')' token
main.c:11:43: error: expected ')' before ';' token
11 | while((a%i)!=0 || (b%i)!=0 || i!=... |
s113528564 | p00005 | C | #include<stdio.h>
int main(void){
int a,b,i;
for(scanf("%d%d",&a,&b)!=EOF){
if(a<b){
i=a;
a=b;
b=i;
}
i=b;
while((a%i)!=0 || (b%i)!=0 || i!=1){
i--;
}
printf("%d %d\n",i,(a/i)*b);
}
return 0;
} | main.c: In function 'main':
main.c:4:33: error: expected ';' before ')' token
4 | for(scanf("%d%d",&a,&b)!=EOF){
| ^
main.c:4:33: error: expected expression before ')' token
|
s708629698 | p00005 | C | #include <stdio.h>
int main(){
int a,b;
int x,y,i,j;
while(scanf("%d %d",&a,&b) != EOF){
if(a>=b){
for(i=2;i<=b,i++){
if(a%i==0 && b%i==0){
x=i;
}
}
}
else if(b>a){
for(i=2;i<=a,i++){
if(a%i==0 && b%i==0){
x=i;
}
}
}
if(a>=b){
for(i=1;i<11;i++){
for(j=1;j<11;j++){
if(a*i==b*j){
y=a*i;
break;
}
}
if(a*i==b*j)break;
}
... | main.c: In function 'main':
main.c:9:17: error: expected ';' before ')' token
9 | for(i=2;i<=b,i++){
| ^
| ;
main.c:16:17: error: expected ';' before ')' token
16 | for(i=2;i<=a,i++){
| ^
| ;
|
s744653687 | p00005 | C | include <stdio.h>
int main(void){
int n = 0, m = 0, r = 0, c = 0;
while (scanf("%d %d",&m,&n) != EOF){
c = n * m;
if(n > m){
r = n;
n = m;
m = r;
}
while (n > 0){
r = n;
n = m % n;
m = r;
}
printf("%d %d\n",m,(c / m));
}
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s846636759 | p00005 | C | #include <stdio.h>
int main (void) {
unsigned __int64 a , b , c, tmp, r;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
b = a % b;
a = c;
}
printf("%d %d\n",a,(r / a));... | main.c: In function 'main':
main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
4 | unsigned __int64 a , b , c, tmp, r;
| ^
main.c:4:26: error: 'a' undeclared (first use in this function)
main.c:4:26: note: each undeclared identifier is reported onl... |
s947676441 | p00005 | C | #include <stdio.h>
int main (void) {
unsigned __int64 a , b , c, tmp, r;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
b = a % b;
a = c;
}
printf("%d %d\n",a,(r / a));... | main.c: In function 'main':
main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
4 | unsigned __int64 a , b , c, tmp, r;
| ^
main.c:4:26: error: 'a' undeclared (first use in this function)
main.c:4:26: note: each undeclared identifier is reported onl... |
s542982382 | p00005 | C | #include <stdio.h>
int main (void) {
unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
b = a % b;
a = c;
}
printf("%d... | main.c: In function 'main':
main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
4 | unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0;
| ^
main.c:4:26: error: 'a' undeclared (first use in this function)
main.c:4:26: note: each undeclared identifi... |
s613422948 | p00005 | C | #include <stdio.h>
int main (void) {
unsigned __int64 a;
unsigned __int64 b;
unsigned __int64 c;
unsigned __int64 tmp;
unsigned __int64 r;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
b = a ... | main.c: In function 'main':
main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
4 | unsigned __int64 a;
| ^
main.c:4:26: error: 'a' undeclared (first use in this function)
main.c:4:26: note: each undeclared identifier is reported only once for each ... |
s175155870 | p00005 | C | #include <stdio.h>
int main (void) {
unsigned __int64 a = 0;
unsigned __int64 b = 0;
unsigned __int64 c = 0;
unsigned __int64 tmp = 0;
unsigned __int64 r = 0;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c... | main.c: In function 'main':
main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
4 | unsigned __int64 a = 0;
| ^
main.c:4:26: error: 'a' undeclared (first use in this function)
main.c:4:26: note: each undeclared identifier is reported only once for e... |
s811714792 | p00005 | C | #include <stdio.h>
unsigned __int64 a = 0;
unsigned __int64 b = 0;
unsigned __int64 c = 0;
unsigned __int64 tmp = 0;
unsigned __int64 r = 0;
int main (void) {
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
... | main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
3 | unsigned __int64 a = 0;
| ^
main.c:4:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'b'
4 | unsigned __int64 b = 0;
| ^
main.c:5:18: error: expected '=', ',', ';'... |
s688613026 | p00005 | C | #include <stdio.h>
int main (void) {
__int64 a = 0;
__int64 b = 0;
__int64 c = 0;
__int64 tmp = 0;
__int64 r = 0;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
b = a % b;
a = c;
} ... | main.c: In function 'main':
main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'?
4 | __int64 a = 0;
| ^~~~~~~
| __int64_t
main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'?
5 | __int64 b = 0;
| ^~~~~~~
| ... |
s770389550 | p00005 | C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string>
#define elif else if
#define ll long long
#define pr printf
#define sc scanf
int gcd(ll int m,ll int n)
{
return m%n==0? n:gcd(n,m%n);
}
int main()
{
ll int a,b,g,l,m;
while (scanf("%lld %lld",&a,&b)!=EOF)
{
g=gcd(a,b);
l=a*b/g;
printf(... | main.c:4:9: fatal error: string: No such file or directory
4 | #include<string>
| ^~~~~~~~
compilation terminated.
|
s446887231 | p00005 | C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <string>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <algorithm>
#include <memory.h>
#include <functional>
#include <numeric>
#in... | main.c:5:10: fatal error: stack: No such file or directory
5 | #include <stack>
| ^~~~~~~
compilation terminated.
|
s403843157 | p00005 | C | //GCD and LCM
#include<stdio.h>
__int64 GCD(__int64 m,__int64 n)
{
__int64 a=m,b=n,c;
while(1)
{
c=a%b;
if(c==0)
{
return b;
}
else if(c!=0)
{
a=b;
b=c;
}
}
}
__int64 LCM(__int64 m,__int64 n)
{
return m*n/GCD(m,n);
}
int main()
{
__int64 a,b;
while(scanf("%I64d %I64d",&a,&b)!=EOF)
{
pri... | main.c:3:1: error: unknown type name '__int64'; did you mean '__int64_t'?
3 | __int64 GCD(__int64 m,__int64 n)
| ^~~~~~~
| __int64_t
main.c:3:13: error: unknown type name '__int64'; did you mean '__int64_t'?
3 | __int64 GCD(__int64 m,__int64 n)
| ^~~~~~~
| __int64... |
s773155705 | p00005 | C | #include <stdio.h>
#define FOR(variable,a,b) for(variable=(a);variable<(b);variable++)
int gcd(int m, int n) {
if((0 == m) || (0 == n)) {
return 0;
}
// method by Euclid
while(m != n) {
if(m > n) {
m = m - n;
} else {
n = n - m;
}
}
return m;
}
int lcm(int m, int n) {
... | main.c: In function 'main':
main.c:34:30: error: expected expression before '%' token
34 | while(scanf("%d %d", &a, %b) != EOF) {
| ^
main.c:35:27: error: called object 'gcd' is not a function or function pointer
35 | printf("%d %d\n", gcd(a, b), lcm(a,b));
| ... |
s236110486 | p00005 | C | #include <stdio.h>
int yakusuu(int a,int b);
int main(void){
int a,b,c;
scanf("%d %d",&a,&b);
c=yakusuu(a,b);
printf("%d %d\n",c,(a/c)*(b/c)*c);
retur 0;
}
int yakusuu(int a,int b){
int n=2,c=1;
while(n<a && n<b){
if(a%n==0 && b%n==0){
a/=n;
b/=n;
m*=n;
}
}
return c;
} | main.c: In function 'main':
main.c:10:1: error: 'retur' undeclared (first use in this function)
10 | retur 0;
| ^~~~~
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:6: error: expected ';' before numeric constant
10 | retur 0;
| ^~
... |
s652425063 | p00005 | C | #include <stdio.h>
int yakusuu(int a,int b);
int main(void){
int a,b,c;
scanf("%d %d",&a,&b);
c=yakusuu(a,b);
printf("%d %d\n",c,(a/c)*(b/c)*c);
return 0;
}
int yakusuu(int a,int b){
int n=2,c=1;
while(n<a && n<b){
if(a%n==0 && b%n==0){
a/=n;
b/=n;
m*=n;
}
}
return c;
} | main.c: In function 'yakusuu':
main.c:19:1: error: 'm' undeclared (first use in this function)
19 | m*=n;
| ^
main.c:19:1: note: each undeclared identifier is reported only once for each function it appears in
|
s443989545 | p00005 | C | #include <stdio.h>
int yakusuu(int a,int b);
unsigned int main(void){
unsigned int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d %d\n",yakusuu(a,b),(a*b/yakusuu(a,b)));
}
return 0;
}
unsigned int yakusuu(int a,int b){
unsigned int n=2,c=1;
while(n<=a && n<=b){
if(a%n==0 && b%n==0){
a/=n;
b/=n;
... | main.c:13:14: error: conflicting types for 'yakusuu'; have 'unsigned int(int, int)'
13 | unsigned int yakusuu(int a,int b){
| ^~~~~~~
main.c:3:5: note: previous declaration of 'yakusuu' with type 'int(int, int)'
3 | int yakusuu(int a,int b);
| ^~~~~~~
|
s569615158 | p00005 | C | #include<stdio.h>
long KYK(long);
long KBI(long);
long KYK(long num[2])
{
long i;
for(i = num[1] ; i >= 1 ; i--)
{
if(0 == num[0] % i && 0 == num[1] % i)
{
return i;
}
}
}
long KBI(long num[2])
{
long i = 1;
while(1)
{
if(0 ==( num[0] * i ) % num[1])
{
return i;
}
i++;
}
}
int m... | main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)'
6 | long KYK(long num[2])
| ^~~
main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)'
3 | long KYK(long);
| ^~~
main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)'
... |
s670568058 | p00005 | C | #include<stdio.h>
long KYK(long);
long KBI(long);
long KYK(long num[2])
{
long i;
for(i = num[1] ; i >= 1 ; i--)
{
if(0 == num[0] % i && 0 == num[1] % i)
{
return i;
}
}
}
long KBI(long num[2])
{
long i = 1;
while(1)
{
if(0 ==( num[0] * i ) % num[1])
{
return i;
}
i++;
}
}
int m... | main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)'
6 | long KYK(long num[2])
| ^~~
main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)'
3 | long KYK(long);
| ^~~
main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)'
... |
s432776566 | p00005 | C | #include<stdio.h>
long KYK(long);
long KBI(long);
long KYK(long num[2])
{
long i;
for(i = num[1] ; i >= 1 ; i--)
{
if(0 == num[0] % i && 0 == num[1] % i)
{
return i;
}
}
}
long KBI(long num[2])
{
long i = 1;
while(1)
{
if(0 ==( num[0] * i ) % num[1])
{
return i;
}
i++;
}
}
int m... | main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)'
6 | long KYK(long num[2])
| ^~~
main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)'
3 | long KYK(long);
| ^~~
main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)'
... |
s163637331 | p00005 | C | #include<stdio.h>
long KYK(long);
long KBI(long);
long KYK(long num[2])
{
long i;
for(i = num[1] ; i >= 1 ; i--)
{
if(0 == num[0] % i && 0 == num[1] % i)
{
return i;
}
}
}
long KBI(long num[2])
{
long i = 1;
while(1)
{
if(0 ==( num[0] * i ) % num[1])
{
return i;
}
i++;
}
}
int m... | main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)'
6 | long KYK(long num[2])
| ^~~
main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)'
3 | long KYK(long);
| ^~~
main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)'
... |
s440499092 | p00005 | C | #include<stdio.h>
long kyk(long);
long kbi(long);
long kyk(long num[2])
{
long i;
for(i = num[1] ; i >= 1 ; i--)
{
if(0 == num[0] % i && 0 == num[1] % i)
{
return i;
}
}
}
long kbi(long num[2])
{
long i = 1;
while(1)
{
if(0 ==( num[0] * i ) % num[1])
{
return i;
}
i++;
}
}
int m... | main.c:6:6: error: conflicting types for 'kyk'; have 'long int(long int *)'
6 | long kyk(long num[2])
| ^~~
main.c:3:6: note: previous declaration of 'kyk' with type 'long int(long int)'
3 | long kyk(long);
| ^~~
main.c:19:6: error: conflicting types for 'kbi'; have 'long int(long int *)'
... |
s144386907 | p00005 | C | #include<stdio.h>
long kyk(long num[2]);
long kbi(long num[2]);
long kbi(long num[2])
{
long i = 1;
while(1)
{
if(0 == % num[1])
{
return (num[0] * i);
}
i++;
}
}
long kyk(long num[2])
{
long yak[4];
yak[0] = num[0];
yak[1] = num[1];
while(1)
{
yak[2] = yak[0] % yak[1];
if(0 == ... | main.c: In function 'kbi':
main.c:12:26: error: expected expression before '%' token
12 | if(0 == % num[1])
| ^
|
s239101187 | p00005 | C | #include <stdio.h>
int gcd(x, y){
if (y == 0) return x;
return gcd(y, x % y);
}
int main(){
int i, j, n, m;
while(scanf("%d %d", &n, &m) != EOF)){
g = gcd(n, m);
printf("%d %d\n", g, n * m / g);
}
return 0;
} | main.c: In function 'gcd':
main.c:3:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
3 | int gcd(x, y){
| ^~~
main.c:3:5: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c: In function 'main':
main.c:10:45: error: expected statement before ')' token
10 | while(scanf("%d %d", ... |
s722119257 | p00005 | C | #include <stdio.h>
int gcd(x, y){
return y > 0 ? gcd(y, x % y) : x;
}
int main(){
int n, m, g;
while(scanf("%d %d", &n, &m) != EOF){
g = gcd(n, m);
printf("%d %d\n", g, x / g * y);
}
return 0;
} | main.c: In function 'gcd':
main.c:3:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
3 | int gcd(x, y){
| ^~~
main.c:3:5: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c: In function 'main':
main.c:11:38: error: 'x' undeclared (first use in this function)
11 | print... |
s078726277 | p00005 | C | #include<stdio.h>
int main(){
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
if(a<b){
temp=a;
a=b;
b=temp;
}
a0=a;
b0=b;
while(a%b!=0){
temp=a0%b0;
a0=b0;
b0=temp;
}
printf("%d %d",b0,a*b/b0);
}
return 0;
} | main.c: In function 'main':
main.c:8:25: error: 'temp' undeclared (first use in this function)
8 | temp=a;
| ^~~~
main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:17: error: 'a0' undeclared (first use ... |
s825943230 | p00005 | C | # include <stdio.h>
_int64 gcd(_int64 a,_int64 b)
{
_int64 n,temp;
if (a<b)
{
temp=a;
a=b;
b=temp;
}
n=a%b;
while (n!=0)
{
a=b;
b=n;
n=a%b;
}
return b;
}
int main(void)
{
_int64 a,b;
while (scanf("%I64d %I64d",&a,&b)!=EOF)
{
printf("%I64d %I64d\n",gcd(a,b),(a*b)/gcd(a,b));
}
return 0;
} | main.c:2:1: error: unknown type name '_int64'; did you mean '__int64_t'?
2 | _int64 gcd(_int64 a,_int64 b)
| ^~~~~~
| __int64_t
main.c:2:12: error: unknown type name '_int64'; did you mean '__int64_t'?
2 | _int64 gcd(_int64 a,_int64 b)
| ^~~~~~
| __int64_t
main.c:2:... |
s864181723 | p00005 | C | # include <stdio.h>
int main()
{
int n1, n2, prod, gcd, lcm ;
while(scanf("%d%d",&a,&b)!=EOF)
{
prod = n1 * n2 ;
while(n1 != n2)
{
if(n1 > n2)
n1 = n1 - n2 ;
if(n2 > n1)
n2 = n2 - n1 ;
}
gcd = n1 ;
lcm = p... | main.c: In function 'main':
main.c:6:26: error: 'a' undeclared (first use in this function)
6 | while(scanf("%d%d",&a,&b)!=EOF)
| ^
main.c:6:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:29: error: 'b' undeclared (first use in... |
s132372235 | p00005 | C | /*
--GCD and LCM--
*/
#include <stdio.h>
int main(void)
{
int a;
int b;
int i;
int j;
int k;
scanf ("%d %d", &a, &b);
for (i = 2; i <= 2000000000; i++) {
if (a % i = 0 && b % i = 0) {
maxc = i;
break;
}
}
for (j = 1; j < 2000000000; j++) {
... | main.c: In function 'main':
main.c:17:32: error: lvalue required as left operand of assignment
17 | if (a % i = 0 && b % i = 0) {
| ^
main.c:18:13: error: 'maxc' undeclared (first use in this function)
18 | maxc = i;
| ^~~~
main.c:18:13: n... |
s505367030 | p00005 | C | //
//GCD and LCM--
//
#include <stdio.h>
int main(void)
{
int a;
int b;
int i;
int j;
int k;
scanf ("%d %d", &a, &b);
for (i = 2; i <= 2000000000; i++) {
if (a % i = 0 && b % i = 0) {
maxc = i;
break;
}
}
for (j = 1; j < 2000000000; j++) {... | main.c: In function 'main':
main.c:18:32: error: lvalue required as left operand of assignment
18 | if (a % i = 0 && b % i = 0) {
| ^
main.c:19:13: error: 'maxc' undeclared (first use in this function)
19 | maxc = i;
| ^~~~
main.c:19:13: n... |
s955203748 | p00005 | C++ | #include <iostream>
using namespace std;
using namespace std;
int gcd(int a, int b)
{
}
int main(void){
int a,b;
while (cin >> a >> b)
{
int lcm =
cout << gcd(a,b) <" " << lcm << endl;
}
return 0;
}
| a.cc: In function 'int gcd(int, int)':
a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type]
8 | }
| ^
a.cc: In function 'int main()':
a.cc:17:28: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
17 | cout << gcd(a,b) <" " << lcm << end... |
s041046414 | p00005 | C++ | #include <stdio.h>
using namespace std;
int gcd(int num1,int num2) {
if (num2 == 0) {
return num1;
}return gcd(num2, num1 % num2);
}
int lcm(int num1,int num2) {
return num1 / gcd(num1, num2) * num2;
}
int main() {
long a, b;
while (scanf_s("%d %d",&a,&b)!=EOF) {
printf("%d %d\n", gcd(a, b),lcm(a,b));
}
}
| a.cc: In function 'int main()':
a.cc:16:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
16 | while (scanf_s("%d %d",&a,&b)!=EOF) {
| ^~~~~~~
| scanf
|
s593870000 | p00005 | C++ | #include <stdio.h>
using namespace std;
int gcd(unsigned long num1,unsigned long num2) {
if (num2 == 0) {
return num1;
}return gcd(num2, num1 % num2);
}
int lcm(unsigned long n1, unsigned long n2) {
return n1 * n2 / gcd(n1, n2);
}
int main() {
unsigned long a, b;
while (~scanf_s("%d %d",&a,&b)) {
printf("%d... | a.cc: In function 'int main()':
a.cc:16:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
16 | while (~scanf_s("%d %d",&a,&b)) {
| ^~~~~~~
| scanf
|
s667729099 | p00005 | C++ | using namespace std;
// GCD
template<class T> inline T gcd(T a, T b) {
return (a == b) ? a : gcd(b % a, a);
}
// LCM
template<class T> inline T lcm(T a, T b) {
return (a / gcd(a, b)) * b;
}
int main() {
long long a, b;
while (cin >> a >> b) {
cout << gcd(a, b) << " " << lcm(a, b) << endl;
... | a.cc: In function 'int main()':
a.cc:15:12: error: 'cin' was not declared in this scope
15 | while (cin >> a >> b) {
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace st... |
s354735118 | p00005 | C++ | #include <iostream>
using namespace std;
int GCD(int a, int b)
{
if(a%b == 0)
return b;
GCD(b, a%b);
} | a.cc: In function 'int GCD(int, int)':
a.cc:9:5: warning: control reaches end of non-void function [-Wreturn-type]
9 | GCD(b, a%b);
| ~~~^~~~~~~~
/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... |
s573214201 | p00005 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
long long int a, b;
long long int gcd()
{
long long int min = a,other=b;
if (b < a){
min = b; other = a;
}
int i;
for (i = 1; i <= sqrt(long double(min)); i++)
{
if (min%i == 0)
{
if (other % (min / i) == 0)
return min / i;
... | a.cc: In function 'long long int gcd()':
a.cc:13:31: error: expected primary-expression before 'long'
13 | for (i = 1; i <= sqrt(long double(min)); i++)
| ^~~~
a.cc:22:23: error: expected primary-expression before 'long'
22 | for (i = sqrt(long double(min)); i >... |
s688400263 | p00005 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
long long int a, b;
long long int gcd()
{
long long int min = a,other=b;
if (b < a){
min = b; other = a;
}
long long int i;
for (i = 1; i <= sqrt(long double(min)); i++)
{
if (min%i == 0)
{
if (other % (min / i) == 0)
return ... | a.cc: In function 'long long int gcd()':
a.cc:13:31: error: expected primary-expression before 'long'
13 | for (i = 1; i <= sqrt(long double(min)); i++)
| ^~~~
a.cc:22:23: error: expected primary-expression before 'long'
22 | for (i = sqrt(long double(min)); i >... |
s359000663 | p00005 | C++ | #include <cstdio>
#include <algorithm>
int main()
{
int x, y;
while (~scanf("%d%d", &x, &y)){
int gcd = __gcd(x, y);
printf("%d %d\n", gcd, x / gcd * y);
}
} | a.cc: In function 'int main()':
a.cc:8:27: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
8 | int gcd = __gcd(x, y);
| ^~~~~
| std::__gcd
In file included from /usr/include/c++/14/algorithm:61,
... |
s808551834 | p00005 | C++ | #include<stdio.h>
a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b);
} | a.cc:2:1: error: 'a' does not name a type
2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b);
| ^
a.cc:2:7: error: expected constructor, destructor, or type conversion before '(' token
2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b);
| ^
|
s453529963 | p00005 | C++ | #include<stdio.h>
main(a,b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
} | a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(a,b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
| ^
|
s877547222 | p00005 | C++ | #include<stdio.h>
int main(){int a,b;while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);return 0;}
| a.cc: In function 'int main()':
a.cc:2:63: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
2 | int main(){int a,b;while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);return 0;}
| ^~~~~
| ... |
s128480180 | p00005 | C++ | #include<cstdio>
#include<algorithm>
int main(){int a,b;while(2=scanf("%d%d",&a,&b))printf("%d %d\n",std::__gcd(a,b),std::__gcd(a,b)*b);return 0;}
| a.cc: In function 'int main()':
a.cc:3:26: error: lvalue required as left operand of assignment
3 | int main(){int a,b;while(2=scanf("%d%d",&a,&b))printf("%d %d\n",std::__gcd(a,b),std::__gcd(a,b)*b);return 0;}
| ^
|
s561681270 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a, int b){
//a < b ユークリッドの互除法
if(a==0) return b;
return gcd(b%a,a)
}
//lcm = a*b/gcd
int main(){
int a,b;
while(cin >> a >> b){
int g = gcd(a,b);
cout << g << " " << a*b/g;
}
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:7:20: error: expected ';' before '}' token
7 | return gcd(b%a,a)
| ^
| ;
8 | }
| ~
|
s640469833 | p00005 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
long long a,b,s,m,ta,tb,tmp;
while(cin>>a>>b){
ta=a,tb=b;
s=0,m=0;
if(a<b)swap(a,b);
else
while(true){
if(a==0||b==0)cout<<"a#";
tmp=a;
a=b;
b=tmp%a;
if(a%b==0){
m=b;
break;
}
if(a<b){
//cout<<a<<" "... | a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s920819356 | p00005 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
#define long long ll;
int main(){
ll a,b,ta,tb;
while(cin>>a>>b){
ta=a;tb=b;
if(a<b)swap(a,b);
while(1){
ll tmp=b;
b=a%b;
a=tmp;
//cout<<a<<b<<endl;
if(b==0)break;
}
cout<<a<<" "<<ta*tb/a<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'll' was not declared in this scope
6 | ll a,b,ta,tb;
| ^~
a.cc:8:20: error: 'a' was not declared in this scope
8 | while(cin>>a>>b){
| ^
a.cc:8:23: error: 'b' was not declared in this scope
8 | while(cin>>a>>b)... |
s409567879 | p00005 | C++ | //PCK2003////
#include<iostream>
#include<algorithm>
using namespace std;
#define long long ll;
int main(){
long long a,b,ta,tb;
while(cin>>a>>b){
ta=a;tb=b;
if(a<b)swap(a,b);
while(1){
long long tmp=b;
b=a%b;
a=tmp;
//cout<<a<<b<<endl;
if(b==0)break;
}
cout<<a<<" "<<ta*tb/a<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:19: error: redeclaration of 'long int ll'
5 | #define long long ll;
| ^~
a.cc:7:6: note: in expansion of macro 'long'
7 | long long a,b,ta,tb;
| ^~~~
a.cc:5:19: note: 'long int ll' previously declared here
5 | #define long long ll;
... |
s132610571 | p00005 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
long long int a,b,ans;
while(cin>>a>>b){
for(int i=2;i<=(min(a,b);i++){
if(a%i==0 && b%i==0)ans=i;
}
cout<<ans<<ans*(a/ans)*(b/ans)<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:41: error: expected ')' before ';' token
8 | for(int i=2;i<=(min(a,b);i++){
| ~ ^
| )
|
s937715024 | p00005 | C++ | # -*- coding: utf-8 -*-
import sys
def gcd(a,b):
while a%b:
a,b = b,a%b
return b
def lcm(a,b):
return a*b/gcd(a,b)
for s in sys.stdin:
a,b = map(int,s.split())
a,b = max(a,b),min(a,b)
print gcd(a,b),lcm(a,b) | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:2:1: error: 'import' does not name a type
2 | import sys
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s144068249 | p00005 | C++ | # -*- coding: utf-8 -*-
import sys
import fractions
def lcm(a,b):
return a / fractions.gcd(a,b) * b
for s in sys.stdin:
a,b = map(int,s.split())
gcd_ab = fractions.gcd(a,b)
lcm_ab = lcm(a,b)
print gcd_ab,lcm_ab | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:2:1: error: 'import' does not name a type
2 | import sys
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s593960429 | p00005 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define int long long
int gcd(int a,int b){
if(b==0) return a;
else gcd(b,a%b);
}
unsigned main(){
int A,B;
while(cin>>A>>B){
printf("%d %d\n",gcd(A,B),A*B/gcd(A,B));
... | cc1plus: error: '::main' must return 'int'
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:13:17: warning: control reaches end of non-void function [-Wreturn-type]
13 | else gcd(b,a%b);
| ~~~^~~~~~~
|
s749986329 | p00005 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define int long long
int gcd(int a,int b){
if(b==0) return a;
else gcd(b,a%b);
}
unsigned main(){
int A,B;
while(cin>>A>>B){
printf("%lld %lld\n",gcd(A,B),A*B/gcd(A,B... | cc1plus: error: '::main' must return 'int'
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:13:17: warning: control reaches end of non-void function [-Wreturn-type]
13 | else gcd(b,a%b);
| ~~~^~~~~~~
|
s633037007 | p00005 | C++ | import java.util.Scanner;
class Main {
public static long a, b;
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while(cin.hasNext()){
a = cin.nextLong();
b = cin.nextLong();
solve();
}
}
public static void solve() {
if(a < b){
Long tmp = a;
a = b;
b = a;
... | 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:4:15: error: expected ':' before 'static'
4 | public static long a, b;
| ^~~~~~~
| :
a.cc:5:15: error... |
s056748296 | p00005 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
return b > 0 ? gcd(b, a % b) : a;
}
int main() {
int a, b;
while (scanf("%d%d", &a, &b) != EOF) {
printf("%d %lld", gcd(a, b), (ll)a / gcd(a, b) * b);
}
return 0;
... | a.cc: In function 'int main()':
a.cc:14:39: error: 'll' was not declared in this scope
14 | printf("%d %lld", gcd(a, b), (ll)a / gcd(a, b) * b);
| ^~
|
s430275631 | p00005 | C++ | #include <iostream>
using std;
int main(){
long a,b;
a=0;b=0;
cin >> a >> b;
if(a<b) {
long c;
c=a;
a=b;
b=c;
}
long answer;
long d,e,f;
for(;;){
if(e==f){
answer = a*b/f;
break;
}
d=e-f;
e=f;... | a.cc:3:7: error: expected nested-name-specifier before 'std'
3 | using std;
| ^~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> a >> b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++... |
s116612565 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
while(true){
int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1;
cin >> a >> b;
seki = a*b;
if(a == -1){
break;
}
if(a < b){
i=a;
a=b;
b=i;
}
for(i = 1;i <= 50;i++){
if(b == 1){
g = a;
break;
}
else {
a = a%b;
i=a;
a=b;
... | a.cc: In function 'int main()':
a.cc:30:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
30 | cout >> g >> " " >> seki/g >> endl;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:30:6: not... |
s034940100 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1;
cin >> a >> b;
seki = a*b;
if(a == -1){
break;
}
if(a < b){
i=a;
a=b;
b=i;
}
for(i = 1;i <= 50;i++){
if(b == 1){
g = a;
break;
}
else {
a = a%b;
i=a;
a=b;
b=i;
}
}
co... | a.cc: In function 'int main()':
a.cc:9:17: error: break statement not within loop or switch
9 | break;
| ^~~~~
a.cc:29:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
29 | cout >> g >> " " >> seki/g >> endl;
... |
s576620932 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1;
cin >> a >> b >>;
seki = a*b;
if(a == -1){
break;
}
if(a < b){
i=a;
a=b;
b=i;
}
for(i = 1;i <= 50;i++){
if(b == 1){
g = a;
break;
}
else {
a = a%b;
i=a;
a=b;
b=i;
}
}... | a.cc: In function 'int main()':
a.cc:6:28: error: expected primary-expression before ';' token
6 | cin >> a >> b >>;
| ^
a.cc:9:17: error: break statement not within loop or switch
9 | break;
| ^~~~~
a.cc:29:6: error: no match for... |
s400516926 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1;
cin >> a >> b >>;
seki = a*b;
if(a == -1){
break;
}
if(a < b){
i = a;
a = b;
b = i;
}
for(i = 1;i <= 50;i++){
if(b == 1){
g = a;
break;
}
else {
a = a%b;
i = a;
a = b;
... | a.cc: In function 'int main()':
a.cc:6:28: error: expected primary-expression before ';' token
6 | cin >> a >> b >>;
| ^
a.cc:9:17: error: break statement not within loop or switch
9 | break;
| ^~~~~
a.cc:29:6: error: no match for... |
s279298387 | p00005 | C++ | #include<cstdio>
typedef unsigned long long ll;
int gcd(int a,int b)
{
if(b==0)return a;
else return gcd(b,a%b);
}
int main()
{
ll n,m;
while(scanf("%d%d",&n,&m)==2)
{
ll d = gcd(n,m),ll ans = n/d*m;
printf("%lld %lld\n",d,n*m/d);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:36: error: expected initializer before 'ans'
13 | ll d = gcd(n,m),ll ans = n/d*m;
| ^~~
|
s403817906 | p00005 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
int main(){
long long int a,b,A,B;
while(cin>>a>>b){
A=a;B=b;
while (b)
{
int tmp = a % b;
a = b;
b = tmp;
}
b=A*B/a
cout<<a<<" "<<b<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:8: error: expected ';' before 'cout'
17 | b=A*B/a
| ^
| ;
18 | cout<<a<<" "<<b<<endl;
| ~~~~
|
s215487489 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
long int gcd[200],num1,num2,lcm[200];
int a,b;
int i=0;
while(cin >> a >> b){
num1 = a;
num2 = b;
if( a<b ){
num2 = a;
num1 = b;
}
while( (gcd[i]=num1%num2) != 0){
num1 = num2;
num2 = ggd[i];
}
gcd[i] = num2;
lcm[i] = a / gcd[i]... | a.cc: In function 'int main()':
a.cc:20:32: error: 'ggd' was not declared in this scope; did you mean 'gcd'?
20 | num2 = ggd[i];
| ^~~
| gcd
|
s777865392 | p00005 | C++ | #include<iostream>
int main(){
int a,b;
while( cin >> a >> b ){
int num1 = a;
int num2 = b;
if( a<b ){
num2 = a;
num1 = b;
}
while( (int gcd = num1%num2) != 0){
num1 = num2;
num2 = gcd;
}
gcd = num2;
int lcm = a / gcd * b;
cout << gcd <<" "<< lcm << "\n";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while( cin >> a >> b ){
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | e... |
s795255621 | p00005 | C++ | #include<iostream>
int main(){
int a,b;
while( std::cin >> a >> b ){
int num1 = a;
int num2 = b;
if( a<b ){
num2 = a;
num1 = b;
}
while( (int gcd = num1%num2) != 0){
num1 = num2;
num2 = gcd;
}
gcd = num2;
int lcm = a / gcd * b;
std::cout << gcd <<" "<< lcm << "\n";
}
return 0... | a.cc: In function 'int main()':
a.cc:15:25: error: expected primary-expression before 'int'
15 | while( (int gcd = num1%num2) != 0){
| ^~~
a.cc:15:25: error: expected ')' before 'int'
15 | while( (int gcd = num1%num2) != 0){
| ... |
s019094650 | p00005 | C++ | #include <iostream>
int main(){
u_int a, b;
while(std::cin >> a >> b){
u_int minmul; //least common multiple
u_int maxdivi = 1; //greatest common divisor
u_int small;
if(a > b)
small = b;
else
small = a;
for(int i = 2; i <= small; i++){
if(a % i == 0 && b % i == 0){
maxdivi = maxdivi ... | a.cc: In function 'int main()':
a.cc:26:33: error: 'minimul' was not declared in this scope; did you mean 'minmul'?
26 | std::cout << maxdivi << minimul << std::endl;
| ^~~~~~~
| minmul
|
s527563512 | p00005 | C++ | #include<iostream>
int main(){
long int a, b, r;
while(std::cin >> a >> b){
long int product = a*b;
// GCD
if(a < b){
long int temp = a;
a = b;
b = temp;
}
while((r = a%b) != 0){
a = b;
b = r;
}
// LCM
long int lcm = product / b;
// show
std::cout << b << " " << lcm << s... | a.cc:28:2: error: expected declaration before '}' token
28 | }}
| ^
|
s159591836 | p00005 | C++ | #include<stdio.h>
using namespace std;
int max(int x, int y){
int r;
while((r = x % y) != 0){
x = y;
y = r;
}
return y;
}
long long int small(long long int x,long long int y, int r){
if(x * y % r == 0)
return x * y / r;
... | a.cc: In function 'int main()':
a.cc:31:17: error: 'cout' was not declared in this scope
31 | cout << max(x,y) << " " << small(x,y,max(x,y)) << endl;
| ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
... |
s582901213 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a, int b) {
return a % b ? gcd(b, a % b) : b;
}
int lcm(int a, int b) {
return a / gcd(a,b) * b;
}
int main() {
int a, b;
while(con >> a >> b) {
cout << gcd(a,b) << " " << lcm(a,b) << endl;
} | a.cc: In function 'int main()':
a.cc:13:7: error: 'con' was not declared in this scope
13 | while(con >> a >> b) {
| ^~~
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:11:12: note: to match this '{'
11 | int main() {
| ^
|
s457718604 | p00005 | C++ | #include <cstdio>
using namespace std;
int a, b, d, e;
int gcd(int x, int y)
{
if (x<y)
{
x+=y;
y=x-y;
x-=y;
}
if (y==0)
return x;
else
return gcd(y, x%y)
}
int lcm(int x, int y)
{
return (long long)x*y/d;
}
int main()
{
while (scanf("%d%d", &a, &b)!=EOF)
{
d = gcd(a,b);
e = lcm(a, b);
printf("%l... | a.cc: In function 'int gcd(int, int)':
a.cc:15:27: error: expected ';' before '}' token
15 | return gcd(y, x%y)
| ^
| ;
16 | }
| ~
|
s009167349 | p00005 | C++ | 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.printf("%d %d%n",c,d);
}
}
public static int gcd(int x,int y){
int max=Math.max(x,y);
int min=Math.min(x,y);... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:7: error: expected ':' before 'static'
4 | public static void main(String[] args){
| ^~~~~~~
| :
a.cc:4:25: error: 'String' has n... |
s659192575 | p00005 | C++ | // B.cpp
#include <iostream>
using namespace std;
int gcd(int, int);
int lcm(int, int);
int main(void) {
int a, b;
cin >> a >> b;
cout << gcd(a, b) << " " << lcm(a, b) << endl;
return 0;
}
int gcd(int a, int b) {
int max, min, res;
res = 1;
if(a > b){
max = a, min = b;
}
if(a =< b){
max = b, mi... | a.cc: In function 'int gcd(int, int)':
a.cc:26:15: error: expected primary-expression before '<' token
26 | if(a =< b){
| ^
|
s764614271 | p00005 | C++ | #include<iostream>
#include<argolithm>
int main(void)
{
unsigned int a, b, g, l;
while( std::cin >> a >> b ){
g = gcd( a, b );
l = a * b / g;
std::cout << g << std::endl;
std::cout << l << std::endl;
}
return 0;
}
int gcd( int a, int b ){
int n, i;
unsigned int tmp[4];
tmp[0] = std::max( a, b );
tm... | a.cc:2:9: fatal error: argolithm: No such file or directory
2 | #include<argolithm>
| ^~~~~~~~~~~
compilation terminated.
|
s203552647 | p00005 | C++ | #include<iostream>
#include<argolithm>
int gcd( unsigned int, unsigned int );
int main(void)
{
unsigned int a, b, g, l;
while( std::cin >> a >> b ){
g = gcd( a, b );
l = a * b / g;
std::cout << g << std::endl;
std::cout << l << std::endl;
}
return 0;
}
int gcd( unsigned int a, unsigned int b ){
int n, ... | a.cc:2:9: fatal error: argolithm: No such file or directory
2 | #include<argolithm>
| ^~~~~~~~~~~
compilation terminated.
|
s472776811 | p00005 | C++ | #include<iostream>
#include<argorithm>
int gcd( unsigned int, unsigned int );
int main(void)
{
unsigned int a, b, g, l;
while( std::cin >> a >> b ){
g = gcd( a, b );
l = a * b / g;
std::cout << g << std::endl;
std::cout << l << std::endl;
}
return 0;
}
int gcd( unsigned int a, unsigned int b ){
int n, ... | a.cc:2:9: fatal error: argorithm: No such file or directory
2 | #include<argorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s934203706 | p00005 | C++ | #include<iostream>
#include<algorithm>
int gcd( unsigned int, unsigned int );
int main(void)
{
unsigned int a, b, g, l;
while( std::cin >> a >> b ){
g = gcd( a, b );
l = a * b / g;
std::cout << g << std::endl;
std::cout << l << std::endl;
}
return 0;
}
int gcd( unsigned int a, unsigned int b ){
int n, ... | a.cc: In function 'int gcd(unsigned int, unsigned int)':
a.cc:24:23: error: 'mix' is not a member of 'std'; did you mean 'min'?
24 | tmp[1] = std::mix( a, b );
| ^~~
| min
|
s428121148 | p00005 | C++ | //#define _USE_MATH_DEFINES
#include <iostream>
//#include <stdio.h>
//#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>
using namespace std;
long gcd(long a, long b){
long A, B, R;
if (a > b){
A = a;
B = b;
}
else{
A = b;
B = a;
... | a.cc: In function 'long int lcm(long int, long int)':
a.cc:45:29: error: 'ceil' was not declared in this scope
45 | B = ceil((float)A / (float)b) * b;
| ^~~~
a.cc:48:29: error: 'ceil' was not declared in this scope
48 | A = ceil((fl... |
s671374988 | p00005 | C++ | #include<cstdio>
int g(int x,int y){return y?g(y,x%y):x;}
int main(){
int x,y;
while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y));
} | a.cc: In function 'int main()':
a.cc:5:52: error: 'a' was not declared in this scope
5 | while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y));
| ^
a.cc:5:54: error: 'b' was not declared in this scope
5 | while(~scanf("%d%d",&x,&y))printf("%d %d\... |
s753558837 | p00005 | C++ | #include<cstdio>
int g(int x,int y){return y?g(y,x%y):x;}
int main(){
int x,y;
while(cin>>x>>y)printf("%d %d\n",g(x,y),x*y/g(x,y));
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'cin' was not declared in this scope
5 | while(cin>>x>>y)printf("%d %d\n",g(x,y),x*y/g(x,y));
| ^~~
|
s199586335 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b, c, d,r,s,h;
for (cin >> a >> b){
//c
h = a;
s = b; {
r = h % s;
if (r == 0) {
c = s;
break;
}
h = s;
s = r;
}
//d
h = a;
s = b;
if (a < b){
for (;;){
if ((b % a) == 0){
d = b;
break;
}
b = ... | a.cc: In function 'int main()':
a.cc:7:27: error: expected ';' before ')' token
7 | for (cin >> a >> b){
| ^
| ;
a.cc:44:1: error: expected primary-expression before '}' token
44 | }
| ^
a.cc:43:10: error: expected ';' before '}' token... |
s365033381 | p00005 | C++ | import sys
for line in sys.stdin:
a, b = map(int, line.split())
c = a * b
while b:
a, b = b, a % b
print(str(a) + ' ' + str(c / a)) | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.