Please check code for Mixtures problem on SPOJ

Code: https://ide.codingblocks.com/s/448127
Problem: https://www.spoj.com/problems/MIXTURES/

hello @sahilkhan2312000131

check now->

Is there any other way to write while((scanf("%d",&n))!=EOF) or any other way to take input for such questions??

u can use cin>>n in place of (scanf("%d",&n))!=EOF

Is there no major difference between them?

scanf is bit faster than cin.

read about fast io for better clarity.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.