## Search found 4 matches

Tue Sep 12, 2006 1:38 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 185213

### 100 why WA

#include<stdio.h> int main() { unsigned long int n,i,count=0,j,k,max=0; int sum=0,h[100],d=0,large=0,a[100]; while (scanf("%lu%lu",&n,&k)==2) { if(n<=k) { for(j=n;j<=k;j++) { i=j; do { if(i%2!=0) i=3*i+1; else i=i/2; count++; }while(i!=1); if(large<count) large=count; count=0; } } else if(n>k) { for...
Tue Sep 12, 2006 12:47 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 28875

### 371 why wa

#include<stdio.h> int main() { unsigned long int n,i,count=0,j,k,large=0,w; do { scanf("%lu %lu",&n,&k); if(n==0&&k==0) exit(1); for(j=n;j<=k;j++) { i=j; do { if(i%2!=0) i=3*i+1; else i=i/2; count++; }while(i!=1); if(large<count){ w=j; large=count; } count=0; } printf("Between %lu and %lu, %lu gener...
Thu Aug 24, 2006 6:12 am
Forum: Volume 100 (10000-10099)
Topic: 10082 - WERTYU
Replies: 57
Views: 7021
Thank You sanjana.You are very smart.
I got AC at all.
Mon Aug 21, 2006 3:38 pm
Forum: Volume 103 (10300-10399)
Topic: 10370 - Above Average
Replies: 62
Views: 19031

### 10370(restircted function error)

#include<stdio.h> int main() { unsigned long p,q,n,count=0,grade[10000],sum=0,index,ca; float avg,percent,t; scanf("%lu\n",&ca); for(index=1;index<=ca;index++) { scanf("%lu\t",&n); if(n<=1000) { for(p=1;p<=n;p++) { scanf("%lu",&grade[p]); sum+=grade[p]; avg=sum/n; } for(p=1;p<=n;p++) { if(avg<grade[...