Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. /*
  2. - sufficienly old C defaults to int if no variable type is given.
  3. - no void is required for main in some version of C.
  4. - try to avoid if's. You can use ?: or || and && instead.
  5. */
  6.  
  7. s,u,e,y,f=21,x=1;
  8. float c(x)
  9. {
  10.         for(s=0,y=x;y>0;y--)
  11.                 s+=x%y?0:y;
  12.         return(float)s/x;
  13. }
  14.  
  15. main()
  16. {
  17.         while(f)
  18.                 for(e=++x;e++<1200;)
  19.                         c(x)-c(e)||(printf("%d,%d\n",x,e),f--,e=1200);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement