Skip to content

Instantly share code, notes, and snippets.

@zsrinivas
Forked from avamsi/fastIO.cpp
Last active August 29, 2015 14:11
Show Gist options
  • Save zsrinivas/1eee49cfe5104d1655bb to your computer and use it in GitHub Desktop.
Save zsrinivas/1eee49cfe5104d1655bb to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
template <class number>
void input(number *ptr)
{
register char c = getchar_unlocked();
while (c < 33)
c = getchar_unlocked();
*ptr = 0;
while (c > 33)
{
*ptr = (*ptr * 10) + (c - '0');
c = getchar_unlocked();
}
}
template <class number>
void print(number a)
{
register char c;
char num[20];
int i = 0;
do
{
num[i++] = a%10 + 48;
a /= 10;
} while (a != 0);
i--;
while (i >= 0)
putchar_unlocked(num[i--]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment