填空题 (修改每对/**/之间存在的错误,完成题目的要求)
填空题 以下程序以每行最多12个的方式打印10~1000之间满足正序读和反序读都相同的所有数,如55、232等。
#include<stdio.h>
int main()
{/**/ 1 int i, n/**/;
for(i=10; i<=99; i++)
if(i/10==i%10)
{
printf("%5d", i);
n++;
if(/**/ 2 n%12=0/**/)
printf("/n");
}
for(i=100; i<=999; i++)
if(/**/ 3 i/100==i/10/**/)
{
printf("%5d", i);
n++;
if(n%12==0)
printf("/n");
}
return 0;
}
填空题 以下程序中dele(char*s)函数的功能是删除字符串s中所有非字母字符,并将字符串压缩。例如原字符串为:abcl2ef5ghij8#%%yz,处理后的字符串为:abcefghijyz。
#include<stdio.h>
void dele(/**/ 1 char s /**/)
{
int i=0, t;
while(*(s+i)!="/0")
{
if(/**/ 2*(s+i)<"A"||(*(s+i)>"Z"&&*(s+i)>"a")||*(s+i)<"z"/**/)
{
t=i;
while(*(s+t)!="/0")
{
*(s+t)=*(s+t+1);
/**/ 3 i++/**/;
}
}
else i++;
}
}
int main()
{
char str1[100];
printf("Enter a string:");
gets(str1);
dele(str1);
printf("Now string is:%s/n", str1);
return 0;
}