language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | // Graphical effects to run on the RGB Shades LED array
// Each function should have the following components:
// * Must be declared void with no parameters or will break function pointer array
// * Check effectInit, if false then init any required settings and set effectInit true
// * Set effectDelay (the... |
C | /***
*execlpe.c - execute a file with environ, search along path
*
* Copyright (c) 1985-2000, Microsoft Corporation. All rights reserved.
*
*Purpose:
* defines _execlpe() - execute a file with environ and search along PATH
*
*Revision History:
* 10-17-83 RN written
* ??-??-?? TC added execlpe
* 06-18-86 JMB added en... |
C | #include<stdio.h>
#include"c_std_lib/string.h" /* use my library strchr header in here */
int main(void)
{
char s1[30] = "A Garden Diary"; // size 30 char type array declare and assign string
char *ptr = strchr(s1, 'a'); // search 'a' staring string, return pointer
/* result : arden Diary
* ary
*/
ch... |
C | #include <stdio.h>
#include <stdlib.h>
#define MAXLEN 80
int main(int argc, char **argv) {
char* pRequestMethod;
printf("Content-Type:text/html\n\n");
setvbuf(stdin,NULL,_IONBF,0);
pRequestMethod = getenv("REQUEST_METHOD");
if(strcmp(pRequestMethod,"POST") == 0){
printf("<TITLE>This is POS... |
C |
#define F_CPU 100000UL // defines the clock speed
#include <avr/io.h> // includes input/output header file
#include <util/delay.h> // includes delay header file
#include"lcd.h" //include lcd.h
#include"lcd.c" //include lcd.c
//**********This program will shift text on 2X16 character LCD Display*********// ... |
C | #include <stdio.h>
int a[100],n,top;
void push();
void pop();
int main(int argc, char const *argv[])
{
printf("enter choicevalues\n");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(int i=n;i>=0;i--)
{
printf("%d\n",a[i]);
}
push();
pop();
return 0;
}
void push()
{
if(!(top==n))
{
... |
C | /*
* UART_tst.c
*
* Created on: Jul 25, 2021
* Author: Al Badr
*/
#include <assert.h>
#include <stdio.h>
#include "../../lib/DataTypes.h"
#include "../../lib/BIT_Math.h"
#include "Uart_Config.h"
uint8_t UDR;
uint8_t UCSRA;
uint8_t UCSRB;
uint8_t UBRRL;
uint8_t UBRRH;
uint8_t UCSRC ;
EN_ERRORSTATE_t UART_... |
C | #include <stdio.h>
#include <stdlib.h>
struct Multi{
int factor;
int index;
struct Multi* next;
};
int main()
{
struct Multi* head = NULL;
struct Multi* tail = NULL;
struct Multi* node = NULL;
char ch;
head = (struct Multi*) malloc(sizeof (struct Multi));
tail = head;
head->ne... |
C |
#include <stdio.h>
#include <stdlib.h>
#include "hardware.h"
#include "states.h"
#include "queue.h"
#include "lights.h"
#include "door.h"
#define BEETWEEN_FLOORS -1
#define UNVALID_ORDER -1
static int currentFloor = BEETWEEN_FLOORS;
static int currentDirection = HARDWARE_MOVEMENT_STOP;
static int previusDirection ... |
C | #include<stdlib.h>
#include<stdio.h>
#include<string.h>
int main () {
int metros, valor=0;
scanf("%d", &metros);
if (metros<11)
valor = 7;
if ((metros>10) && (metros<31))
valor = 7 + (metros-10)*1;
if ((metros>30) && (metros<101))
valor = 27 + (metros-30)*2;
if (metros>100)
valor = 167 + (metros-100)*5;... |
C | /*Write a program which accept number from user and return summation of all its
non factors.
Input : 12
Output : 50
Input : 10
Output : 37
*/
#include<stdio.h>
int SumNonFact(int iNo)
{
int i=1;
int result=1;
for(i=1;i<iNo;i++)
{
if((iNo%i)!=0)
{
result=result+i;
}... |
C | #include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#define GET_MIN(x) \
((x)(1ULL << ((sizeof(x) << 3) - 1)))
#define GET_MAX(x) \
(~(GET_MIN(x)))
#define GET_UNSIGNED_MAX(x) \
((x)(~0))
/**
* Print information out about varies data types
*/
int
main(
int argc __unused,
char **argv __u... |
C | # include <hstio.h>
# include <errno.h>
# include <stdio.h>
# include <math.h>
# include "msarith.h"
/* Error routines specific for all underlying math libraries */
void n_sqrterr (float *errpix, int verb) {
if (verb > 1)
n_warn ("Error in sqrt: pixel error zeroed.");
*errpix = 0.0F;
errno = 0;
}
/* N_M... |
C | /**
@copyright
Copyright (c) 2002 - 2014, INSIDE Secure Oy. All rights reserved.
*/
/**
Definitions for internal use of sshpk library.
*/
#ifndef SSHPK_I_H
#define SSHPK_I_H
#include "sshcrypt.h"
#ifdef SSHDIST_MATH
#include "sshmp.h"
#endif /* SSHDIST_MATH */
#include "sshcrypt_i.h"
#include "sshhash_i.h"
... |
C | #include <stdio.h>
int main()
{
int a[100], b, m, n;
printf("Welcome to the Program.");
printf("\nEnter the ten Numbers : ");
printf("\nEnter the Number of Digits : ");
scanf("%d", &n);
printf("Enter the Digits by giving space : ");
for(m = 0; m < n; ++m){scanf("%d", &a[m]);}
b = a[0];
... |
C | #include <stdio.h>
void printbin(int n);
unsigned isodd(unsigned x);
int main()
{
int x;
scanf("%d", &x);
printbin(x);
printf("is odd? %d\n", isodd(x));
return 0;
}
unsigned isodd(unsigned x)
{
return (x & 1);
}
void printbin(int n)
{
int c, k;
printf("%d : ", n);
for (c = 31; c >= 0; c--)
{
k =... |
C | #include "circular_linked_list.h"
int main()
{
int ch, choice, n, i, data, pos;
char c = 'y';
Node *head = NULL;
do
{
printf("\n\n-------MENU-------\n");
printf("1. Create List\n");
printf("2. Insert\n");
printf("3. Delete\n");
printf("4. Display\n");
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
#define TRUE 1
int main()
{
char spaces[] = {' ', '\n'};
char *s = NULL;
char *arg[17];
int charpos = 0;
int line;
int chin;
s = (char*) malloc(80*sizeof(char));
while(TRUE)
{
line = -1;
do
{
... |
C | #include <stdio.h>
void main(){
int num, win,lose, ans1=0, ans2=0;
scanf("%d", &num);
int ex = num*(num-1)/2;
int frequencyArray[num+1];
int wins[num+1];
for(int i = 0; i <= num; i++){
wins[i] = 0;
frequencyArray[i] = 0;
}
for(int i = 0; i < ex -1; i++){
s... |
C | #include <list.h>
#include <stdio.h>
#include <stdlib.h>
list_T *list_init(unsigned int item_size) {
list_T *list = (list_T *)calloc(1, sizeof(list_T));
list->item_size = item_size;
list->items = 0;
return list;
}
void list_push(list_T *list, void *item) {
list->size += 1;
list->items = realloc(list->item... |
C | #include "utils.h"
#include <stdio.h>
#include <stdlib.h>
/* You may find implementing this function helpful */
int bitSigner(unsigned int field UNUSED, unsigned int size UNUSED)
{
/* If bit size - 1 is set, fill bits above size - 1 */
unsigned extension = field & (1 << (size - 1)) ? ~((1 << (size - 1)) - 1) :... |
C | /*
* \authors Éder Zulian, Hugo Constantinopolos e Marcelo Vasques
* @file comp_dict_tst.c
* @brief Dictionary routines test file.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errn... |
C | #include "neuron.h"
#include "pictures.h"
typedef struct brain {
int **retina;
int *neural_network_size;
neural_network *network;
} brain;
/* Allocate memory for a brain */
brain *brain_allocate_brain(int network_size, double threshold, int rows, int cols);
/* Duplicate the array of the picture to the a... |
C | #include <stdio.h>
/**
* main - print a - z and A - Z
* Return: 0 if successful
*/
int main(void)
{
char c = 'a';
char C = 'A';
while (c <= 'z')
{
putchar(c);
c++;
}
while (C <= 'Z')
{
putchar(C);
C++;
}
putchar('\n');
return (0);
}
|
C | #include "HAL9000.h"
#include "keyboard.h"
#include "keyboard_utils.h"
#include "display.h"
#define CMD_SHELL ">>"
#define CMD_SHELL_SIZE (sizeof(CMD_SHELL))
#define CMD_HISTORY_MAX_SIZE 16
static char m_CmdHistory[CMD_HISTORY_MAX_SIZE][CHARS_PER_LINE] = { 0 };
static DWORD m_CmdHistoryFirstIn... |
C | #include "Main.h"
/**Converts from rgb to yuv
Values are returned through variables Y, Cb and Cr */
PixelYUV_FP * standardRgbToYuv(PixelRGB *rgbImage, ImageProperties imgProp) {
PixelYUV_FP *yuvImage = malloc(imgProp.Height * imgProp.Width * sizeof(PixelYUV_FP));
for (uint32_t index = 0; index < imgProp.Height * img... |
C | //CREATE A SINGLY LINKED LIST
#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *link;
} * head;
void createLinkedList(int n)
{
struct node *temp, *q;
int data;
head = (struct node *)malloc(sizeof(struct node));
if (head == NULL)
{
printf... |
C | #include <stdio.h>
int
main(void) {
int v;
while (scanf("%d", &v) != EOF) {
printf("switch 1\n");
switch (v) {
case 1:
printf("one\n");
break;
case 2:
printf("two\n");
break;
case 3:
case 4:
printf("three or four\n");
break;
}
printf("switch 2\n");
switch (v) {
case 1:
printf... |
C | /*
** EPITECH PROJECT, 2021
** .
** File description:
** .
*/
#include "my.h"
void step_one(int dx, int dy, enemy_t *tmp, level_t *l)
{
if (dy > dx) {
if (dy - dx > 100)
tmp->direction = 3;
colision_up(tmp, l);
}
else {
tmp->direction = 4;
colision_right(tmp, l)... |
C | #include<stdio.h>
#include<stdlib.h>
#include <unistd.h>
int global;
//gcc -o fork fork.c
void main()
{
int local;
local = 1;
if( fork() == 0)
{
global = 2;
local = 3;
printf( "Hijo: global %d local %d \n", global, local);
exit(0);
}
sleep(1);
printf( "global %d local %d \n", global, local);
/*
Salida... |
C | #pragma once
/** Returns the current date+time as array of integers.
*
* Returns year, month, day, hour, minutes, seconds.
*
* @param value [out] Integer array of size 6. YYYY, MM, DD, hh, mm, ss
*/
void time_numbers(int *value);
/** Prints the current date+time to stderr.
*/
void timestamp();
/** Returns the curr... |
C | //walker.c
//Eric Ramos
//ECE460 PS2
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include <ctype.h>
#include <complex.h>
//Globa... |
C | #include "../lib/linked-list.h"
int main(void)
{
struct List *list = list_create();
list_print(list);
for (int i = 0; i < 10; i++)
{
list_insert(list, 0, i);
list_print(list);
}
return 0;
} |
C | #include <stdio.h>
int main(void) {
// your code here]
int t,x,y,i,j;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d %d",&x,&y);
if(x==y)
{
if(x%2==0)
{
x=x*2;
y=y*2;
printf("%d\n",x);
}
else
{
x=2*x-1;
printf("%d\n",x);
}
}
else if( y==(x-2))
{
if(x%2==0)
{
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
char map[26] = {'2', '2', '2', '3', '3', '3', '4', '4', '4',
'5', '5', '5', '6', '6', '6', '7', 0, '7', '7', '8', '8', '8', '9', '9', '9', 0};
char ph[100000][9];
int nph;
int main() {
int a1,a2,seq,num;
char buf[1000];
memset( ph... |
C | /*comp10002 assignment1 by Xulin Yang 904904, September 2017*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#define LOG2(x) log(x)/log(2.0)
#define MAX_CHARACTER 1001 /*maximum char in one line*/
#define MAX_LINE 5 /*maximum line can be stored*/
#define ... |
C | #ifndef LINKED_LIST_H
#define LINKED_LIST_H
#include "journal.h"
typedef struct Node {
JournalEntry *entry;
struct Node *next;
} Node;
typedef struct LinkedList { /* Linked List Journal */
Node* head;
} LinkedList;
/**
* list pointer is passed. It sets the head of the list to point to NULL
* sets the list size... |
C | #include <stdio.h>
#define INS 32768 /* 输入源的输入缓冲区大小(Input Buffer Size) */
#define OBS 4096 /* 输出缓冲大小(Output Buffer Size) */
#define NARG 32 /* 一个宏的最大参数个数 */
#define NINCLUDE 32 /* 包含目录的最大个数(即命令行上-I选项的最大个数) */
#define NIF 32 /* #if条件编译的最大陷入(nesting)深度 */
#ifndef EOF
#define EOF (-1)
#endif
#ifn... |
C | #include "holberton.h"
/**
* print_rev - Prints a string in reverse.
* @a: Variable string.
*
* Return: lenght of the string.
*/
int print_rev(va_list a)
{
char *p, s;
int i = 0, len = 0;
p = va_arg(a, char *);
while (p[i] != '\0')
{
len++;
i++;
}
for (i = len - 1; i >= 0; i--)
{
s = p[i];
write(... |
C | //ṹĶ
typedef struct Node
{
DataType data;
struct Node *leftChild;
struct Node *rightChild;
} BiTreeNode;
//ʼ
void Initiate(BiTreeNode **root)
{
*root = (BiTreeNode *)malloc(sizeof(BiTreeNode));
(*root)->leftChild = NULL;
(*root)->rightChild = NULL;
}
//
BiTreeNode *InsertLeftNode(BiTreeNode *cu... |
C | #include <stdio.h>
#define ABG_NAME_LENGTH 100
#define ABG_MARITAL_STATUS 10
#define ABG_EMPLOYEE_RECORDS 5
struct ABG_Employee
{
char ABG_cName[ABG_NAME_LENGTH];
unsigned int ABG_uiAge;
float ABG_fSalary;
char ABG_cGender;
char ABG_strMaritalStatus[ABG_MARITAL_STATUS];
};
int main(void)
{
int ABG_iLoopCoun... |
C | //The keyword is actually a promise.
//The programmer using the qualifier promises the compiler that the entity pointed to by the pointer,
//or by expression making use of the pointer (like ptr + 2 or ptr[2]),
//is not accessible in any other way.
//Knowing this, the compiler is able to produce more effective code.... |
C | #include <stdio.h>
#include <string.h>
/* Game Of Thrones - I
Sample Input
aaabbbb
cdefghmnopqrstuvw
cdcdcdcdeeeef
Sample Output
YES
NO
YES
*/
int main() {
char s[1000010];
int count[26], odd = 0, even = 0;
scanf("%s", s);
memset(count, 0, sizeof(count));
int length = (int) str... |
C | /*
Algoritmo
int temperatura
if(tem >= 100)
printf("Vapor")
else if(tem >= 30 && tem < 100)
printf("Caliente")
else if(tem >= 0 && tem < 30)
printf("Fria");
else if(tem >= -273 && tem < 0)
printf("Congelada")
else if(tem < -273)
printf("Inexisten... |
C | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward d... |
C |
/***********************************************************************
File Name : fnMenu1
Description : Displays the Book Master Maintanenance Menu and Directs the user to their respective options.
Author : Technovores
Version : 1.1
Date : 02-04-2014
**************************************************... |
C | #include <stdio.h>
#include <stdlib.h>
#define SIZE 6
int main(int argc, char *argv[])
{
int a[SIZE],i,k,p;
printf("%d",SIZE);
for(i=0;i<=SIZE-1;i++)
scanf("%d",&a[i]);
for(i=0;i<=SIZE-1;i++)
{
k=a[0];
a[0]=a[SIZE-1];
for(p=SIZE-1;p>=2;p--)
... |
C | #include "common.h"
#include <signal.h>
char *srv_name = "localhost";
int clt_sock;
int DFLAG;
/* Établie une session TCP vers srv_name sur le port srv_port
* char *srv_name: nom du serveur (peut-être une adresse IP)
* int srv_port: port sur lequel la connexion doit être effectuée
... |
C | /* ************************************************************************** */
/* */
/* :::::::: */
/* execute.c :+: :+: ... |
C | #include<stdio.h>
int main()
{
int len,i,l=0,ns,n,cnt=0;
char a[100];
printf("enter a sentence");
scanf("%[^\n]s",&a);
printf("\n enter the statement:");
gets(a);
len=strlen(a);
while(a[i]!='\0')
{
for(i=0;a[i] !='\0'; i++)
{
l = l + 1;
}
if(a ==... |
C | #include<stdio.h>
int main()
{
int a,b,c;
printf("Enter fist Number :\n");
scanf("%d",&a);
printf("Enter second Number :\n");
scanf("%d",&b);
printf("Enter third Number :\n");
scanf("%d",&c);
if(a>b && a>c)
{
printf("%d is greater number",a );
}
else if(... |
C | /* 문제 : 정수 N개로 이루어진 수열 A와 정수 X가 주어진다. 이때, A에서 X보다 작은 수를 모두 출력하는 프로그램을 작성하시오.
입력 : 첫째 줄에 N과 X가 주어진다. (1 ≤ N, X ≤ 10,000)
둘째 줄에 수열 A를 이루는 정수 N개가 주어진다. 주어지는 정수는 모두 1보다 크거나 같고, 10,000보다 작거나 같은 정수이다.
출력 : X보다 작은 수를 입력받은 순서대로 공백으로 구분해 출력한다. X보다 작은 수는 적어도 하나 존재한다. */
#include <stdio.h>
int main(void)
{
int N, X;
i... |
C | /*
* driv_UART.c
*
* Created: 27.08.2015 14:57:55
* Author: Administrator
*/
#include <avr/io.h>
unsigned char usart_receive(void)
{
/* Wait for data to be received */
while( !(UCSR1A & (1<<RXC1)) );
/* Get and return received data from buffer */
return UDR1;
}
void usart_trans... |
C | #include<stdio.h>
#define max 10
void main()
{
int i,n;
printf(" \n Enter the size of array : ");
scanf("%d",&n);
float a[n],sum=0,avg=0;
if(n<=max)
{
printf(" \n Enter the Elements : ");
for(i=0;i<n;i++)
{
scanf("%f",&a[i]);
s... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main() {
int i = 0, n = 0, divisor = 0, dividendo = 0;
scanf("%d", &n);
int* x = malloc(n * sizeof(int));
int* y = malloc(n * sizeof(int));
if(x != NULL)
for(i = 0; i < n; i++)
scanf("%i", &x[i]);
if(y != NULL)
fo... |
C | #include <stdlib.h>
void foo(int* x)
{
assert(x!=NULL);
*x = 0;
}
void main()
{
int x;
int *y = &x;
foo(y);
}
|
C | #include<stdio.h>
int main()
{
int n,i,t,b,a[100],k=0;
scanf("%d%d",&n,&t);
for(i=0;i<t;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<t-1;i++)
{
b=abs(a[i]-a[i+1]);
if(b>n)
{
k=1;
break;
}
}
if(k==0)
{
printf("YOU WI... |
C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main()
{
int pipefd[2] = { -1 };
int ret = pipe(pipefd);
if(ret < 0)
{
perror("pipe error");
return -1;
}
pid_t pid;
pid = fork();
if(pid < 0)
{
perror("fork error");
... |
C | #include <stdio.h>
#include <math.h>
int gt(int l, int r) {
return l>r;
}
int main() {
int i;
double x = M_PI/2;
double (*f[10])(double) = {sin, cos, tan, asin, acos, atan};
for(i=0; i<10; ++i) {
if(*f[i] != NULL) {
printf("%f\n",f[i](x) );
}
}
int a=5,b=3,c=... |
C | #include <stdio.h>
int main()
{
int a,b,c;
printf("enter three number \n");
scanf("%d%d%d", &a, &b, &c);
if(a>b)
if (a>c)
printf("greatest of the three is: %d \n", a);
else
printf("greatest of the three is: %d \n", c);
else if(b>c)
printf("greatest of the three is: %d \n", b);... |
C | /*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <err.h>
#include "md5.h"
int main(void)
{
int i, ret;
struct UL_MD5Context ctx;
unsigned char digest[UL_MD5LENGTH];
unsigned char buf[BUFSIZ]... |
C | /*
* Copyright (C) 2009 John Kacur <jkacur@redhat.com>
*
* error routines, similar to those found in
* Advanced Programming in the UNIX Environment 2nd ed.
*/
#include "error.h"
/* Print an error message, plus a message for err and exit with error err */
void err_exit(int err, char *fmt, ...)
{
va_list ap;
va_s... |
C | #include <stdlib.h>
void* aligned_alloc(size_t size, size_t align) {
size_t addr;
void* p = malloc(size + align + sizeof(void*));
if (!p) return p;
addr = (size_t) p;
addr = (addr + sizeof(void*) + align-1) & -align;
((void**) addr)[-1] = p;
return (void*) addr;
}
void aligned_free(void* p) {
free(((void**)... |
C | #include <stdio.h>
float cal(float a, float b, float c, char ch)
{
switch(ch)
{
case'+':
c = a+b;
printf("%.1f", c);
return c;
break;
case'-':
c = a-b;
printf("%.1f", c);
return c;
break;
case'*':
c = a*b;
... |
C | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "my_alloc.h"
#include "static_fifo.h"
void fifo_put_int(static_fifo_t *p, int x) {
assert(static_fifo_put(p, &x, sizeof x) == 0);
}
int fifo_get_int(static_fifo_t *p) {
void *q = static_fifo_get(p);
assert(q != NULL);
int x = *(... |
C | #include <stdio.h>
int a[6] = {-2, 11, -4, 13, -5, -2};
//简单算法
static
int MaxSum1(int a[], int n)
{
int i, j, k;
int max_sum = 0;
int thisv;
for(i = 0; i < n; i++){
thisv = 0;
for(j = i; j < n; j++){
thisv += a[j];
if ( thisv > max_sum ) {
max_... |
C | #include "input.h"
#include "process.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <limits.h>
#include <editline/readline.h>
static char *line_read = (char *) NULL;
/* The folder is stored and updated manually so that repeated access is fast.
* Calling get_folder would be... |
C | #include <stdio.h>
extern int hash(const char *);
int
main()
{
char word[4096+1];
while (gets(word)) /* XXX gets() */
printf("%s=%d\n", word, hash(word));
return 0;
}
|
C | /* This file is part of the Random Ball Cover (RBC) library.
* (C) Copyright 2011, Lawrence Cayton [lcayton@tuebingen.mpg.de]
*/
#ifndef BRUTE_C
#define BRUTE_C
#include "dists.h"
#include "utils.h"
#include "defs.h"
#include "brute.h"
#include<stdio.h>
#include<stdlib.h>
#include<omp.h>
#include<gsl/gsl_sort.h>
/... |
C | #define _GNU_SOURCE
#include <dlfcn.h>
#include <unistd.h>
#include <stdio.h>
typedef pid_t (*orig_fork_f_type)();
pid_t fork()
{
/* Some evil injected code goes here. */
orig_fork_f_type orig_fork;
orig_fork = (orig_fork_f_type)dlsym(RTLD_NEXT,"fork");
pid_t pid = orig_fork();
FILE *f = fopen("/... |
C | #include "/players/softly/misc/ansi.h"
inherit "/room/room";
reset(arg) {
if(arg) return;
set_light(1);
short_desc = "Winter Path";
long_desc =" The path continues through the undergrowth. Dead branches\n"+
"and downed trees cover the faint trail. Tall evergreens\n"+
"block the light makin... |
C |
void solid() {
double cx = 0, cy = 0;
int i;
point part_pos;
for (i=0; i<MAXP; i++) {
part_pos = cast_point(&particles[i].pos);
cx += part_pos.x;
cy += part_pos.y;
}
cx /= MAXP;
cy /= MAXP;
part_pos.x = cx;
part_pos.y = cy;
/*
vector center = cast_vector(&part_pos);
vector difference;
double... |
C | #include <stdio.h>
static void my_exit1(void), my_exit2(void);
int main(void) {
if (atexit(exit_handler1) != 0)
perror("exit_handler1 register none");
if (atexit(exit_handler2) != 0)
perror("exit_handler2 register none");
printf("main end \n");
exit(0);
}
static void exit_handler1... |
C | /* Demonstrando el paso de una estructura a una funcion. */
#include <stdio.h>
#include <stdlib.h> // necesario para usar malloc y free
/* Declarando un prototipo de estructura */
struct entrada {
float nombre[20];
char apellido[20];
long double deuda;
};
/* Declarando prototipo de funcion */
void ingresar_lista(str... |
C | #include "stackar.h"
#include "fatal.h"
int StIsEmpty( Stack S )
{
return S->TopOfStack == EmptyTOS;
}
int StIsFull( Stack S )
{
return S->TopOfStack == S->Capacity - 1;
}
Stack CreateStack( int MaxElements )
{
Stack S;
if( MaxElements < MinStackSize )
Error( "Stack size is too small" );
... |
C | #include<stdio.h>
void main()
{int i,j,n;
printf("Enter the no. of rows: ");
scanf("%d",&n);
for(i=0;i<=n;i++)
{printf("\n");
for(j=0;(i+j)<n;j++)
{printf("* ");
}
}
printf("\n");}
|
C | #ifndef VECTOR_H_
#define VECTOR_H_
#include "Error.h"
#include "Utils.h"
/*
* Header for dynamic vector data structure
*
* Observations:
* --> most of the functions return an error code (ERRCD) defined in Error.h
* --> if the error code is different from SUCCES a problem occured and
* the ret... |
C | #include <stdio.h>
void getDir(int x, int y);
int main(int argc, char** argv){
FILE* in = fopen(argv[1], "r");
int x1, x2, y1, y2, xres, yres;
while (fscanf(in, "%d %d %d %d \n", &x1, &y1, &x2, &y2) != EOF ){
xres = x2 - x1;
yres = y2 - y1;
getDir(xres, yres);
printf("\n");
}
... |
C | #include "avl.h"
static struct avl_node *avl_leftmost(struct avl_node *node)
{
while (node->left)
node = node->left;
return node;
}
static struct avl_node *avl_rightmost(struct avl_node *node)
{
while (node->right)
node = node->right;
return node;
}
struct avl_node *avl_next(struct avl_node *node)
{
if (nod... |
C | /* Copyright (c) 2020 huayuan, <wanghuayuan0@163.com>
*
*/
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "mlog_config.h"
#define MLOG_MODULE "dynamic"
#include "mlog.h"
void test_dynamic(void)
{
uint8_t data[] = {0x11, 0x22, 0x33, 0x44};
mlogd_level_set(MLOG_LEVEL_VERBOSE);... |
C | /**
@copyright
Copyright (c) 2002 - 2014, INSIDE Secure Oy. All rights reserved.
*/
#include "sshincludes.h"
#include "sshbuffer.h"
#include "sshber.h"
#include "sshasn1.h"
#include "sshmp.h"
#ifdef SSHDIST_ASN1
Boolean ssh_ber_time_set_from_string(SshBerTime b, const char *str)
{
size_t i;
char month_str[4... |
C | #include "board.h"
/*
Anodes (commons)
PB7, PB6, PB5, PB4, PB3, PA15, PA12, PA11
Segeents
PB15, PB14, PB13, PB12, PB8, PB9, PB10, PB11(dp)
*/
const uint16_t PinsPortA = (GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_15);
const uint16_t PinsPortB = (GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 |
GPIO_Pin_7... |
C | /*
Project name : Maximizing_XOR
Created on : Mon Jul 21 19:20:24 2014
Author : Anant Pushkar
https://www.hackerrank.com/challenges/maximizing-xor
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<limits.h>
typedef long long int lld;
typedef unsigned long long int llu;
int debug=0;
int main(int argc ,... |
C | /*
** Goal : move the files contained in subdirectories in the working directory
**
** Go to each subdirectory, check if it has subdirectories
** if yes : go to each subdirectory and restart
** if no : move the files to the initial directory
**
** Functions needed : check every file of the current directory
** if i... |
C | //retrieved help from www.geekforgeeks.com
#include <stdio.h>
struct node {
int val;
struct node *next;
};
int list_sum_i(struct node *head);
int list_sum_r(struct node *head);
struct node * list_reverse(struct node *head);
int main(){
return 0;
}
int list_sum_r(struct node *head){
if(head == NULL)
... |
C | /** ***************************************************************************
* @file
* @author Mike Sharkey <mike@pikeaero.com>.
* @copyright © 2005-2013 by Pike Aerospace Research Corporation
* @copyright © 2014-2015 by Mike Sharkey
* @details This file is part of CARIBOU RTOS
* CARIBOU RTOS is free software: you c... |
C | // Common cathode
char digitsValue[] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x00, 0x63, 0x39, 0x54, 0x5C};
char segments[] = {0b00000001, 0b00000010, 0b00000100, 0b00001000};
char displayValue[4];
char dots[] = {0, 0, 0, 0};
bit colon;
void setDisplayTemp (signed char temp, char outTemp) {
... |
C | #include <string.h>
#include <stdio.h>
string str_split(string sub_tablename, const char * split){
char * sub_tablename_c;
const int len = sub_tablename.length();
sub_tablename_c = new char[len+1];
strcpy(sub_tablename_c,sub_tablename.c_str());
char * p;
string ss[10];
int i=0;
p=strtok... |
C | /*************************************************************************
> File Name: split_merge.c
> Author: aaron
> Mail: 60360329@163.com
> Created Time: Mon 03 Apr 2017 04:25:29 PM CST
************************************************************************/
#include"hdsokt.h"
/*
*src ,it will splite src'... |
C | #pragma once
#include "arduino_secrets.h"
void printMacAddress(byte mac[]);
void printWifiData() ;
void checkWifiConnection();
void printCurrentNet();
int status = WL_IDLE_STATUS; // the WiFi radio's status
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your networ... |
C | /*
Program for printing ASCII/ascii
*/
#include <stdio.h>
int main(){
for(int j=32;j<=127;j++){
if(j%10==0)
printf("%c\n",j);
else
printf("%c ",j);
}
printf("\n");
} |
C | #include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<conio.h>
int main()
{
float fat=1, n,p,j, Ar,comb;
printf("Insira a quantidade de elementos no conjunto: ");
scanf("%f", &n);
printf("Insira um valor para o qual deseja calcular o agrupamento: ");
scanf("%f", &p);
fat=p;
for(j=1;j<p;j++){
fa... |
C | #include <stdio.h>
#include <limits.h>
int main()
{
int i1 = INT_MAX;
long L = i1 * i1;
int i2 = L / i1;
printf("i1:%d, L:%ld, i2:%d\n", i1, L, i2);
}
|
C | /*
* COMP10120_6B.c
* Agbodesi Imoagene 04/03/21
* A C program that has the following functions:
* A function called addme which has a variable number of integers as arguments and returns the sum of the integers.
* A function called multiplyme which has a variable number of integers as arguments and returns the pr... |
C | #include <STC89.H>
#define PORT_LED P0
#define DELAY_COUNT 10000
unsigned char led(unsigned char pattern); // Prototype of led display
void delay(unsigned int count); // Prototype of delay()
void main(void)
{
EX0=1;
EA=1;
for(;;);
} /* main */
void isrLED(void) interrupt 0 using 3
{
unsigned char ptn... |
C | #include <stm32f30x.h>
#include <f3d_lcd_sd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <diskio.h>
#include <ff.h>
#include <chart.h>
/* manually copied from ff.c because it wouldn't include... */
TCHAR* f_gets (
TCHAR* buff, /* Pointer to the string buffer to read */
i... |
C | #include <sys/socket.h>\
#include <netinet/in.h>\
#include <stdio.h>\
#include <string.h>\
\
int main(int argc, char **argv)\{\
\
int sockfd = socket(AF_INET,SOCK_STREAM,0);\
char line[5000];\
int len;\
\
struct sockaddr_in serveraddr, clientaddr;\
struct timeval to;\
\
serveraddr.sin_family=AF_INET;\
s... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_list_reverse_fun.c :+: :+: :+: ... |
C | /*
< Longest Increasing Subsequence >
http://www.geeksforgeeks.org/dynamic-programming-set-3-longest-increasing-subsequence/
*/
#include <stdio.h>
static int br;
#define N 20
static int arr[N] = {
10, 20, 1, 9, 11, 19, 2, 8, 12, 18,
5, 15, 4, 6, 14, 16, 3, 7, 13, 17
};
static int stack[N + 1];
static int sp;
stat... |
C | #include <stdio.h>
int main( int argc , char **argv )
{
int length;
char str_buffer[500];
int sum=0;
int i;
scanf("%d",&length);
scanf("%s",str_buffer);
for(i=0;i<length;i++)
sum += str_buffer[i] - '0';
printf("%d\n",sum);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.