C语言将字符串中的值按ASCII码大小排序后从小到大输出,为什么我写的程序没有运行结果? #include<stdio.h> #include<string.h> int main() { char s[1000]={ 634,.%@\\w|SQ2 },c; int i,j=0,n=strlen(s),k; for(i=0;i<n-1;i++) { for (j=i+1;j<n;j++) { if(s[i]>s[
//函数fun功能:读入一个字符串,将该字符串中的所有字符按ASCII码值升序排序后输出。 1#include <string.h>2#include <stdio.h>3voidfun(chart[])4{5charc;6inti,j;7/***found***/8for(i=strlen(t)-1;i;i--)指向最后一个元素9for(j=0;jt[j+1])12{13c=t[j];14t[j]=t[j+1];15t[...
代码:include <stdio.h>void fun(char s[100]){char str[100],t;int i,j=0,n;for(i=0;s[i];i++){if(i%2==1){str[j]=s[i];j++;}}str[j]='\0';printf("排序前:%s\n",str); n=j;for(i=0;i<n-1;i++){ for(j=i+1;j<n;j++){if(str[i]>str[j])...