×

# help for bugcal

 0 my code partially solved but not fully please tell on which test it went wrong I have tested 10001 90009 answer 0 mine . AND THE PASTED CODE HERE IS SHOWING SOME FOOL THINGS WHICH I DONOT HAVE IN MY CODE I PASTED IT HERE AND IT GET BAD LIKE #INCLUDE AND PLEASE UPVOTE SO I CAN ABLE TO UPLOAD CODE HERE  #include #define ll long long #define fast ios_base::sync_with_stdio(0) using namespace std; int main() { fast; ll t; cin >> t; while( t-- ) { ll num1 , num2 ; cin >> num1 >> num2 ; vector v; int sum; while( num1 != 0 || num2 != 0 ) { int r1 = num1 % 10; int r2 = num2 % 10; sum = r1+ r2; v.push_back(sum%10); num1 /= 10; num2 /= 10; } sum = 0; for( int i=0; i=0; i--) cout << v[i]; } else { cout << 0; } cout << endl; } return 0; }  asked 29 Oct '17, 00:00 2★geforce 49●6 accept rate: 0% solution link https://www.codechef.com/viewsolution/15994012 (29 Oct '17, 00:02) geforce2★

 0 Mate, Following test case fails your solution 1 55 54 Correct answer = 9 Your answer = 09 Refer https://discuss.codechef.com/questions/115538/october-lunchtime-unofficial-editorials-first-two-problems if you feel any need :) answered 29 Oct '17, 00:11 3.9k●23●87 accept rate: 22% thanks taran (29 Oct '17, 00:15) geforce2★ No problem. (29 Oct '17, 00:16)
 0 Why are you taking the sum? There is no need of it. You can just print all the digits one by one. answered 29 Oct '17, 00:12 2★ramini 61●5 accept rate: 8% for leading zeros (29 Oct '17, 00:14) geforce2★ That's where the trouble is. :D (29 Oct '17, 00:16)
 0 remove leading zeros '0' or if all value is zero the print only one zero '0' if got the same problem 2 54 54 55 55 output 8 0 my code link https://www.codechef.com/viewsolution/15987621 answered 29 Oct '17, 14:46 3★mili22 26●1 accept rate: 33%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×2,701

question asked: 29 Oct '17, 00:00

question was seen: 396 times

last updated: 29 Oct '17, 14:46