Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Your snippets
- #
- # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
- # expand the prefix into a larger code block with templated values.
- #
- # You can create a new snippet in this file by typing "snip" and then hitting
- # tab.
- #
- # An example CoffeeScript snippet to expand log to console.log:
- #
- # '.source.coffee':
- # 'Console log':
- # 'prefix': 'log'
- # 'body': 'console.log $1'
- #
- # Each scope (e.g. '.source.coffee' above) can only be declared once.
- #
- # This file uses CoffeeScript Object Notation (CSON).
- # If you are unfamiliar with CSON, you can read more about it in the
- # Atom Flight Manual:
- # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
- '.source.c':
- 'include std':
- 'prefix': 'std'
- 'body': '#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>'
- 'print list':
- 'prefix': 'printlist'
- 'body':
- 'for (int i = 0; i < size; i++) {\n\tprintf("%d ", a[i]);\n}\nprintf("\\\\n");'
- 'print new line':
- 'prefix': 'newl'
- 'body': 'printf("\\\\n");'
- 'scan list':
- 'prefix': 'scanlist'
- 'body': 'scanf("%d", &size);\nfor (int i = 0; i < size; i++) {\n\tscanf("%d ", &a[i]);\n}\n'
- 'scan 2d list':
- 'prefix': 'scan2dlist'
- 'body': 'scanf("%d %d", &n, &m);\nfor (int i = 0; i < n; i++) {
- \n\tfor (int j = 0; j < m; j++) {
- \n\t\tscanf("%d", &grid[i][j]);
- \n\t}
- \n}'
- 'print 2d list':
- 'prefix': 'print2dlist'
- 'body': 'for (int i = 0; i < n; i++) {
- \n\tfor (int j = 0; j < m; j++) {
- \n\t\tprintf("%d", grid[i][j]);
- \n\t}
- \n\tprintf("\\\\n");
- \n}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement