Search found 3 matches

by dream
Sun Feb 20, 2011 9:42 pm
Forum: Volume 103 (10300-10399)
Topic: 10300 - Ecological Premium
Replies: 22
Views: 13591

10300 ecological premium

i can't find where is the problem . :(
plz help me.
here is my code:



#include<stdio.h>
int main()
{
unsigned long int size,animal,env,total,n,f;
scanf("%li",&n);
for(int i=1;i<=n;i++)
{
while(scanf("%li",&f)!=EOF)
{total=0;
for(int j=1;j<=f;j++)
{
scanf("%li%li%li",&size,&animal,&env ...
by dream
Sun Feb 20, 2011 9:20 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 65009

488 WA WA WA.. :(

can anybody help me ??
where is the problem ??
i got wrong answer :( :(
#include<stdio.h>
int main()
{
int wave,amp,n;
scanf("%d",&n);
for(int b=1;b<=n;b++)
{
scanf("%d%d",&amp,&wave);
for(int a=1;a<=wave;a++)
{
for(int i=1;i<=amp;i++)
{
for(int k=1;k<=i;k++)
{
printf("%d",i ...
by dream
Sun Feb 20, 2011 9:13 pm
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 42314

136 ugly numbers run time error

#include<stdio.h>
int main()
{
unsigned long int a,b,flag,loop=6;
for(a=7;;a++)
{
if((a%2==0)||(a%3==0)||(a%5==0))
{
flag=0;
for(b=6;b<a;b++)
{
if((b%2!=0)&&(b%3!=0)&&(b%5!=0))
{
if(a%b==0)
{
flag=1;
break;
}
else
flag=2;
}
}
if(flag==2)
loop=loop+1;
}
if(loop==1500 ...

Go to advanced search