输入两个字符串str1,str2,判断如果字符串str1大于str2 ,则互换两个字 ...答:include <stdio.h>#include <string.h>int main(){ char s1[100],s2[100], t[100]; scanf("%s%s",s1,s2); if(strcmp(s1, s2)>0) { strcpy(t,s1); strcpy(s1,s2); strcpy(s2,t); } if(strlen(s1)>strlen(s2)) { strcpy(t,s1); strcp...
用vc6.0编译程序,输入两个字符串,str1和str2,检查第一个是否包含第二...答:include <stdio.h>#include <string.h>int main(int argc,char *argv[]){ char a[300],b[80],*p; int i,k,lb; printf("Input 2 strings...\n"); scanf("%s%s",a,b); lb=strlen(b),i=k=0; while(p=strstr(a+i,b)){ k++; printf("%d ",i=p...