fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int sum(int x, int y, int z) {
  6. char c = 4;
  7. int *a;
  8.  
  9. return (c + x + y + z + *a) / 3;
  10. }
  11.  
  12. int main(int argc, char *argv[]) {
  13. int i, j, k;
  14. int result;
  15.  
  16. if (argc == 1) {
  17. printf("Please specify three numbers as parameters.\n");
  18. exit(1);
  19. }
  20.  
  21. i = atoi(argv[1]);
  22. j = atoi(argv[2]);
  23. k = atoi(argv[3]);
  24.  
  25. result = sum(i,j,44) + sum(j,k,55) + sum(i,k,66);
  26.  
  27. printf("%d\n", result);
  28.  
  29. return 0;
  30. }
  31.  
  32.  
  33.  
Runtime error #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Please specify three numbers as parameters.