pages:
  • 1
Daneshvar Amrollahi SAYS

Hi. How exactly we should read the inputs? My lang is C++. Can you write the while part for me? I don't want the algorithm. Just the line which reads the inputs.

Danial SAYS

The input should be until EOF: Here is sample of EOF
while(cin>>n){}
or
while(scanf("%d",&n) != EOF){}
These two ways help you to get input until EOF
There are other way that you can put cin or scanf in while exept those are wrote above you can serach and find

Daneshvar Amrollahi SAYS

Thanks for your answer. I got accepted verdict for this problem.