Search found 3 matches

by tamimcsedu19
Sat Apr 20, 2013 7:21 pm
Forum: Volume 106 (10600-10699)
Topic: 10684 - The jackpot
Replies: 34
Views: 18902

Re: 10684 - The Jackpot

Why WA, where am I wrong? #include <stdio.h> #include <iostream> #include <iterator> using namespace std; int main() { int n; while(scanf("%d",&n)&&n!=0){ std::istream_iterator<int> int_it(cin),end; int sum=*int_it++; for(int i=2;i<n;++i) { sum+=*int_it++; if(sum<0) sum=0; } sum+=*int_it; if(sum>0) ...
by tamimcsedu19
Thu Mar 21, 2013 6:48 pm
Forum: Volume 100 (10000-10099)
Topic: 10018 - Reverse and Add
Replies: 169
Views: 17902

Re: 10018 - Reverse and Add

My code generates all the correct outputs,.. still getting WA. Can anyone figure out where am I wrong....

Code: Select all

Accepted
Got that.. thanks brian fry. I didnt notice my first char is a null. cmd in windows showed that as space :/
by tamimcsedu19
Fri Mar 01, 2013 6:20 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 53757

Re: 10070 - Leap Year or Not Leap Year and …

My code does provide all the sample output. but where it is wrong. code is

Code: Select all

//accepted

Go to advanced search