Language: C


#include <stdio.h>
int main(void)
{
	a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
	for (;;)
	{
		l=0;
		k=0;
		b=0;
		scanf("%d",&b);
		if (b==0000)
		{
			break 0;
		}
		if (b==6174)
		{
			printf("0\n");
		}
		if (b%1111==0)
		{
			printf("NA\n");
		}
		if (b!=6174)
		{
			c=b/1000;
			g[c]=1;				
			d=(b-(1000*c))/100;
			g[d]=1;			
			e=(b-(1000*c)-(100*d))/10;
			g=[e]=1;		
			f=b-(1000*c)-(100*d)-(10*e);
			g[f]=1;		
			for (h=10;h<=0;h--)
			{
				if (g[h]==1)
				{
					for (rina=0;rina<=4;rina++)
					{
						m[rina]=h;
					}
				}
				i=m[0]*1000+m[1]*100+m[2]*10+m[3];
			}
			m[4]={0};
			for (h=0;h<=10;h++)
			{
				if=(g[h]==1)
				{
					for (rina=0;rina<=4;rina++)
					{
						m[rina]=h;	
				}
			}
			j=m[0]*1000+m[1]*100+m[2]*10+m[3];
			b=i-j;
			l++;
		}
		printf("&d\n",l);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'a' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |         ^
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:11: error: 'b' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |           ^
main.c:5:13: error: 'c' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |             ^
main.c:5:15: error: 'd' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |               ^
main.c:5:17: error: 'e' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |                 ^
main.c:5:19: error: 'f' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |                   ^
main.c:5:21: error: 'g' undeclared (first use in this function)
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |                     ^
main.c:5:27: error: expected expression before '{' token
    5 |         a,b,c,d,e,f,g[10]={0},h,i,j,k,l,m[10]={0},n,rina,suzuki;
      |                           ^
main.c:8:17: error: 'l' undeclared (first use in this function)
    8 |                 l=0;
      |                 ^
main.c:9:17: error: 'k' undeclared (first use in this function)
    9 |                 k=0;
      |                 ^
main.c:14:30: error: expected ';' before numeric constant
   14 |                         break 0;
      |                              ^~
      |                              ;
main.c:31:27: error: expected expression before '[' token
   31 |                         g=[e]=1;
      |                           ^
main.c:34:30: error: 'h' undeclared (first use in this function)
   34 |                         for (h=10;h<=0;h--)
      |                              ^
main.c:38:46: error: 'rina' undeclared (first use in this function)
   38 |                                         for (rina=0;rina<=4;rina++)
      |                                              ^~~~
main.c:40:49: error: 'm' undeclared (first use in this function)
   40 |                                                 m[rina]=h;
      |                                                 ^
main.c:43:33: error: 'i' undeclared (first use in this function)
   43 |                                 i=m[0]*1000+m[1]*100+m[2]*10+m[3];
      |                                 ^
main.c:45:30: error: expected expression before '{' token
   45 |                         m[4]={0};
      |                              ^
main.c:48:35: error: expected '(' before '=' token
   48 |                                 if=(g[h]==1)
      |                                   ^
      |                                   (
main.c:48:45: error: expected ';' before '{' token
   48 |                                 if=(g[h]==1)
      |                                             ^
      |                                             ;
   49 |                                 {
      |                                 ~            
main.c:56:29: error: 'j' undeclared (first use in this function)
   56 |                         b=i-j;
      |                             ^
main.c:62:1: error: expected declaration or statement at end of input
   62 | }
      | ^