Guest User

Untitled

a guest
Feb 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #import <Foundation/Foundation.h>
  2.  
  3. /* Read a number and an array */
  4. int main(int argc, const char * argv[]) {
  5. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // memory release
  6.  
  7. int n;
  8. scanf("%i", &n);
  9. int nums[n];
  10. for(int num = 0; num < n; num++){
  11. scanf("%i", &nums[num]);
  12. // treat your problem here
  13. }
  14.  
  15. [pool drain]; // memory release
  16. return 0;
  17. }
  18.  
  19. /* Read a number and some strings */
  20. int main(int argc, const char * argv[]) {
  21. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  22.  
  23. int n;
  24. scanf("%i", &n);
  25. for (int a0 = 0; a0 < n; a0++) {
  26. NSString *str;
  27. char *str_temp = (char *)malloc(512000 * sizeof(char));
  28. scanf("%s", str_temp);
  29. acid_name = [NSString stringWithFormat:@"%s", str_temp];
  30. // treat your problem here
  31. }
  32.  
  33. [pool drain];
  34. return 0;
  35. }
Add Comment
Please, Sign In to add comment