Search found 2 matches

by sk
Fri Jun 17, 2005 3:45 pm
Forum: Volume 2 (200-299)
Topic: 227 - Puzzle
Replies: 56
Views: 9643

yes that's right:D I had same problem (with a blank character in first line) cause i used scanf and after gets. I changed scanf to gets and now it works:D Each display line contains exactly 5 characters, beginning with the character on the leftmost square (or a blank if the leftmost square is actua...
by sk
Fri Jun 17, 2005 3:11 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 21832

Help 107!!!

#include<stdio.h> main(){ unsigned int n,m,i,j,a,b,t,t2,t3; while(1){ scanf("%u %u",&n,&m); if(n==0&&m==0)break; if(n==1)printf("0 1\n"); else if(m==1){ a=b=0; do{ b+=n; n>>=1; a++; }while(n); a--; printf("%u %u\n",a,b); } else{ for(i=2;i<=m;i++){ t=m; if(t%i==0){ while(t>1){ if(t%i)break; t/=i; } i...

Go to advanced search