You are not logged in. Please login at www.codechef.com to post your questions!

×

WRONG ANSWER

include<stdio.h>

int main() { int a[10],i,t; int count=0; for(i=0;i<5;i++) scanf("%d",&a[i]); for(i=0;i<5;i++) { if(a[i]>=1 && a[i]<100) count++; else return 0; } if(count==5) { for(i=0;i<5;i++) { if(a[i]==42) { for(t=0;t<i;t++) printf("%d\n",a[t]); } } } else return 0; return 0; }

plz help me i am getting wrong answer on codechef compiler while i m getting correct output on my system. I m unable to fix the bug.Need help Problem:: Life and the universe

asked 09 Jul '14, 18:15

him_joshi13's gravatar image

1★him_joshi13
1
accept rate: 0%


bro you have to take input such that if it encounter 42.you have to stop taking more inputs .. and you are taking input for 5 numbers only .. otherwise you can look at my solution ..http://www.codechef.com/viewsolution/2498498

link

answered 09 Jul '14, 18:43

sanzzzay's gravatar image

2★sanzzzay
7223820
accept rate: 12%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×856

question asked: 09 Jul '14, 18:15

question was seen: 577 times

last updated: 09 Jul '14, 18:43