| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
我疯了 为什么wa 忘大牛指点(附代码)#include<iostream>
using namespace std;
int main()
{
int m,n;
int i;
int k,j;
int len;
// freopen("2337.txt","r",stdin);
char teststr[1005][25];
cin>>n;
while(n--){
k = 0;
j = 0;
cin>>m;
for(i = 0; i < m; i++){
cin>>teststr[i];
}
len = strlen(teststr[0]);
while(j < m - 1){
if(teststr[j][len - 1] == teststr[j + 1][0]){
j++;
len = strlen(teststr[j]);
continue;
}
else{
k = 1;
break;
}
}
if(k == 0){
for(i = 0; i < m - 1; i++){
cout<<teststr[i]<<".";
}
cout<<teststr[m - 1]<<endl;
}
else{
cout<<"***"<<endl;
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator