| ||||||||||
| 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 | |||||||||
请问:为什么很多题目SAMPLE都能过,但就是不AC呢?2013题SAMPLE都没问题,且数组长度也够,还是WA
请问:谁有“离奇”一点的数据啊?谢了:)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int n,i,p,q,now;
long int set=0;
char *s[15],*str,*san[15];
scanf("%ld",&n);
while (n!=0) {
now=0;set++;
for (i=0;i<n;i++) {
str=(char *)malloc(sizeof(char)*26);
scanf("%s",str);
s[i]=str;
}
p=0;q=n-1;
if (p==q) printf("%s\n",s[p]);
else{
for (i=0;i<n;i++) {
if (i%2==0) san[i/2]=s[now];
else san[n-1-(i/2)]=s[now];
now++;
}
}
printf("SET %ld\n",set);
for (i=0;i<n;i++) printf("%s\n",san[i]);
scanf("%d",&n);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator