tag:blogger.com,1999:blog-32637828.post2270687069996034010..comments2023-10-31T16:37:25.528+00:00Comments on fahd.blog: The Next PalindromeFahd Shariffhttp://www.blogger.com/profile/00919911016127601294noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-32637828.post-54073225728565464052012-11-11T10:22:18.827+00:002012-11-11T10:22:18.827+00:00I am getting the WRONG ANSWER can you tell me the ...I am getting the WRONG ANSWER can you tell me the reason???<br />#include<br />#include<br /><br />int main()<br />{<br /> int t,count;<br /> scanf("%d\n",&t);<br /> for(count=0;count(number[i]-'0'))<br /> {<br /> check=1;<br /> }<br /> else if((num[i]-'0')<(number[i]-'0'))<br /> {<br /> check=0;<br /> break;<br /> }<br /> else<br /> {<br /> check=0;<br /> }<br /> }<br /> if(check==0)<br /> {<br /> for(i=z-1;i>=0;i--)<br /> {<br /> if(num[i]=='9')<br /> {<br /> num[i]='0';<br /> }<br /> else<br /> {<br /> num[i]++;<br /> num[length-1-i]=num[i];<br /> break;<br /> }<br /> }<br /> }<br /> for(i=0;i<length;i++)<br /> printf("%c",num[i]);<br /> printf("\n");<br /> }<br /> }<br /> return 0;<br />}Anonymoushttps://www.blogger.com/profile/13424027759948086778noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-51670849278823124632011-10-13T19:59:39.142+01:002011-10-13T19:59:39.142+01:00Thank you for explaining the algorithm ..
it is us...Thank you for explaining the algorithm ..<br />it is useful for me unlike to the coding as i use C++ ..<br />this is my profile :<br />www.spoj.pl/users/aliarous<br />hope when you see my comment to see this problem done in my done problem list ..Alihttps://www.blogger.com/profile/00427953887249475904noreply@blogger.com