求以下代码的输出结果
chara[20]="cehiknqtw";char*s="fbla",*p;inti,j;for(p=s;*p;p++){j=0;while(*p>=a[j]&&a[j...
char a[20]="cehiknqtw";
char *s="fbla",*p;
int i,j;
for(p=s;*p; p++){
j=0;
while( *p>=a[j] && a[j] !='\0') j++;
for(i=strlen(a); i>=j; i- - > a[i+1] = a[ i ];
a [j ]= *p;
}
printf( "%s" ,a ); 展开
char *s="fbla",*p;
int i,j;
for(p=s;*p; p++){
j=0;
while( *p>=a[j] && a[j] !='\0') j++;
for(i=strlen(a); i>=j; i- - > a[i+1] = a[ i ];
a [j ]= *p;
}
printf( "%s" ,a ); 展开
2个回答
展开全部
import java.util.Scanner;
public class you {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
for (int i = a; i <= b; i++) {
fun(i);
System.out.println("");
}
}
public static void fun(int x) {
int k = 2;
System.out.print(x + "=");
while (k <= x) {
if (x % k == 0){
System.out.print(k);
x = x / k;
if(k<=x){
System.out.print("*");
}
} else {
k++;
}
}
}
}
请采纳答案,支持我一下。
public class you {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
for (int i = a; i <= b; i++) {
fun(i);
System.out.println("");
}
}
public static void fun(int x) {
int k = 2;
System.out.print(x + "=");
while (k <= x) {
if (x % k == 0){
System.out.print(k);
x = x / k;
if(k<=x){
System.out.print("*");
}
} else {
k++;
}
}
}
}
请采纳答案,支持我一下。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询