Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Try to read an integer with a length of 16, and use the switch statement to calculate the number of occurrences of each word in the ten numbers 0-9.
Try to read an integer with a length of 16, and use the switch statement to calculate the number of occurrences of each word in the ten numbers 0-9.
# include & ltstdio.h & gt

main(){

int a[ 10],I;

Long x;

scanf("%ld ",& ampx);

for(I = 0; I < = 9; i++)a[I]= 0;

while(x)

{

a[x % 10]++;

x/= 10;

}

for(I = 0; I < = 9; i++) printf("%d:%d\n ",I,a[I]);

}

Debugging passed, running normally.