Hi,

There are a lot of ways to do it. You can read/write files directly from
your code, you can use I/O redirection as was suggested before, some IDEs
will let you type or copy/paste the input into a box, or in many problems
you can conceivably copy/paste it into a terminal console.

For I/O redirection, we wrote a tutorial last year with examples in our 3
most popular languages (C++, Python and Java). You can find it at the
bottom of the quick-start guide:
https://code.google.com/codejam/resources/quickstart-guide

Best,
Pablo

On Mon, Mar 27, 2017 at 2:32 PM, Luke Pebody <[email protected]> wrote:

> Suppose the problem was: you will receive an input file starting with a
> number of cases, and then a number for each case, and you are to output in
> a sentence the square of each number.
>
> 1) Create a c file called squareNumbers.c
>
> #include <stdio.h>
>
> int main(){
>   int numCases;
>   int value;
>   int square;
>   scanf("%d", &numCases);
>
>   for (int caseIndex = 1; caseIndex <= numCases; ++caseIndex)
>     {
>       scanf("%d", &value);
>       square = value * value;
>       printf("Case #%d: The square of %d is %d.\n", caseIndex, value,
> square);
>     }
> }
>
> 2) Download the input file, given here (call it squareNumbers.in)
>
> 6
> 32
> 1
> 147
> 73
> 0
> -92
>
> 3) Compile and run your code:
>
> gcc -o squareNumbers squareNumbers.c
>
> ./squareNumbers < squareNumbers.in > squareNumbers.out
> 4) Upload your output file (which should have this content)
> Case #1: The square of 32 is 1024.
> Case #2: The square of 1 is 1.
> Case #3: The square of 147 is 21609.
> Case #4: The square of 73 is 5329.
> Case #5: The square of 0 is 0.
> Case #6: The square of -92 is 8464.
>
>
> On Mon, Mar 27, 2017 at 7:14 PM, arumugamgandhi156 <
> [email protected]> wrote:
>
>> How to save and submit the output file in c programming language
>>
>> Sent from my Superphone
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-code/ktsjcojd1gjcimaay5jt2c06.1490638468596%
>> 40email.android.com
>> <https://groups.google.com/d/msgid/google-code/ktsjcojd1gjcimaay5jt2c06.1490638468596%40email.android.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAECKw-NN-YPOvMZQo2ZhqDUeAsGsFdUj1jnBsNN
> 1xnyexH7TLA%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAECKw-NN-YPOvMZQo2ZhqDUeAsGsFdUj1jnBsNN1xnyexH7TLA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CANa5jcAapA8O%2B5qcgP78F_Td3SF8BtyMDt5qSAiZksQO3BZ9wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to