SHARE
TWEET

snippet

a guest Jul 22nd, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Your snippets
  2. #
  3. # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
  4. # expand the prefix into a larger code block with templated values.
  5. #
  6. # You can create a new snippet in this file by typing "snip" and then hitting
  7. # tab.
  8. #
  9. # An example CoffeeScript snippet to expand log to console.log:
  10. #
  11. # '.source.coffee':
  12. #   'Console log':
  13. #     'prefix': 'log'
  14. #     'body': 'console.log $1'
  15. #
  16. # Each scope (e.g. '.source.coffee' above) can only be declared once.
  17. #
  18. # This file uses CoffeeScript Object Notation (CSON).
  19. # If you are unfamiliar with CSON, you can read more about it in the
  20. # Atom Flight Manual:
  21. # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
  22.  
  23. '.source.c':
  24.     'include std':
  25.         'prefix': 'std'
  26.         'body': '#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>'
  27.     'print list':
  28.         'prefix': 'printlist'
  29.         'body':
  30.             'for (int i = 0; i < size; i++) {\n\tprintf("%d ", a[i]);\n}\nprintf("\\\\n");'
  31.     'print new line':
  32.         'prefix': 'newl'
  33.         'body': 'printf("\\\\n");'
  34.     'scan list':
  35.         'prefix': 'scanlist'
  36.         'body': 'scanf("%d", &size);\nfor (int i = 0; i < size; i++) {\n\tscanf("%d ", &a[i]);\n}\n'
  37.     'scan 2d list':
  38.         'prefix': 'scan2dlist'
  39.         'body': 'scanf("%d %d", &n, &m);\nfor (int i = 0; i < n; i++) {
  40.             \n\tfor (int j = 0; j < m; j++) {
  41.             \n\t\tscanf("%d", &grid[i][j]);
  42.             \n\t}
  43.             \n}'
  44.     'print 2d list':
  45.         'prefix': 'print2dlist'
  46.         'body': 'for (int i = 0; i < n; i++) {
  47.             \n\tfor (int j = 0; j < m; j++) {
  48.             \n\t\tprintf("%d", grid[i][j]);
  49.             \n\t}
  50.             \n\tprintf("\\\\n");
  51.             \n}'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top