Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc, const char *const *const argv)
- {
- if (argc == 2)
- {
- const char *p = strchr(argv[1], '/');
- if (p)
- {
- int num = atoi(argv[1]), denom = atoi(p+1);
- if (denom)
- {
- printf("%f\n", (double)num/(double)denom);
- }
- }
- }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement