#help with a Contest Problem

1 messages · Page 1 of 1 (latest)

nocturne zephyrBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

fleet sand
nocturne zephyrBOT
#

@fleet sand

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

plain summit
#

I mean, we're not doing your homework for you

fleet sand
#

hahaha I posted on the wrong forum, I was trying to figure it out

#

this is what I have doned so far

plain summit
#

!sc

nocturne zephyrBOT
# plain summit !sc
Monke
Please Do Not Send Screenshots!

They're hard to read and prevent copying and pasting.

fleet sand
#

hmmm

#

sorry bout that

#

send the code them ?

plain summit
#

If you want to share code via Discord you can put it inbetween 3 backticks like this:

```c
YOUR CODE
int main()
```

#

To produce an output like this:

YOUR CODE
int main() 
fleet sand
#

ok, lemme try
test

plain summit
#

backticks

#

not single quotes

#

If you know French I mean the accent grave

fleet sand
#

uuu nice, im sending now

#
 #include <iostream>
using namespace std;

int main()
{
    int N;
    cin >> N; 
    int A;
    cin >> A;
    int resto;

    if (N > 500)
    {
        resto = N % 500;
    } else {
        resto = N;
    } 

    if (A != 0 && A >= resto)
    {
        if (A >= resto)
        {
            cout << "yes" << endl;
            return 0;
        } else {
            cout << "no" << endl;
            return 0;
        }
    } else{
        cout << "no" << endl;
        return 0;
    }
}

#

resto is the same as rest

plain summit
#

A) You need to do

```c

at the beginning, not just

```

#

B) This is C++ and should therefore go in #1013107104678162544. Also when you do post C++ code you need to do

```cpp

instead

fleet sand
#

yeah, i saw this mistake when I created the question

#

anyway, tks a lot for the help, new with this discord stuff

plain summit
#

np

nocturne zephyrBOT
#

@fleet sand Has your question been resolved? If so, run !solved :)

fleet sand
#

!solved