I'm trying to read 4 ints in C in a golfing challenge and I'm bothered by the length of the code that I need to solve it:
scanf("%d%d%d%d",&w,&x,&y,&z)
that's 29 chars, which is huge considering that my total code size is 101 chars. I can rid of the first int since I don't really need it, so I get this code:
scanf("%*d%d%d%d",&x,&y,&z)
which is 27 chars, but it's still lengthy.
So my question is, is there any other way (tricks, functions, K&R stuff) to read ints that I don't know of that could help me reduce this bit of code?
Some users have reported that my question is similar to Tips for golfing in C
While this topic contain a lot of useful information to shorten C codes, it isn't relevant to my actual use case since it doesn't provide a better way to read inputs.
I don't know if there is actually a better way than scanf to read multiple integers (that's why I'm asking the question in the first place), but if there is, I think my question is relevant and is sufficiently different than global tips and tricks.
If there is no better way, my question can still be useful in the near future if someone find a better solution.
I'm looking for a full program (so no function trick) and all libraries possible. It needs to be C, not C++. Currently, my whole program looks like this:
main(w,x,y,z){scanf("%*d%d%d%d",&x,&y,&z)}
Any tricks are welcome, as long as they shorten the code (this is code golf) and work in C rather than C++.