Guest User

Untitled

a guest
Jan 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main (int argc, const char * argv[])
  4. {
  5.  
  6. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  7.  
  8. int sum = 0;
  9. for(int i = 0; i != 1000; i++) {
  10. if (i % 3 == 0 || i % 5 == 0) {
  11. sum += i;
  12. }
  13. }
  14.  
  15. NSLog(@"answer: %d", sum);
  16.  
  17. [pool drain];
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment