Jump to content

Need some Code

ichihgo

This looks like homework. Don't expect us to do it for you. Try it yourself and if you have any problems, post your code and what you're having trouble with, and we'll help you out.

Link to comment
Share on other sites

Link to post
Share on other sites

This looks like homework. Don't expect us to do it for you. Try it yourself and if you have any problems, post your code and what you're having trouble with, and we'll help you out.

 

It's not it's just a student activity that I joined and they give an assigment weekly so you can practice yourself, I did tried alot and only was able to solve 2 and got other studies to do as well so I was planning to learn from those codes :D

 

mPxtlMl.jpg

VqpsQRR.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, so my assumptions are from that image.

  • Green means you solved it
  • Red means you attempted to submit/run it but failed
  • White means you haven't attempted a submit/run yet

So start with the red problems that you've attempted. Post your code for one of them and we'll help.

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, so my assumptions are from that image.

  • Green means you solved it
  • Red means you attempted to submit/run it but failed
  • White means you haven't attempted a submit/run yet

So start with the red problems that you've attempted. Post your code for one of them and we'll help.

 

those red once I tried to solve each about 8~10 times :D anyway I'll post the codes that's giving me wrong

 

The Lucky Mom ( L )

 

#include <iostream>

using namespace std;

int main()

{

int N;

cin >>N;

if (0 < N < 2000)

{

if (N % 2 == 0)

{

cout << "Unlucky" << endl;

}

else

{

cout << "lucky" << endl;

}

return 0;

}

}

 

the code do run in code blocks but in codeforces it says wrong

Link to comment
Share on other sites

Link to post
Share on other sites

those red once I tried to solve each about 8~10 times :D anyway I'll post the codes that's giving me wrong

 

The Lucky Mom ( L )

 

#include <iostream>

using namespace std;

int main()

{

int N;

cin >>N;

if (0 < N < 2000)

{

if (N % 2 == 0)

{

cout << "Unlucky" << endl;

}

else

{

cout << "lucky" << endl;

}

return 0;

}

}

 

the code do run in code blocks but in codeforces it says wrong

 

Just tried to do again and it Looks like the U instead of u in Unlucky was the wrong thing :D Gonna check out the other and post if something stand in my way

 

Edit : do you know how to approximate the out to the first 3 decimals !?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×