• 2021-04-14
    有以下程序 main() { char str[]="xyz",*ps=str; while(*ps) ps++; for(ps--;ps-str>=0;ps--) puts(ps);} 执行后输出结果是
  • z
    <回车> yz
    <回车> xyz

    内容

    • 0

      以下不能将键盘输入的字符串:This is a string 读入到str中的程序段是______。 A: char str[80]; scanf("%s",str) ; B: char str[80]; int i=0; while((str[i++]=getchar())!='\n'); str[i]=0; C: char str[80]; gets(str); D: char str[80], *ps=str; do{ scanf("%c",ps); } while(*ps++ !='\n'); *(ps)=0;

    • 1

      假设chars&#91;20&#93;,*ps;ps=s;则以下输出错误的是? A: puts(*ps) B: puts(s) C: puts(ps) D: printf("%s",ps);

    • 2

      下面哪个选项不能将"hello"字符串存入字符数组str中( )。 A: char str[]="hello" ; B: char str[30]; strcpy(str, "hello"); C: char str[30];str="hello"; D: char str[30],*ps=str; strcpy(ps,"hello");

    • 3

      有下列程序:main(){chars[]={"aeiou"},*ps;ps=s;printf("%c\n",*ps+4);}程序运行后的输出结果是()。

    • 4

      以下能显示系统中正在执行的全部进程的命令是 A: ps -x B: ps -A C: ps -a D: ps -U