Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. char s1[] = "521";
  2. char s2[] = "1624";
  3. char ris[100]; /*result should go here*/
  4. int i;
  5.  
  6. sum(s1, s2, ris);
  7.  
  8. printf("n");
  9.  
  10. for(i = 0; i < 10; i++){
  11. printf("%c", ris[i]);
  12. }
  13.  
  14. printf("n");
  15.  
  16. return EXIT_SUCCESS;
  17.  
  18. if(s1 == '' && s2 == ''){
  19. return 0;
  20. }
  21. else if (remainder == 1){
  22. ris = ris + 49;
  23. remainder = 0;
  24. return auxSum (s1, s2, *is, remainder);
  25. }
  26.  
  27. else if(s1 + s2 > 57){
  28. remainder = 1;
  29. ris = ris + (s1 + s2) - 10;
  30. return auxSum (s1, s2, ris, remainder);
  31. }else{
  32. ris = ris + s1 + s2;;
  33. remainder = 0;
  34. return auxSum (s1, s2, ris, remainder);
  35. }
  36.  
  37. int remainder = 0;
  38. auxSum(s1, s2, ris, remainder);
  39.  
  40. return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement