只用C来写
题目:https://vjudge.net/problem/UVA-1588
1 #include<stdio.h> 2 #include<string.h> 3 #define LEN 1000 4 5 int l(int lenth1,int lenth2,int keep) 6 { 7 int lenth; 8 int m=lenth1-lenth2; 9 if(keep<=m)lenth=lenth1; 10 else lenth=keep+lenth2; 11 return lenth; 12 } 13 14 int lp(int lenth1,int lenth2,int keep) 15 { 16 return (lenth2-keep-1+lenth1); 17 } 18 int main() 19 { 20 char down[LEN]={'0'}; 21 char up[LEN]={'0'}; 22 while(scanf("%s",down)!=EOF) 23 { 24 25 int lenth1,lenth2,i; 26 int check=0,keep,LONG1,LONG2; 27 int LONG; 28 char* temp; 29 scanf("%s",up); 30 lenth1=strlen(down); 31 lenth2=strlen(up); 32 if(lenth1<lenth2) 33 { 34 char u[LEN]; 35 int mid; 36 strcpy(u,down); 37 for(i=0;i<LEN;i++)down[i]='