⑴ c语言如何求回文数
1、首先打开vc6.0,新建一个控制台项目。

⑵ C语言编程回文数
main()
{
int x,n,i,j,a[20],c;
long sum;
scanf("%d",&n);
for (x=1;x<=n;x++)
 { sum=x*x;
    for(i=1;i<20;i++)
      a[i]=0;
    for (i=1;i<20;i++)
      {a[i]=sum%10;
  sum=sum/10;
   if (sum==0) break;
      }
     if (i%2==0) {c=0; for (j=1;j<=i/2;j++) {if(a[j]!=a[i+1-j]) c=1;}
       if (c==0){printf("%d %d\n",x,x*x);}}
     else {c=0; for (j=1;j<=(i-1)/2;j++) {if (a[j]!=a[i+1-j]) c=1;}
       if (c==0){printf("%d %d\n",x,x*x);}}
  }
}
⑶ C语言“回文”程序代码
首先我对你的 "并且当输入的字符串第一个字符为#时,输入为空时,不输出。" 这句话比较费解, 不明白你的意思!
你把这说清楚了我再补充回答你~
我写了个参考代码给你参考, 首先是输入你要判断的字符串的个数, 然后再依次输入所有的字符串, 最后判断输入的所有字符串是否是"回文"! 因为不理解你那句话, 所以暂时没做什么空和什么"#"处理.
详细c代码:
#include <stdio.h>
#include <string.h>
#define STR_LEN 128
#define STR_NUM 64
int main()
{
    int i = 0, j = 0, n = 0;
 int len = 0;
 char *start = NULL;
 char *end = NULL;
 char str[STR_NUM][STR_LEN] = {0};
 printf("Please input the number of string: \n");
 scanf("%d", &n);
 printf("Please input all the string: \n");
 for (i = 0; i < n; i++)
 {
  scanf("%s", str[i]);
 }
 for (j = 0; j < n; j++)
 {
  start = str[j];
  len = strlen(str[j]);
  end = str[j] + len - 1;
  while (start - end <= 0)
  {
   if (*start++ != *end--)
   {
    break;
   }
  }
  if (start > end)
  {
   printf("yes\n");
  }
  else
  {
   printf("no\n");
  }
 }
    return 0;
} 
例子,运行后:
Please input the number of string:
4
Please input all the string:
aba
112ds
madam
xyzyx
yes
no
yes
yes
Press any key to continue 
补充回答:
大概明白你的意思,我会把例子贴上, 若不符合你的要求我再帮修改!
详细代码如下:
#include <stdio.h>
#include <string.h>
#define STR_LEN 128
#define STR_NUM 64
int main()
{
    int i = 0;
 int len = 0;
 int str_count = 0;
 char *start = NULL;
 char *end = NULL;
 char str[STR_NUM][STR_LEN] = {0};
 printf("Please input all the string: \n");
 while (1)
 {
  scanf("%s", str[str_count]);
  if (str[str_count][0] == '#')
  {
   break;
  }
  else
  {
   str_count++;
   continue;
  }
 }
 for (i = 0; i < str_count; i++)
 {
  start = str[i];
  len = strlen(str[i]);
  end = str[i] + len - 1;
  while (start - end <= 0)
  {
   if (*start++ != *end--)
   {
    break;
   }
  }
  if (start > end)
  {
   printf("yes\n");
  }
  else
  {
   printf("no\n");
  }
 }
    return 0;
} 
运行实例1:
Please input all the string:
xyzyx
adghf
#
yes
no
Press any key to continue
运行实例2:
Please input all the string:
1232ss
sakljfkla
333dafs
aba
ee3
xyzyx
dfj222
madam
111$111
slsl33
#
no
no
no
yes
no
yes
no
yes
yes
no
Press any key to continue
⑷ c语言中求1000以内的回文数的程序
#include<stdio.h>  
int main()  
{   
int i,n,m,count=0; 
 printf("所有的回文数字如下:\n");   
for(i=1;i<=1000;i++) 
 { 
 n=i; 
 m=0; 
 while(n) 
 { 
  
m=m*10+n%10;
  n/=10; 
 }
 if(m==i) 
 { 
  
printf("%d ",m); 
  count++; 
 } 
 } 
 printf("\n共%d个\n",count); 
getchar();  
return 0;  
}
⑸ 用c语言写回文数,怎么写啊/急求!!
/编写一个回文数的程序c语言编程
#include <stdio.h>
void main()
{
 int n, m=0, count=0;
        printf("请输入一个数:\n");
        scanf("%d", &n);
 for(n=1; n<=10000; n++)
 {
  while(n>0)
  {
   m=m*10+n%10;
   n=n/10; 
  }
  if(m==n)
  {
   count++;
          printf("%3d", n);
                }
                if(count%5==0)
                        printf("\n");                  
 }
}
我写的是找出1到10000的回文数,不过是在没有vc++坏境下写的,代码还美调试,自己运行一下看看。
