实验二part3.1

#include<stdio.h>
int main()
{
 int x;
 printf("请输入一个三位数以内的十进制数:");
 scanf("%d",&x);
 printf("正在计算其逆序....\n");
 if (x>=0&&x<10)
   printf("%d的正序与逆序相同",x);
    else if (x>=10&&x<100){
     if(x/10==x%10)
          printf("%d的正序与逆序相同",x);
     else
         printf("%d的正序与逆序不同",x);
}
 else if(x>=100){
  if(x/100==x%10)
      printf("%d的正序与逆序相同",x);
  else
      printf("%d的正序与逆序不同",x);
}
 return 0;
}

猜你喜欢

转载自www.cnblogs.com/love-elaine/p/11770319.html
3.1
今日推荐