criyle/codenet-compile-errors huggingface dataset:
Language: C

include <stdio.h>

void bsort(int *n1, int *n2, int *n3)
{
	if(*n1 > *n2) {
		int tmp = *n1;
		*n1 = *n2;
		*n2 = tmp;
	}
	if(*n1 > *n3){
		int tmp = *n1;
		*n1 = *n3;
		*n3 = tmp;
	}
	if(*n2 > *n3){
		int tmp = *n2;
		*n2 = *n3;
		*n3 = tmp;
	}
}

int main(void)
{
	int a, b, c;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	printf("%d %d %d\n", a, b, c);

	bsort(&a, &b, &c);
	printf("%d %d %d\n", a, b, c);

	return (0);
}



Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:25:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   25 |         scanf("%d", &a);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:25:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   25 |         scanf("%d", &a);
      |         ^~~~~
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:28:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   28 |         printf("%d %d %d\n", a, b, c);
      |         ^~~~~~
main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:9: error: implicit declaration of function 'bsort' [-Wimplicit-function-declaration]
   30 |         bsort(&a, &b, &c);
      |         ^~~~~
Language: C

#include<stdio.h>

int main()
{
	int n = 3;
	int array[] = { 0 };

	scanf_s("%d %d %d", &array[0], &array[1], &array[2]);

	int i, j;
	for (i = 0; i < n - 1; i++)
	{
		for (j = n - 1; j > i; j--)
		{
			if (array[j - 1] > array[j])
			{
				int temp = array[j - 1];
				array[j - 1] = array[j];
				array[j] = temp;
			}
		}
	}
	printf("%d %d %d", array[0], array[1], array[2]);
}



Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%d %d %d", &array[0], &array[1], &array[2]);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>
int main(void){
   int i,j,tmp;
   int a[10,000];
   int b;
   scanf("%d",&b);
   for(i=0;i<b;i++)
   scanf("%d",&a[i]);
   for(i=0;i<b;i++){
       for(j=i+1;j<b;j++){
           if(a[i]>a[j]){
               tmp=a[i];
               a[i]=a[j];
               a[j]=tmp;
           }
       }
   }
   for(i=0;i<b;i++)
   printf("%d ",a[i]);
   putchar('\n');
   return 0;
}



Compiler output:
main.c: In function 'main':
main.c:4:12: error: expected ']' before ',' token
    4 |    int a[10,000];
      |            ^
      |            ]
main.c:8:16: error: 'a' undeclared (first use in this function)
    8 |    scanf("%d",&a[i]);
      |                ^
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void)
{
int W, H, x, y, r, xu, xd, yl, yr;
scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
xu = x + r;
xd = x - r;
yl = y - r;
yr = y + r;
if((xd =< 0)||(xu => W)||(yl =< 0)||(yr =< H)){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: expected expression before '<' token
   10 | if((xd =< 0)||(xu => W)||(yl =< 0)||(yr =< H)){
      |         ^
main.c:10:20: error: expected expression before '>' token
   10 | if((xd =< 0)||(xu => W)||(yl =< 0)||(yr =< H)){
      |                    ^
main.c:10:31: error: expected expression before '<' token
   10 | if((xd =< 0)||(xu => W)||(yl =< 0)||(yr =< H)){
      |                               ^
main.c:10:42: error: expected expression before '<' token
   10 | if((xd =< 0)||(xu => W)||(yl =< 0)||(yr =< H)){
      |                                          ^
Language: C

include<stdio.h>
int main()
{
int a, b, c, x, y;
scanf("%d %d %d",&a ,&b, &c);
if(a > b){
  x = a;
  a = b;
  b = x;
}
if(b > c){
  y = b;
  b = c;
  c = y;
}
printf("%d %d %d"a, b, c);
return 0;


Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>
int main()
{
int a, b, c, x, y;
scanf("%d %d %d",&a ,&b, &c);
if(a > b){
  x = a;
  a = b;
  b = x;
}
if(b > c){
  y = b;
  b = c;
  c = y;
}
printf("%d %d %d",a, b, c);
return 0;


Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>
int main()
{
int a, b, c, x, y;
scanf("%d %d %d",&a ,&b, &c);
if(a > b){
  x = a;
  a = b;
  b = x;
}
if(b > c){
  y = b;
  b = c;
  c = y;
}
printf("%d %d %d",a, b, c);
return 0;


Compiler output:
main.c: In function 'main':
main.c:17:1: error: expected declaration or statement at end of input
   17 | return 0;
      | ^~~~~~
Language: C


#include<stdio.h>
int main(void)
{
	int a, b, c;
	scanf_s("%d %d %d", &a, &b, &c);

	if (a < b)
	{
		if (b < c)
		{
			printf("%d %d %d",a,b,c);
		}
		else if (c < b)
		{
			if (a < c)
			{
				printf("%d %d %d",a,c,b);
			}
			else
			{
				printf("%d %d %d",c,a,b);
			}
		}
	}
	else if(b < a)
	{

		if (a < c)
		{
			printf("%d %d %d", b, a, c);
		}
		else if (c < a)
		{
			if (b < c)
			{
				printf("%d %d %d", b, c, a);
			}
			else
			{
				printf("%d %d %d", c, b, a);
			}
		}
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d %d %d", &a, &b, &c);
      |         ^~~~~~~
      |         scanf
Language: C


#include<stdio.h>
int main(void)
{
	int a, b, c;
	scanf_s("%d %d %d", &a, &b, &c);

	if (a < b)
	{
		if (b < c)
		{
			printf("%d %d %d\n",a,b,c);
		}
		else if (c < b)
		{
			if (a < c)
			{
				printf("%d %d %d\n",a,c,b);
			}
			else
			{
				printf("%d %d %d\n",c,a,b);
			}
		}
	}
	else if(b < a)
	{

		if (a < c)
		{
			printf("%d %d %d\n", b, a, c);
		}
		else if (c < a)
		{
			if (b < c)
			{
				printf("%d %d %d\n", b, c, a);
			}
			else
			{
				printf("%d %d %d\n", c, b, a);
			}
		}
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d %d %d", &a, &b, &c);
      |         ^~~~~~~
      |         scanf
Language: C


#include<stdio.h>
int main(void)
{
	int a, b, c;
	scanf_s("%d %d %d", &a, &b, &c);

	if (a <= b)
	{
		if (b <= c)
		{
			printf("%d %d %d\n",a,b,c);
		}
		else if (c <= b)
		{
			if (a <= c)
			{
				printf("%d %d %d\n",a,c,b);
			}
			else
			{
				printf("%d %d %d\n",c,a,b);
			}
		}
	}
	else if(b <= a)
	{

		if (a <= c)
		{
			printf("%d %d %d\n", b, a, c);
		}
		else if (c <= a)
		{
			if (b <= c)
			{
				printf("%d %d %d\n", b, c, a);
			}
			else
			{
				printf("%d %d %d\n", c, b, a);
			}
		}
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d %d %d", &a, &b, &c);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main(void)
{
	int a, b, c;
	scanf_s("%d %d %d", &a, &b, &c);

	if (a <= b)
	{
		if (b <= c)
		{
			printf("%d %d %d\n",a,b,c);
		}
		else if (c <= b)
		{
			if (a <= c)
			{
				printf("%d %d %d\n",a,c,b);
			}
			else
			{
				printf("%d %d %d\n",c,a,b);
			}
		}
	}
	else if(b <= a)
	{

		if (a <= c)
		{
			printf("%d %d %d\n", b, a, c);
		}
		else if (c <= a)
		{
			if (b <= c)
			{
				printf("%d %d %d\n", b, c, a);
			}
			else
			{
				printf("%d %d %d\n", c, b, a);
			}
		}
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d %d %d", &a, &b, &c);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main(void)
{
 int a,b,c,x,y,z;
 
 if(a > b && b > c)
  x = a; y = b; z = c;
 else if(a > c && c > b)
  x = a; y = c; z = b;
 else if(b > a && a > c)
  x = b; y = a; z = c;
 else if(b > c && c > a)
  x = b; y = c; z = a;
 else if(c > a && a > b)
  x = c; y = a; z = b;
 else(c > b && b > a)
  x = c; y = b; z = a;
 
 printf("%d %d %d\n",x,y,z);
 
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:2: error: 'else' without a previous 'if'
    8 |  else if(a > c && c > b)
      |  ^~~~
main.c:10:2: error: 'else' without a previous 'if'
   10 |  else if(b > a && a > c)
      |  ^~~~
main.c:12:2: error: 'else' without a previous 'if'
   12 |  else if(b > c && c > a)
      |  ^~~~
main.c:14:2: error: 'else' without a previous 'if'
   14 |  else if(c > a && a > b)
      |  ^~~~
main.c:16:2: error: 'else' without a previous 'if'
   16 |  else(c > b && b > a)
      |  ^~~~
main.c:16:22: error: expected ';' before 'x'
   16 |  else(c > b && b > a)
      |                      ^
      |                      ;
   17 |   x = c; y = b; z = a;
      |   ~
Language: C

#include<stdio.h>

/*
//Q4 time
int main(void){
    
    int data;
    int a,b,c;
    
    scanf("%d",&data);
    
    a = data / 3600;
    
    b = (data % 3600) / 60;
    
    c = (data % 3600) % 60;
    
    printf("%d:%d:%d",a,b,c);
    
    return 0;
}

*/

/*
int main(void){
    
    int a,b;
    
    scanf("%d%d",&a,&b);
    
    if(a < b){
        printf("a < b\n");
    }else if(b < a){
        printf("a > b\n");
    }else{
         printf("a == b\n");
    }
}
*/

/*
int main(){
    
    int a,b,c;
    
    scanf("%d%d%d",&a,&b,&c);
    
    if(a < b < c){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    
}

*/

int main(){
    
    int a,b,c;
    
    //scanf("%d%d%d",&a,&b,&c);
    int data[3];
    
    for(i=0; i<3; i++){
        scanf("%d",&data[i]);
    }
    int i,j;
    
    for(i=0; i<3; i++){
        for(j=0; j<i; j++){
            if(data[j] > data[j+1]){
                int temp = data[j];
                data[j] = data[j+1];
                data[j+1] = temp;
            }
        }
    }
    
    for(i=0; i<3; i++){
        printf("%d",data[i]);
    }
}


Compiler output:
main.c: In function 'main':
main.c:66:9: error: 'i' undeclared (first use in this function)
   66 |     for(i=0; i<3; i++){
      |         ^
main.c:66:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

	int a,b,c,sort;
	scanf("%d %d %d",&a,&b,&c);
	for(int i = 0;i < 3;i++){
		if(a>b){
			sort=b;
			b=a;
			a=sort;
			if(b>c){
				sort=b;
				b=c;
				c=sort;
			}
		}
	}
	printf("%d %d %d",a,b,c);
	return 0;
}



Compiler output:
main.c:2:15: error: expected declaration specifiers or '...' before string constant
    2 |         scanf("%d %d %d",&a,&b,&c);
      |               ^~~~~~~~~~
main.c:2:26: error: expected declaration specifiers or '...' before '&' token
    2 |         scanf("%d %d %d",&a,&b,&c);
      |                          ^
main.c:2:29: error: expected declaration specifiers or '...' before '&' token
    2 |         scanf("%d %d %d",&a,&b,&c);
      |                             ^
main.c:2:32: error: expected declaration specifiers or '...' before '&' token
    2 |         scanf("%d %d %d",&a,&b,&c);
      |                                ^
main.c:3:9: error: expected identifier or '(' before 'for'
    3 |         for(int i = 0;i < 3;i++){
      |         ^~~
main.c:3:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |         for(int i = 0;i < 3;i++){
      |                         ^
main.c:3:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |         for(int i = 0;i < 3;i++){
      |                              ^~
main.c:15:16: error: expected declaration specifiers or '...' before string constant
   15 |         printf("%d %d %d",a,b,c);
      |                ^~~~~~~~~~
main.c:15:27: error: expected declaration specifiers or '...' before 'a'
   15 |         printf("%d %d %d",a,b,c);
      |                           ^
main.c:15:29: error: expected declaration specifiers or '...' before 'b'
   15 |         printf("%d %d %d",a,b,c);
      |                             ^
main.c:15:31: error: expected declaration specifiers or '...' before 'c'
   15 |         printf("%d %d %d",a,b,c);
      |                               ^
main.c:16:9: error: expected identifier or '(' before 'return'
   16 |         return 0;
      |         ^~~~~~
main.c:17:1: error: expected identifier or '(' before '}' token
   17 | }
      | ^
Language: C

#include<stdio.h>
int main(void)
{
	int a,b,c,sort;
	scanf("%d %d %d",&a,&b,&c);
	for(int i = 0;i =< 3;i++){
		if(a>b){
			sort=b;
			b=a;
			a=sort;
			if(b>c){
				sort=b;
				b=c;
				c=sort;
			}
		}
	}
	printf("%d %d %d\n",a,b,c);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:26: error: expected expression before '<' token
    6 |         for(int i = 0;i =< 3;i++){
      |                          ^
Language: C

#include <stdio.h>int main(void){    int a,b,c;    scanf("%d %d %d",&a,&b,&c);    if(c>b&&b>a){        printf("%d %d %d\n",a,b,c);    }    if(b>c&&c>a){        printf("%d %d %d\n",a,c,b);    }    if(c>a&&a>b){        printf("%d %d %d\n",b,a,c);    }    if(a>c&&c>b){        printf("%d %d %d\n",b,c,a);    }    if(a>b&&b>c){        printf("%d %d %d\n",c,b,a);    }    if(b>a&&a>c){        printf("%d %d %d\n",c,a,b);    }    if(c==b&&b<a){        printf("%d %d %d\n",b,b,a);    }    if(b==a&&a<c){        printf("%d %d %d\n",a,a,c);    }    if(a==c&&c<b){        printf("%d %d %d\n",c,c,b);    }    return 0;    }
			



Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>int main(void){    int a,b,c;    scanf("%d %d %d",&a,&b,&c);    if(c>b&&b>a){        printf("%d %d %d\n",a,b,c);    }    if(b>c&&c>a){        printf("%d %d %d\n",a,c,b);    }    if(c>a&&a>b){        printf("%d %d %d\n",b,a,c);    }    if(a>c&&c>b){        printf("%d %d %d\n",b,c,a);    }    if(a>b&&b>c){        printf("%d %d %d\n",c,b,a);    }    if(b>a&&a>c){        printf("%d %d %d\n",c,a,b);    }    if(c==b&&b<a){        printf("%d %d %d\n",b,b,a);    }    if(b==a&&a<c){        printf("%d %d %d\n",a,a,c);    }    if(a==c&&c<b){        printf("%d %d %d\n",c,c,b);    }    return 0;    }
      |                   ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
int main(void){
int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(c>b&&b>a){       ]
 printf("%d %d %d\n",a,b,c);
    } 
   if(b>c&&c>a){    
    printf("%d %d %d\n",a,c,b);
    } 
   if(c>a&&a>b){        
     printf("%d %d %d\n",b,a,c);
    } 
   if(a>c&&c>b){       
       printf("%d %d %d\n",b,c,a);
    }
    if(a>b&&b>c){ 
       printf("%d %d %d\n",c,b,a);]
    } 
   if(b>a&&a>c){
        printf("%d %d %d\n",c,a,b);
    }
    if(c==b&&b<a){
        printf("%d %d %d\n",b,b,a);
    }
    if(b==a&&a<c){ 
       printf("%d %d %d\n",a,a,c);
    } 
   if(a==c&&c<b){ 
       printf("%d %d %d\n",c,c,b); 
   } 
   return 0;
    }						
		
	

				


			
			
		
	
	
	

	
				
			
		

		
			

														
						
						
						
			
			
						
		
	

				


			
			
		
	
	
	

	
				
			
		

				
			メッセージ入力
			

								


Compiler output:
main.c: In function 'main':
main.c:5:25: error: expected statement before ']' token
    5 |     if(c>b&&b>a){       ]
      |                         ^
main.c:18:35: error: expected statement before ']' token
   18 |        printf("%d %d %d\n",c,b,a);]
      |                                   ^
main.c: At top level:
main.c:81:25: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   81 |                         メッセージ入力
      |                         ^~~~~~~~~~~~~~
Language: C

#include <stdio.h>
int main(void){
    int i,j,tmp;
    int a[3];
    for(i=0; i<3; i++)
    scanf("%d", &a[i]);
    for(i=0; i<3; i++){
        for(j=i+1; j<3; j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0; i<3; i++)
    printf("%d",a[i]);
    putchar(`\n`);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:18:13: error: stray '`' in program
   18 |     putchar(`\n`);
      |             ^
main.c:18:14: error: stray '\' in program
   18 |     putchar(`\n`);
      |              ^
main.c:18:16: error: stray '`' in program
   18 |     putchar(`\n`);
      |                ^
main.c:18:15: error: 'n' undeclared (first use in this function)
   18 |     putchar(`\n`);
      |               ^
main.c:18:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
    int i,j,tmp,a[3];
    for(i=0; i<3; i++)
    scanf("%d", &a[i]);
    for(i=0; i<3; i++){
        for(j=i+1; j<3; j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0; i<3; i++)
    printf("%d",a[i]);
    putchar(`\n`);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:17:13: error: stray '`' in program
   17 |     putchar(`\n`);
      |             ^
main.c:17:14: error: stray '\' in program
   17 |     putchar(`\n`);
      |              ^
main.c:17:16: error: stray '`' in program
   17 |     putchar(`\n`);
      |                ^
main.c:17:15: error: 'n' undeclared (first use in this function)
   17 |     putchar(`\n`);
      |               ^
main.c:17:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
    int i,j,tmp, a[3];
    for(i=1; i<3; i++)
    scanf("%d", &a[i]);
    for(i=1; i<3; i++){
        for(j=i+1; j<3; j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    
    for(i=1; i<3; i++)
    printf("%d",a[i]);
    putchar(`\n`);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:17:13: error: stray '`' in program
   17 |     putchar(`\n`);
      |             ^
main.c:17:14: error: stray '\' in program
   17 |     putchar(`\n`);
      |              ^
main.c:17:16: error: stray '`' in program
   17 |     putchar(`\n`);
      |                ^
main.c:17:15: error: 'n' undeclared (first use in this function)
   17 |     putchar(`\n`);
      |               ^
main.c:17:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C

#include <stdio.h>
 int main(void)
 {
 int a,b,c,tmp;
 scanf("%d",&a);
 scanf("%d",&b);
 scanf("%d",&c);
　if(b<a)
{
 tmp=a;
 a=b;
 b=tmp;
 }
 if(c<b)
{
 tmp=b;
 b=c;
 c=tmp;
 }
 if(b<a)
{
 tmp=a;
 a=b;
 b=tmp;
 }
 printf("%d %d %d\n",a,b,c);
 return 0;
 } 


Compiler output:
main.c: In function 'main':
main.c:8:1: error: stray '\343' in program
    8 | <U+3000>if(b<a)
      | ^~~~~~~~
Language: C

include <stdio.h>
 int main(void)
 {
 int a,b,c,tmp;
 scanf("%d",&a);
 scanf("%d",&b);
 scanf("%d",&c);
　if(b<a)
{
 tmp=a;
 a=b;
 b=tmp;
 }
 if(c<b)
{
 tmp=b;
 b=c;
 c=tmp;
 }
 if(b<a)
{
 tmp=a;
 a=b;
 b=tmp;
 }
 printf("%d %d %d\n",a,b,c);
 return 0;
 } 


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c:8:1: error: stray '\343' in program
    8 | <U+3000>if(b<a)
      | ^~~~~~~~
Language: C

#include <stdio.h>
int main(void){
    int i,j,tmp,a[3];
    for(i=0; i<3; i++)
    scanf("%d ", &a[i]);
    for(i=0; i<3; i++){
    for(j=i+1; j<3; j++){
    if(a[i]>a[j]){
    tmp=a[i];
    a[i]=a[j]     
    a[j]=tmp;
    }
    }
    }
    for(i=0; i<3; i++)
    printf("%d ", a[i]);
putchar('\n');
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:14: error: expected ';' before 'a'
   10 |     a[i]=a[j]
      |              ^
      |              ;
   11 |     a[j]=tmp;
      |     ~
Language: C

#include <stdio.h>
int main(void){
    int i,j,tmp,a[3];
    for(i=0;i<3;i++)
    scanf("%d",&a[i]);
    for(i=0;i<3;
        for(j=i+1;j<3;j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<3;i++)
    printf("%d ",a[i]);
    putchar('\n');
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected expression before 'for'
    7 |         for(j=i+1;j<3;j++){
      |         ^~~
main.c:14:5: error: expected expression before '}' token
   14 |     }
      |     ^
main.c: At top level:
main.c:15:5: error: expected identifier or '(' before 'for'
   15 |     for(i=0;i<3;i++)
      |     ^~~
main.c:15:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   15 |     for(i=0;i<3;i++)
      |              ^
main.c:15:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   15 |     for(i=0;i<3;i++)
      |                  ^~
main.c:17:13: error: expected declaration specifiers or '...' before '\xa'
   17 |     putchar('\n');
      |             ^~~~
main.c:18:5: error: expected identifier or '(' before 'return'
   18 |     return 0;
      |     ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
    int i,j,tmp,a[3];
    for(i=0;i<3;i++)
    scanf("%d",&a[i]);
    for(i=0;i<3;
        for(j=i+1;j<3;j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<3;i++)
    printf("%d ",a[i]);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected expression before 'for'
    7 |         for(j=i+1;j<3;j++){
      |         ^~~
main.c:14:5: error: expected expression before '}' token
   14 |     }
      |     ^
main.c: At top level:
main.c:15:5: error: expected identifier or '(' before 'for'
   15 |     for(i=0;i<3;i++)
      |     ^~~
main.c:15:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   15 |     for(i=0;i<3;i++)
      |              ^
main.c:15:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   15 |     for(i=0;i<3;i++)
      |                  ^~
main.c:17:5: error: expected identifier or '(' before 'return'
   17 |     return 0;
      |     ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C

#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
if(a<b){
    if(b<c){
    printf("%d %d %d\n",a,b,c);
   } else if(c<a){
       printf("%d %d %d\n",c,a,b);
   }
}else if(a<c){
        if(c<b){
    printf("%d %d %d\n",a,c,b);
    } else if(b<a){
    printf("%d %d %d\n",b,a,c);
}else if(b<a){
        if(a<c){
         printf("%d %d %d\n",b,a,c);
    }else if(c<b){
    printf("%d %d %d\n",c,b,a);
    }
}
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:27:1: error: expected declaration or statement at end of input
   27 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
if(a<b){
    if(b<c){
    printf("%d %d %d\n",a,b,c);
   } else if(c<a){
       printf("%d %d %d\n",c,a,b);
   }
}else if(a<c){
        if(c<b){
    printf("%d %d %d\n",a,c,b);
    } else if(b<a){
    printf("%d %d %d\n",b,a,c);
    }
}else if(b<a){
        if(a<c){
         printf("%d %d %d\n",b,a,c);
    }else if(c<b){
    printf("%d %d %d\n",c,b,a);
    }
}else if(b<c){
        if(c<a){
        printf("%d %d %d\n",b,c,a);
      }else if(a<b){
        printf("%d %d %d\n",a,b,c);
      }
}else if(c<a){
        if(a<b){
        printf("%d %d %d\n",c,a,b);
      }else if(b<c){
        printf("%d %d %d\n",b,c,a);
      }
}else if(c<b){
        if(b<a){
        printf("%d %d %d\n",c,b,a);
      }else if(a<c){
        printf("%d %d %d\n",a,c,b);
      }
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:44:1: error: expected declaration or statement at end of input
   44 | }
      | ^
Language: C

#include<stdio.h>

int main(){
 int a,b,c;
 scanf("%d",&a);
 scanf("%d",&b);
 scanf("%d",&c);

 if(a <= b && a <= c){
  printf("%d ",a);
  if(b <= c){
   printf("%d %d",b,c);
  }
  else{
   printf("%d %d",c,b);
  }
 }
 
 else if(b <= a && b <= c){
  printf("%d ",b);
  if(a <= c){
   printf("%d %d",a,c);
  }
  else{
   printf("%d %d",c,a);
  }
 }

 else{
  printf("%d ",c);
  if(c <= a){
   printf("%d %d",b,c);
  }
 }
  else{
   printf("%d %d",c,b);
  }
}


Compiler output:
main.c: In function 'main':
main.c:35:3: error: 'else' without a previous 'if'
   35 |   else{
      |   ^~~~
Language: C

#include<stdio.h>

int main(){
 int a,b,c;
 scanf("%d",&a);
 scanf("%d",&b);
 scanf("%d",&c);

 if(a <= b && a <= c){
  printf("%d ",a);
  if(b <= c){
   printf("%d %d\n",b,c);
  }
  else{
   printf("%d %d\n",c,b);
  }
 }
 return 0;
 
 else if(b <= a && b <= c){
  printf("%d ",b);
  if(a <= c){
   printf("%d %d\n",a,c);
  }
  else{
   printf("%d %d\n",c,a);
  }
 }
 return 0;
 else{
  printf("%d ",c);
  if(c <= a){
   printf("%d %d\n",b,c);
  }
  else{
   printf("%d %d\n",c,b);
  }
 }
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:2: error: 'else' without a previous 'if'
   20 |  else if(b <= a && b <= c){
      |  ^~~~
main.c:30:2: error: 'else' without a previous 'if'
   30 |  else{
      |  ^~~~
Language: C

int main()
{
	int a,b,c,d,e,f;
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	
	if(a<b&&b<c){d=a;e=b;f=c;}
	if(a<c&&c<b){d=a;e=c;f=b;}
	if(b<a&&a<c){d=b;e=a;f=c;}
	if(b<c&&c<a){d=b;e=c;f=a;}
	if(c<a&&a<b){d=c;e=a;f=b;}
	if(c<b&&b<a){d=c;e=b;f=a;}

	printf("%d %d %d\n",d,e,f);}
}


Compiler output:
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%d",&a);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main()
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%d",&a);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |         printf("%d %d %d\n",d,e,f);}
      |         ^~~~~~
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
Language: C

#include <stdio.h>

int main(void){
  int a, b, c;
  scanf("%d %d %d",&a, &b, &c);
  if(a > b) swap(&a,&b);
  if(b > c) swap(&b,&c);
  if(a > b) swap(&a,&b);
  printf("%d %d %d\n", a, b, c);

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:6:13: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
    6 |   if(a > b) swap(&a,&b);
      |             ^~~~
Language: C

include <stdio.h>

int main(void)
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if ((a < b) && (a < c)) {
		printf("%d", a);
	}
	else if ((b < a) && (b < c)) {
		printf("%d", b);
	}
	else{
		printf("%d", c);
	}

	if ((a < b) && (a < c)) {
		printf("%d", a);
	}
	else if ((b < a) && (b < c)) {
		printf("%d", b);
	}
	else {
		printf("%d", c);
	}

	if ((a < b) && (a < c)) {
		printf("%d", a);
	}
	else if ((b < a) && (b < c)) {
		printf("%d", b);
	}
	else {
		printf("%d\n", c);
	}
	

return 0;
} 


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include<stdio.h>
main()
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	
	if ( a < b && b < c )
	printf("%d %d %d\n", a, b, c);
	else if ( a < c && c < b )
	printf("%d %d %d\n", a, c, b);
	else if ( b < a && a < c )
	printf("%d %d %d\n", b, a, c);
	else if ( b < c && c < a )
	printf("%d %d %d\n", b, c, a);
	else if ( c < a && a < b )
        printf(“%d %d %d\n”, c, a, b);
        else if ( c < b && b < a )
        printf(“%d %d %d\n”, c, b, a);
        else
        printf(“%d %d %d\n”, a, b, c);
        return 0;
}



Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:16:16: error: stray '\342' in program
   16 |         printf(<U+201C>%d %d %d\n<U+201D>, c, a, b);
      |                ^~~~~~~~
main.c:16:17: error: expected expression before '%' token
   16 |         printf(“%d %d %d\n”, c, a, b);
      |                 ^
main.c:16:25: error: stray '\' in program
   16 |         printf(“%d %d %d\n”, c, a, b);
      |                         ^
main.c:16:27: error: stray '\342' in program
   16 |         printf(<U+201C>%d %d %d\n<U+201D>, c, a, b);
      |                                  ^~~~~~~~
main.c:18:16: error: stray '\342' in program
   18 |         printf(<U+201C>%d %d %d\n<U+201D>, c, b, a);
      |                ^~~~~~~~
main.c:18:17: error: expected expression before '%' token
   18 |         printf(“%d %d %d\n”, c, b, a);
      |                 ^
main.c:18:25: error: stray '\' in program
   18 |         printf(“%d %d %d\n”, c, b, a);
      |                         ^
main.c:18:27: error: stray '\342' in program
   18 |         printf(<U+201C>%d %d %d\n<U+201D>, c, b, a);
      |                                  ^~~~~~~~
main.c:20:16: error: stray '\342' in program
   20 |         printf(<U+201C>%d %d %d\n<U+201D>, a, b, c);
      |                ^~~~~~~~
main.c:20:17: error: expected expression before '%' token
   20 |         printf(“%d %d %d\n”, a, b, c);
      |                 ^
main.c:20:25: error: stray '\' in program
   20 |         printf(“%d %d %d\n”, a, b, c);
      |                         ^
main.c:20:27: error: stray '\342' in program
   20 |         printf(<U+201C>%d %d %d\n<U+201D>, a, b, c);
      |                                  ^~~~~~~~
Language: C


void main ()
{
    int buf[3];
    int out[3];
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 3; i++) {
        
        if (buf[i] =< buf[i+1]) {
            # notihng to do
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[0];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] =< buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
}



Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:7:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:10: error: 'i' undeclared (first use in this function)
    9 |     for (i = 0; i < 3; i++) {
      |          ^
main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:21: error: expected expression before '<' token
   11 |         if (buf[i] =< buf[i+1]) {
      |                     ^
main.c:12:15: error: invalid preprocessing directive #notihng
   12 |             # notihng to do
      |               ^~~~~~~
main.c:15:13: error: 'tmp' undeclared (first use in this function)
   15 |             tmp = buf[i + 1];
      |             ^~~
main.c:19:18: error: 'j' undeclared (first use in this function)
   19 |             for (j = i; j > 0; j--) {
      |                  ^
main.c:20:29: error: expected expression before '<' token
   20 |                 if (buf[j] =< buf[j - 1]) {
      |                             ^
main.c:28:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   28 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:28:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:28:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


void main ()
{
    int i, j;
    int buf[3];
    int out[3];
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 3; i++) {
        
        if (buf[i] =< buf[i+1]) {
            # notihng to do
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[0];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] =< buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
}



Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:8:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:21: error: expected expression before '<' token
   12 |         if (buf[i] =< buf[i+1]) {
      |                     ^
main.c:13:15: error: invalid preprocessing directive #notihng
   13 |             # notihng to do
      |               ^~~~~~~
main.c:16:13: error: 'tmp' undeclared (first use in this function)
   16 |             tmp = buf[i + 1];
      |             ^~~
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:29: error: expected expression before '<' token
   21 |                 if (buf[j] =< buf[j - 1]) {
      |                             ^
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


void main ()
{
    int i, j;
    int buf[3];
    int out[3];
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 3; i++) {
        
        if (buf[i] <= buf[i+1]) {
            # notihng to do
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[0];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
}



Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:8:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:15: error: invalid preprocessing directive #notihng
   13 |             # notihng to do
      |               ^~~~~~~
main.c:16:13: error: 'tmp' undeclared (first use in this function)
   16 |             tmp = buf[i + 1];
      |             ^~~
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


void main ()
{
    int i, j, tmp;
    int buf[3];
    int out[3];
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 3; i++) {
        
        if (buf[i] <= buf[i+1]) {
            # notihng to do
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[0];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
}



Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:8:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:15: error: invalid preprocessing directive #notihng
   13 |             # notihng to do
      |               ^~~~~~~
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


void main()
{
    int i, j, tmp;
    int buf[3];
    int out[3];
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 3; i++) {
        
        if (buf[i] <= buf[i+1]) {
            # notihng to do
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[0];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
}



Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:8:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:15: error: invalid preprocessing directive #notihng
   13 |             # notihng to do
      |               ^~~~~~~
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


void main(void)
{
    int i, j, tmp;
    int buf[3];
    int out[3];
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 3; i++) {
        
        if (buf[i] <= buf[i+1]) {
            # notihng to do
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[0];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
    
    return;
}



Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:8:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:15: error: invalid preprocessing directive #notihng
   13 |             # notihng to do
      |               ^~~~~~~
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


void main(void)
{
    int i, j, tmp;
    int buf[3] = 0;
    
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 2; i++) {
        
        if (buf[i] <= buf[i+1]) {
            /*notihng to do*/
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[i];
            buf[i] = tmp;
/*
            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
*/
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
    
}



Compiler output:
main.c: In function 'main':
main.c:5:18: error: invalid initializer
    5 |     int buf[3] = 0;
      |                  ^
main.c:7:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:7:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |     scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
      |     ^~~~~
main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d %d %d\n", buf[0], buf[1], buf[2]);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int i, j, tmp;
    int buf[3] = {0};
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    /*
    for (i = 0; i < 2; i++) {
        
        if (buf[i] <= buf[i+1]) {
        } else if (i > 0) {
            
            tmp = buf[i + 1];
            buf[i + 1] = buf[i];
            buf[i] = tmp;

            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
        }
    }
    */
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
    printf(""test);
    
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:31:14: error: expected ')' before 'test'
   31 |     printf(""test);
      |           ~  ^~~~
      |              )
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int i, j, tmp;
    int buf[3] = {0};
    scanf("%d %d %d\n", &buf[0], &buf[1], &buf[2]);
    
    for (i = 0; i < 2; i++) {
        
        if (buf[i] <= buf[i+1]) & (i > 0) {
            tmp = buf[i + 1];
            buf[i + 1] = buf[i];
            buf[i] = tmp;
/*
            for (j = i; j > 0; j--) {
                if (buf[j] <= buf[j - 1]) {
                    buf[j + 1] = buf[0];
                    buf[j] = tmp;
                }
            }
            */
        }
    }
    
    printf("%d %d %d\n", buf[0], buf[1], buf[2]);
    
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:12:33: error: lvalue required as unary '&' operand
   12 |         if (buf[i] <= buf[i+1]) & (i > 0) {
      |                                 ^
main.c:12:42: error: expected ';' before '{' token
   12 |         if (buf[i] <= buf[i+1]) & (i > 0) {
      |                                          ^~
      |                                          ;
Language: C

#include<stdio.h>
int main(){
	int num[3];
	int tmp,i,p,q;
	for(i = 0; i < 3; i++){
	scanf("%d",&num[i]);
	}
	for(p = 0; p < 2; p++){
		for(q = p + 1; q < 3; q++){
			if(num[p] > num[q]){
				tmp = num[p];
				num[p] = num[q];
				num[q] = tmp;
			}
		}
	}
	for(i = 0; i < 2; i++){
		printf("%d ",num[i]);
	}
	printf(“%d\n”, num[2]);
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:20:16: error: stray '\342' in program
   20 |         printf(<U+201C>%d\n<U+201D>, num[2]);
      |                ^~~~~~~~
main.c:20:17: error: expected expression before '%' token
   20 |         printf(“%d\n”, num[2]);
      |                 ^
main.c:20:19: error: stray '\' in program
   20 |         printf(“%d\n”, num[2]);
      |                   ^
main.c:20:21: error: stray '\342' in program
   20 |         printf(<U+201C>%d\n<U+201D>, num[2]);
      |                            ^~~~~~~~
Language: C

#include <stdio.h>
int main(void){

 int a,b,c;
 scanf("%d", &a);
 scanf("%d", &b);
 scanf("%d", &c);
 
 if(a < b&&b < c) 
 printf("a b c\n");
 else if(b < a&&a < c)
 printf("b a c\n");
 else if(a <c&&c < b);
 printf("a c b\n");
 else if(b < c&&c <a)
 printf("b c a\n");
 else if(c < a&&a < b)
 printf("c a b\n");
 else (c < b&&b < a)
 printf("c b a\n");
 
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:2: error: 'else' without a previous 'if'
   15 |  else if(b < c&&c <a)
      |  ^~~~
main.c:19:21: error: expected ';' before 'printf'
   19 |  else (c < b&&b < a)
      |                     ^
      |                     ;
   20 |  printf("c b a\n");
      |  ~~~~~~