磷酸盐有哪些:谁会做以下的c语言填空题

来源:百度文库 编辑:高校问答 时间:2024/04/29 11:19:40
1. 判断任意整数x是否为回文数
(回文数:顺读与反读都一样的数)提示:
(1)求出x的每一位数,放入数组各个元素中
2)数组元素首尾比较,判断是否为回文for( i=首下标,j=末下标; i<j; i++,j--)
#include <stdio.h>
#include <string.h>
main(){
int i=0,j=0;
char str[10];
printf("\n\nInput a number (length<=9) : ");
scanf( 1 );
printf("the length of the string is : %d\n", 2 );
for (i=0,j=strlen(str)-1;i<j;i++,j--){
if ( 3 )continue;
else break;
}
printf("i=%d,j=%d\n",i,j);
if ( 4 ) printf("the number is not a palindrome.");
else printf("the number is a palindrome!");
}

1
"%s",str
2
strlen(str)
3
str[i]==str[j]
4
i<j

做过忘记了