更多"下列程序的功能是将字符串s中所有的字符c删除。请填空。 #inc"的相关试题:
[填空题]下列程序的功能是将字符串s中所有的字符c删除。请填空。
#include <stdio.h>
main( )
{ char s[80];
int i,j;
gets(s);
for(i=j=0;s[i] !=’/0’;i++)
if(s[i]!=’c’)______;
s[j]=’/O’;
puts(s);
}
[填空题]下列程序的功能是将字符串s中所有的字符c删除。请填空。
#include<stdio.h>
main( )
char s[80];
int i,j;
gets(s);
for(i=j=0;s[i] !=’/0’;i++)
if(s[i] !=’c’)______;
s[j]=’/0’;
puts(s);
[填空题]下面程序的功能是将字符串s中所有的字符a删除。请填空。
#include<stdio.h>
void main( )
{char s[80];
int i,j=0;
gets(s);
for(i=0;s[i]!=’/0’;i++)
if(s[i]!=’a’)______;
s[j]=’/0’;
puts(s);}
[填空题]以下程序的功能是将字符串s中所有小写字母’a’删去,请填空。
#include<stdio.h>
main( )
char s[]="absuWWUDJFKFLaaakdK";
int i,j;
for(i=j=0;s[i]!=’/0’;i++)
if( )
s[j++]=s[i];
s[j]=’/0’;
printf("%s",s);
[填空题]以下程序能将字符串Program!反向打印出来,请填空。
#include<stdio.h>
void out(char *str)
{char *s=______;/*第一空*/
if(*s==NULL)return:
while(______)s++;/*第二空*/
s--;
printf("%c/n",*s);
______=NULL;/*第三空*/
out(str);
}
main( )
{char c[]="Program!";
out(c);}
[填空题]下面程序的功能是将字符串a下标值为偶数的元素由小到大排序,其他元素不变,请填空。
#include<stdio.h>
main( )
char a[]="labchmfye",t;
int i,j;
for(i=0;i<7;i+=2)
for(j=i+2;j<9; 【15】 )
if( 【16】 )
t=a[i]; a[i]=a[j]; a[j]=t;j++;
puts(a);
printf("/n");
[填空题]下面程序的功能是将字符串s中所有的字符c删除,补足所缺语句。
#include<stdio.h>
main( )
char s[80];
int i,j;
gets(s);
for(i=j=0;s[i]!=’/0’;i++)
if(s[i]!=’c’) 【10】 ;
s[j]=’/0’;
puts(s);
[填空题]下面程序的功能是:计算1~20之间的奇数之和与偶数之和,请填空使程序功能完整。
#include<stdio.h>
main( )
int a=0,b=0,c=0,i;
for(i=0;i<=20;i+=2)
a+=i;
______;
c+=b;
printf("偶数之和=%d/n",a);
printf("奇数之和=%d/n",c-21);
[填空题]下面的程序功能是完成工资查询,请填空:
SET TALK OFF
USE employee
ACCEPT”请输入职工号”T0 NUM
LOCATE FOF职工号=hum
IF [15]
DISPLAY姓名,工资
ELSE
”职工号输入错误!”
ENDIF
USE
SET TALK 0FF