Search found 4 matches

by Bitta
Tue Mar 17, 2009 7:46 pm
Forum: Volume 110 (11000-11099)
Topic: 11086 - Composite Prime
Replies: 33
Views: 17561

Re: 11086 - Composite Prime

I am getting TLE.plzz help me... #include<stdio.h> #define MAX 1048580 bool isnp[MAX+3],cp[MAX+3]; int main() { long int i,j,p,n,c,flag,b,x; isnp[1]=isnp[0]=true; for(i=2;i*i<=MAX;i++) { if(!isnp[i]) { for(j=i*i;j<=MAX;j+=i) isnp[j]=true; } } while(scanf("%ld",&n)==1) { x=0; for(i=0;i<n;i++) { scanf...
by Bitta
Tue Nov 18, 2008 3:22 pm
Forum: Volume 115 (11500-11599)
Topic: 11530 - SMS Typing
Replies: 41
Views: 8357

Re: WA: 11530: SMS Typing

I am getting WA.Plz help me... #include<stdio.h> int main() { char s[103]; int i,cnt,tc,n; scanf("%d",&tc); n=1; while(tc>0) { fflush(stdin); gets(s); cnt=0; for(i=0;s[i];i++) { if(s[i]=='a' || s[i]=='d' || s[i]=='g' || s[i]=='j' || s[i]=='m' || s[i]=='p' || s[i]=='t' || s[i]=='w' || s[i]==' ') { cn...
by Bitta
Fri Jul 25, 2008 12:37 am
Forum: Volume 3 (300-399)
Topic: 389 - Basically Speaking
Replies: 94
Views: 22194

Re: 389 WA why?

i am getting runtime error in 389-Basically speaking.please help me... :cry: here is my code- #include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> char num[1000]; char d[1000]; char ans[1000]; long int convert_decimal(char *s,int base) { long int i,j,sum; j=strlen(s)-1; sum=0; fo...
by Bitta
Sat Feb 09, 2008 12:48 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 52870

I am getting WA.Pls help!!!Here is my code... #include<stdio.h> #include<string.h> #define max 10000 int main (void) { char a[max]; int i,sum1,sum2,p,q,r,s,e,f,g; while(scanf("%s",&a)==1) { p=strlen(a)-1; sum1=0; sum2=0; q=0; r=0; s=0; e=0; f=0; g=0; for(i=0;i<=p;i+=2) { sum1+=(a[i]-'0'); } for(i=1;...

Go to advanced search