Search found 3 matches

by keya
Thu Jun 12, 2003 9:59 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 50755

WA. What's wrong with my code? :(

[cpp]#include<stdio.h>
#include<string.h>
#define N 1000

char str1[N], str2[N];
long long i,j,len1,len2,no;

void main(void)
{
while(scanf("%s%s",&str1[0],&str2[0])==2)
{
len1 = strlen(str1);
len2 = strlen(str2);
i = j = no = 0;
if(len2<len1)
no = 1;
else ...
by keya
Thu Jun 12, 2003 9:49 pm
Forum: Volume 2 (200-299)
Topic: 260 - Il Gioco dell'X
Replies: 19
Views: 9208

260 - Il Gioco dell'X

Why WA? :(

[cpp]#include<stdio.h>
#define N 201

long long n, i, j, k, w, count=0;
char str[N][N];

void main(void)
{
while(scanf("%lld",&n)&&n)
{
for(i=0;i<n;i++)
scanf("%s",&str [0]);
for(w=k=i=0;i<n;i++)
{
if(str [0]=='w')
{
for(j=i,k=0;;)
{
if(str[j][k+1]=='w')
k++;
else if(str[j ...
by keya
Thu Jun 12, 2003 9:42 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 58039

Why does this code produce WA??? :(

[cpp]#include<stdio.h>
#include<string.h>
#define MAX 10000

char str[MAX];

int isPalindrome(char *a)
{
int i,flag=1,len=strlen(a);
for(i=0;i<len/2;i++)
if(a !=a[len-1-i])
{
flag = 0;
break;
}
return flag;
}

int checkRev(char a, char b)
{
int i;
char ...

Go to advanced search