# Better way to read multiple int in C than scanf

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?

Thanks a lot.

EDIT: some users have reported that my question is similar to Tips for golfing in C

While this topic contain a lot of useful informations 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.

EDIT2: I'm looking for a full program (so no function trick) and all librairies 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 is welcome, as long as it shorten the code (this is code golf :) ) and as long as it isn't c++

• Usually you can submit a function instead of full programs which allows you to take those 4 ints as arguments. – Denker May 15 '16 at 10:55
• I see, thanks for your comment, but in my case, it needs to be a full program. – BusyBeingDelicious May 15 '16 at 10:57
• 1) @BusyBeingDelicious, welcome to PPCG! :) 2) To the close voters, this is not a general programming question. This is a tips question which asks for help golfing code which is absolutely on topic. – Martin Ender May 15 '16 at 11:49
• Possible duplicate of Tips for golfing in C – user45941 May 15 '16 at 19:14
• Dear close-voters: This is very clearly on topic. Why are you still trying to get this closed? – DJMcMayhem May 24 '16 at 3:38

You can write a function instead of a program as your submission. In C you can omit int from function signatures:
f(w,x,y,z){}