fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int x,b0,b1,b2,sum;
  6. scanf("%d",&x);
  7. b0=x%10;
  8. b2=x/100;
  9. b1=(x-b2*100)/10;
  10. printf("b0=%d\nb2=%d\nb1=%d",b0,b2,b1);
  11. sum=b0+b1+b2;
  12. printf("sum=%d\n",sum);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5320KB
stdin
458
stdout
b0=8
b2=4
b1=5sum=17