Skip to content

Instantly share code, notes, and snippets.

#include <cstdio>
using namespace std;
int gcd(int a, int b)
{
while (b){
int temp = a % b;
a = b;
b = temp;
}
return a;
#include <cstdio>
#include <cmath>
using namespace std;
typedef unsigned int uint;
int main()
{
uint n;
while (scanf("%u",&n)){
if (!n) break;
uint a = sqrt(n);
#include <cstdio>
using namespace std;
int main()
{
int M,N;
scanf("%d", &M);
while (M--) {
scanf("%d", &N);
int ans[1001],nOfans = 0, sum = 0;
for (int i = 2; sum + i <= N; i++){
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char num[101][1001];
int ans[1001]={0};
for (int i = 0; scanf("%s",num[i]); i++){
if (num[i][0] == '0') break;
#include <cstdio>
using namespace std;
char num[10001];
long long int b,R;
char oper[2];
int main()
{
//freopen ("input.txt","rt",stdin);
#include <cstdio>
using namespace std;
int main()
{
freopen ("input.txt","rt",stdin);
char line[50];
while (gets(line)){
if (line[0] != '|') continue;
char c = 0;
for (int i=0; line[i]; i++){
#include <cstdio>
using namespace std;
int K,E;
char keyword[20][100],line[20][1000];
int analysis (int x)
{
int num = 0, p = 0;
char word[100];
#include <cstdio>
using namespace std;
double num (char line[],int i)
{
double a = 0;
while (line[i]>='0' && line[i]<='9'){
a *= 10;
a += (line[i]-'0');
i++;
#include <cstdio>
using namespace std;
void l1 (char line[], char s[][1000])
{
int i,j;
for (i=0; line[i]!='<'; i++) printf("%c",line[i]);
for (i++,j=0; line[i]!='>'; i++,j++) s[2][j] = line[i];
s[2][j] = '\0';
for (i++,j=0; line[i]!='<'; i++,j++) s[3][j] = line[i];
#include <cstdio>
using namespace std;
char grid[51][51],word[51];
int Case,m,n,k;
void upper_to_lower (char a[])
{
for (int i=0; a[i]; i++)
if (a[i]>='A' && a[i]<='Z')