For this problem my solution give identical output to the udebug. but it get RE. though i run my code in online ide and it's fine.
what the problem. my solution below
https://paste.ubuntu.com/p/cRg43nsfKj/
Search found 96 matches: 10018
Searched query: 10018
- Mon Oct 01, 2018 11:27 am
- Forum: Bugs and suggestions
- Topic: 10018 - Reverse and Add
- Replies: 0
- Views: 10124
- Tue Mar 15, 2016 7:48 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Your program doesn't work with 4000000000
- Fri Oct 16, 2015 4:48 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Hello,
All test are OK but I still have WA !
Could you help me please ?
Here the code :
#include <stdio.h>
#include <stdlib.h>
int revNumber( long long n )
{
long long rev = 0;
while(n) {
rev = rev * 10 + (n % 10);
n /= 10;
}
return rev;
}
int main()
{
int nbCase = 0, i = 0;
int count = 0 ...
All test are OK but I still have WA !
Could you help me please ?
Here the code :
#include <stdio.h>
#include <stdlib.h>
int revNumber( long long n )
{
long long rev = 0;
while(n) {
rev = rev * 10 + (n % 10);
n /= 10;
}
return rev;
}
int main()
{
int nbCase = 0, i = 0;
int count = 0 ...
- Fri Jun 19, 2015 11:11 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
I submit the following COde several days ago .....Sample input output everything is okay. But Verdict is COMPILATION ERROR...
it would be my pleasure if anybody Help.
My Code is:
#include <stdio.h>
int main()
{
long long int n, rev,original,num,c,test_num;
int a[100];
scanf("%lld",&test_num ...
it would be my pleasure if anybody Help.
My Code is:
#include <stdio.h>
int main()
{
long long int n, rev,original,num,c,test_num;
int a[100];
scanf("%lld",&test_num ...
- Thu Jun 18, 2015 12:45 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Why is my code giving me wrong answer?
/*Problem 10018*/
#include <stdio.h>
unsigned int addReverse(unsigned int);
int palindrome(unsigned int);
int main() {
int num;
scanf("%d", &num);
unsigned int added, c;
while (num--) {
c = 0;
scanf("%d", &added);
do {
added = addReverse(added ...
/*Problem 10018*/
#include <stdio.h>
unsigned int addReverse(unsigned int);
int palindrome(unsigned int);
int main() {
int num;
scanf("%d", &num);
unsigned int added, c;
while (num--) {
c = 0;
scanf("%d", &added);
do {
added = addReverse(added ...
- Wed Jan 07, 2015 3:03 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Check My Submissions for the reason for your CE.
Write your own strrev()
Write your own strrev()
- Tue Jan 06, 2015 10:25 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Getting Compile error in ANSI C.... which can be the problem ? anyone help plzzz....
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
int itaration,test;
unsigned int number1,number2;
char num1[50],num2[50];
scanf("%d",&test);
getchar();
while(test--)
{
gets(num1);
itaration ...
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
int itaration,test;
unsigned int number1,number2;
char num1[50],num2[50];
scanf("%d",&test);
getchar();
while(test--)
{
gets(num1);
itaration ...
- Tue Jul 29, 2014 8:24 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
The first line in the problem statement:
The "reverse and add" method is simple: choose a number, reverse its digits and add it to the original. If the sum is not a palindrome (which means, it is not the same number from left to right and right to left), repeat this procedure.
You should repeat ...
The "reverse and add" method is simple: choose a number, reverse its digits and add it to the original. If the sum is not a palindrome (which means, it is not the same number from left to right and right to left), repeat this procedure.
You should repeat ...
- Mon Jul 28, 2014 9:29 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
You must check input in this thread first. (..)
This is statement is wrong.
My AC program produces:
Input
2
2
99
Output
0 2
0 99
So it seems that the statement "If n is already pallindrome, output is 0 n" (which Shahidul.CSE may have inferred from previous test cases posted in these ...
This is statement is wrong.
My AC program produces:
Input
2
2
99
Output
0 2
0 99
So it seems that the statement "If n is already pallindrome, output is 0 n" (which Shahidul.CSE may have inferred from previous test cases posted in these ...
- Mon Jul 28, 2014 5:13 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Thank you lighted and lbv.
Got accepted !

Got accepted !


- Mon Jul 28, 2014 2:20 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
You must check input in this thread first.
This is statement is wrong.
You must repeat "reverse and add" method at least once and then check if it is a palindrome.Adrian Kuegel wrote:Try this testcase:
Input:
2
2
99
Output:
1 4
6 79497
This is statement is wrong.
1)If n is already pallindrome, output is 0 n
- Mon Jul 28, 2014 2:03 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Try:Shahidul.CSE wrote:Why WA with my code?
Input
Code: Select all
1
123789
Code: Select all
2 1222221
- Mon Jul 28, 2014 11:18 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Why WA with my code?
Code: Select all
Code Removed after Accepted
- Tue Nov 26, 2013 6:25 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
thanks brianfry713
i got AC

i got AC
- Tue Nov 26, 2013 2:35 am
- Forum: Volume 100 (10000-10099)
- Topic: 10018 - Reverse and Add
- Replies: 169
- Views: 44523
Re: 10018 - Reverse and Add
Try using long long instead of long