更多"下面的程序是将从终端读入的20个字符放入字符数组中,然后利用指针变量输"的相关试题:
[填空题]下面的程序是将从终端读入的20个字符放入字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
int i;
char s[21],*p;
for(i=0;i<20;i++)
s[i]=getehar( );
s[i]= 【6】 ;
p= 【7】 ;
while(*p) putchar( 【8】 );
[填空题]下面程序是把从终端读入的20个字符作为字符串放在字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
int i;char s[21],*p;
for(i=0;i<20;i++)
s[i]=getchar( );
s[i]= 【12】 ;
p= 【13】 ;
while(*p) putchar( 【14】 );
[填空题]下面程序是指从终端读入的20个字符放入字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
int i;char s[21],*p;
for(i=0;i<20;i++)
s[i]=getchar( );
s[i]= 【13】 ;
p= 【14】 ;
while(*p)putchar(*p++);
[填空题]下面程序把从终端读入的文本(用@作为文本结束标志)复制到一个名为bi.dat的新文件中。请填空。
#include<stdio.h>
FILE *fp;
main( )
char ch;
if((fp=fopen(______))==NULL)exit(0);
while((ch=getchar( ))!=’@’)fputc(ch,fp);______;
[填空题]下面程序把从终端读入的文本(用@作为文本结束标志)输出到一个名为bi.dat的新文件中,请填空。
#include "stdio.h"
FILE *fp;
main( )
{ char ch;
if((fp=fopen( 【16】 ))==NULL)exit(0);
while((ch=getchar( ))!=’@’)fputc(ch,fp);
fclose(fp);
}
[填空题]下面程序的功能是将一个字符串str的内容颠倒过来,请填空。
#include<string.h>
main( )
{ infi,j, [13] ;char str[]={"1234567"};
for(i=0,j=strlen(str) [14] ;i<j;i++,j--)
{k=str[i];str[i]=str[i];str[j]=k;}
printf("%s/n",str);}
[填空题]下面程序的功能是将一个字符串sfr的内容颠倒过来,请填空。
#include<string.h>
main( )
int i,j, (13) ;char str[]="1234567";
for(i=0,j=strlen(str) (14) ;i<j;i++,j--)
k=str[i];str[i]=str[j];str[j]=k;
printf("%s/n",str);
[填空题]下面程序的功能是将一个字符串str的内容倒序。请填空。
#include<string.h>
main( )
int i,j, (14) ;
char str[]="1234567";
for(i=0,j=strlen(str) (15) ;i<j;i++,j--)k=str[i];str[i]=str[j];str[j]=k;
printf("%s/n", str):
[填空题]下面程序的功能是将一个字符串str的内容颠倒过来,请填空。
main( )
int i,j, 【14】 ;char str[]="1234567");
for(i=0,j=strlen(str) 【15】 ;i<j;i++,j--)
k=str[i];str[i]=str[j];str[j]=k;
printf("%s/n",str);
[填空题]下面程序的功能是将一个字符串str的内容倒序,请填空。
#inelude <stdio.h>
#include <strins.h>
main( )
int i,j, 【15】 ;
charstr[]="1234567";
for(i=0,j=strlen(str) 【16】 ;i<j; i++,j--)
k=str[i];str[i]=str[j];str[j]=k;
printf("%s/n",str);
[填空题]下面程序把从终端读入的文本(用"@"作为文本结束的标志)复制到一个名为bi.dat的新文件中,请填空。
#include<stdio.h>
FILE *fp;
main( )
char ch;
if((fp=______)==NULL)/*第一空*/
exit(0);
while((______)!=’@’)/*第二空*/
fputc(ch,fp);
______;/*第三空*/
[填空题]下面程序的功能是将一个字符串str的内容倒序,请填空。
#inelude <stdio.h>
#include <strins.h>
main( )
int i,j, ;
charstr[]="1234567";
for(i=0,j=strlen(str) ;i<j; i++,j--)
k=str[i];str[i]=str[j];str[j]=k;
printf("%s//n",str);
[填空题]下面的程序把从终端读入的文本(用@作为文本结束标志)输出到一个名为bi.dat的新文件中,请填空。
#include <stdio.h>
#include<stdlib.h>
FILE*fp;
main( )
charch;
if((fp=fopen( 【19】 ))==NULL)exit(0);
while((ch=getchar( ))!=’@’) fputc(ch,fp);
fclose(fp);