Search found 2 matches

by scorpio
Wed Jul 02, 2008 1:30 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 83831

Re: 10070 - Leap Year or Not Leap Year and …

its an easy prob. 8) but i keep getting WA :oops: in it.here is my code:

#include<stdio.h>
int main()
{
char a[100001];
int b,c,d,e,f,x,i,y,p,q;
while(gets(a))
{
b=c=d=e=f=p=q=x=0;
for(i=0;a[i];i++)
{
b=(b*10+a[i]-48)%4;
c=(c*10+a[i]-48)%100;
d=(d*10+a[i]-48)%400;
e=(e*10+a[i]-48)%15 ...
by scorpio
Fri Jun 06, 2008 12:05 pm
Forum: Volume 2 (200-299)
Topic: 299 - Train Swapping
Replies: 81
Views: 24014

299-WA!!!

i cant find out any mistake in my code..
here is the code...

#include<stdio.h>
int main()
{
int a[1000],i,p,flag,c,n,b=0,count,t;
scanf("%d",&c);
while(scanf("%d",&n)==1)
{
for(i=0;i<n;i++)
scanf("%d",&a );
count=0;
for(i=1;i<n;i++)
{
flag=0;
p=0;
while(p<n-i)
{
if(a[p]>a[p+1])
{
t ...

Go to advanced search