当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

(12 ) 有以下程序#include <stdio.h>#include <string.h>void fun (char *str ){


(12 ) 有以下程序

#include <stdio.h>

#include <string.h>

void fun (char *str )

{ char temp;int n,i;

n=strlen (str ) ;

temp=str[n-1];

for (i=n-1;i>0;i-- ) str[i]=str[i-1];

str[0]=temp;

}

main ()

{ char s[50];

scanf (" %s " ,s ) ; fun (s ) ; printf (" %s " ,s ) ;}

程序运行后输入: abcdef< 回车 > ,则输出结果是 【 12 】 。

参考答案
您可能感兴趣的试题
  • (37 )有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;struct A{ int a; char b[1

  • (12 ) 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;void fun (char *str ){

  • (37 )有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;struct A{ int a; char b[1

  • (12)有以下程序,请在 【12】 处填写正确语句,使程序可正常编译运行。#include &lt;stdio.h&gt;【12】

  • 试题12有以下程序#include &lt;stdio.h&gt;main(){ int c[3]={0}, k, i;while((k=getchar())!=’" />

  • 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;main(){ printf("%d ",strlen (