current position:Home>The so-called palindrome number is the same number from left to right and from right to left. For example, 121 is a palindrome number. Write a program to find the number of palindromes that can be divided by 3 in the range of 100-m. (can anyone see where

The so-called palindrome number is the same number from left to right and from right to left. For example, 121 is a palindrome number. Write a program to find the number of palindromes that can be divided by 3 in the range of 100-m. (can anyone see where

2022-02-02 20:54:52 CSDN Q & A

#include <stdio.h>

int main()
{
int a,c,m,i,n;
scanf("%d",&m);
if(m>=100&&m<=1000)
for(i=100;i<=m;i++)
{
a=i/100;
c=i%10;
if(a=c)
{
if(i%3==0)
n++;
}
}
printf(" Palindromes equals :%d",n);

return 0;

}




Refer to the answer 1:

if(a=c)
Change it to
if(a==c)




Refer to the answer 2:



Refer to the answer 3:

if There should be two ==




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022054488649.html

Random recommended