Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language program is the sum of arbitrary 3 digits and several hundred digits.
C language program is the sum of arbitrary 3 digits and several hundred digits.
# include & ltstudio.h & gt

# include & ltmath.h & gt

void main()

{

Unsigned int a, bai, shi, ge, sum// define unsigned shaping, where a is the data to be processed, bai is 100 bit, shi is 10 bit, ge is one bit, and sum is the sum of all bits.

scanf("d% ",& ampa); //input data a

White = a/100; //plastic division, the result is rounded and the hundreds are separated.

History = (a/10)%10; //Divide the two bits consisting of hundreds and bits by 10, and divide them into ten bits.

ge = a % 10; //Divide directly by 10 to separate bits.

Sum = white+stone+kudzu; //Add these three bits to get the desired result.

printf("d% ",sum); //output results

}