问题详情

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

(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 】 。

参考答案
您可能感兴趣的试题