fork download
  1. #include <stdio.h>
  2.  
  3. int sum(int n){
  4. int m=0,l;
  5. l=n;
  6. for(int i=0;i<n;i++){
  7. m+=l;
  8. l=l*10+l;
  9. }
  10. return m;
  11. }
  12. int main(void) {
  13. printf("%d\n",sum(3));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
399