Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Define a plastic array, input 10 four digits, output the sum of all digits plus ten digits equal to the sum of hundreds and thousands, and write a program (C language).
Define a plastic array, input 10 four digits, output the sum of all digits plus ten digits equal to the sum of hundreds and thousands, and write a program (C language).
# include & ltstdio.h & gt

int main()

{

int a[ 10],I,x,y,z,w;

for(I = 0; I< 10; i++)

{

scanf("%d ",& ampa[I]);

}

for(I = 0; I< 10; i++)

{

x = a[I]/ 1000;

y = a[I]% 1000/ 100;

z = a[I]% 1000% 100/ 10;

w = a[I]% 10;

if((x+y)==(z+w))

printf("%d ",a[I]);

}

Returns 0;

}