本文共 612 字,大约阅读时间需要 2 分钟。
/********************************* * 日期:2013-2-4 * 作者:SJF0115 * 题号: 九度OJ 题目1206:字符串连接 * 来源:http://ac.jobdu.com/problem.php?pid=1206 * 结果:AC * 来源:2010年华中科技大学计算机保研机试真题 * 总结:**********************************/ #include#include int main(){ int i,index; char string[201]; char string2[101]; //freopen("C:\\Users\\SJF\\Desktop\\acm.txt","r",stdin); while(scanf("%s %s",string,string2) != EOF){ index = strlen(string); //连接 for(i = 0;i < strlen(string2);i++){ string[index++] = string2[i]; } //输出 for(i = 0;i < index;i++){ printf("%c",string[i]); } printf("\n"); }}
转载地址:http://nedsi.baihongyu.com/