Maybe this can help you....

int main()
{
        FILE *fp=fopen("A-small-practice.in", "r"), 
*ofp=fopen("respuestaS.out", "w");
        //FILE *fp=fopen("A-large-practice.in", "r"),
*ofp=fopen("respuestaL.out", "w");

        int T;
        string str;
        fscanf(fp, "%d", &T);
        
        for(int tc=1;tc<=T;tc++)
        {
                fscanf(fp, "%s", &str);
                
                //your code ....
                int ans; // your answer
                
                // print cases
                fprintf(ofp, "Case #%d: %d\n", tc, ans);
        }
        return 0;
}

2012/4/12 K21G <[email protected]>:
> anybody please help me in file input in c++.....i had tried a lot of
> code but still unable to input correctly...
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Code Jam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to