Search found 2 matches
- Wed Oct 14, 2009 8:24 am
- Forum: Volume 108 (10800-10899)
- Topic: 10852 - Less Prime
- Replies: 24
- Views: 18513
Re: caution: 10852 - Less Prime
input and output is correct bt why wrong answer??
#include<stdio.h>
int main()
{
int i,b,flag,a,c,test,g,p;
scanf("%d",&test);
while(test--)
{
scanf("%d",&c);
a=2;
g=0;
p=(c/2)+1;
for(b=p;b<=c;b++)
{
flag=0;
for(i=2;i<=(b/2);i++)
if((b%i)==0)
{
flag=1;
break;
}
if(flag ...
- Tue Sep 01, 2009 12:44 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10945 - Mother bear
- Replies: 65
- Views: 29250
mother bear
i cannot finding the solution for a long long time .I am getting wrong answer for many times.
here is my code any body help me..
# include <stdio.h>
# include<string.h>
# include<ctype.h>
int a,b,i,j,flag,len,k;
char ch[100],kh[100];
int main()
{
int p;
while(gets(ch)!=NULL)
{
if ...
here is my code any body help me..
# include <stdio.h>
# include<string.h>
# include<ctype.h>
int a,b,i,j,flag,len,k;
char ch[100],kh[100];
int main()
{
int p;
while(gets(ch)!=NULL)
{
if ...