标签:分享 print log tput output while es2017 语言 char
Action() { //脚本实现的功能:在字符串中随机插入一个新字符串 char s1[20]="AAAAAAA"; char s2[20]="@"; char s3[20]; int n=4;//n从1开始取值 int i=0; int l; //scanf("%d",&n); //scanf("%s",s1); //scanf("%s",s2); int j=n-1; int m=0,k=0; lr_output_message("%s\n", s1); while(s1[j]!=‘\0‘)//改if为while { s3[m]=s1[j]; m++; j++; } s3[m] = ‘\0‘;//加入字符串结束标识 while(s2[i]!=‘\0‘)//改if为while { s1[n-1+i]=s2[i]; i++; } l=n+i-1; while(s3[k]!=‘\0‘)//改if为while { s1[l]=s3[k]; k++; l++; } s1[l] = ‘\0‘;//加入字符串结束标识 //printf("%s",s1); lr_output_message("%s\n", s1); return 0; }
标签:分享 print log tput output while es2017 语言 char
原文地址:http://www.cnblogs.com/qmfsun/p/7742500.html