language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ex_job_functions.c :+: :+: :+: ...
C
#include <stdio.h> int func(); // 声明函数隐式声明了 extern, 相当于 extern int func(); int main() { func(); extern int num; // 和函数声明一样, 声明一个外部的变量, 需要显式声明, 告诉编译器, find num in context printf("%d\n", num); return 0; } int num = 3; int func() { printf("hello, i'm func\n"); return 0;...
C
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <sys/un.h> #include <unistd.h> #include <string.h> int main(int argc, char *argv[]) { struct sockaddr_un sun; int ret; char buf[100]; char sockname[1000]...
C
#include <stdio.h> #include <stdlib.h> #include <math.h> struct par {double x1,x2;}; struct par gyok (double a,double b,double c) { double d = b*b-4*a*c; struct par x; if (d<0) { fprintf(stderr,"Hiba! A diszkriminans kisebb mint 0!\n"); exit (1); ...
C
#if !defined(BFS_H) #define BFS_H #include <stddef.h> #include <mpi.h> #if defined(__cplusplus) extern "C" { #endif typedef struct _bfsgraph *BFSGraph; /** Create a breadth first search context object * * This object encapsulates all the decisions about how best to implement BFS * for various number of proc...
C
#include <stdio.h> #include <string.h> #include <stdbool.h> #include "stacksADT_myself.h" int priority(char token); bool isOperator(char token); int main(){ char postfix[80] = {0,}; char temp[2] = {0}; char token; char* dataptr; STACK* stack = createStack(); printf("Enter an infix formula...
C
/* * File: TypVoisin.h * Author: maxime & awaleh * * Created on 10 octobre 2014, 14:06 */ #pragma once #include "stdbool.h" #ifdef __cplusplus extern "C" { #endif typedef int voisinT; typedef int dataT; typedef int colorT; /** * La valeur de la sentinel */ static const voisinT SENTINEL_VALUE = -1; typede...
C
#include "hash_tables.h" /** * shash_table_create - function to create a sorted hash table * @size: Size of the array * Return: Null for error or a pointer to a new hash table */ shash_table_t *shash_table_create(unsigned long int size) { shash_table_t *ht; unsigned long int i; ht = malloc(sizeof(s...
C
#include "config.h" #include <memory.h> BOOL config_load(Config *config, const char *data, uint32_t length) { memcpy(config, data, length); return TRUE; } int32_t config_get_integer(Config* config, uint32_t id) { return config->integer[id]; } BOOL config_get_boolean(Config* config, uint32_t id) { ret...
C
/* Exercise 3-2. Write a function escape (s, t) that converts characters like newline and tab into visible escape sequences like \n and \ t as it copies the string t to s. Use a switch. Write a function for the other direction as well, converting escape sequences into the real characters. */ #include <stdio.h> #inclu...
C
/* Programa: iftst01.c - track05*/ /* Este programa testa a instruo if */ #include "stdio.h" #include "stdlib.h" int main(void) { int nIdade; char sMsg[] = " Digite sua idade: "; char sMenor[] = " Vc e' menor de idade!"; char sIgual[] = " Vc tem 18 anos!"; char sMaior[] = " Vc e' maior de idade!"; char sCarta[] = " V...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* libft.h :+: :+: :+: ...
C
/* ** tekpixel.c for gfx_scroller in /gfx_scroller/src/tools ** ** Made by Antoine Baché ** Login <bache_a@epitech.net> ** ** Started on Fri Mar 18 23:30:38 2016 Antoine Baché ** Last update Sun Mar 20 22:37:35 2016 Antoine Baché */ #include <lapin.h> #include "tools/transform.h" #include "tools/common.h" void te...
C
#include"prepare.h" /*Calculate the cross product of two vectors A and B, place the result * in the vector C */ void cross(double *A,double *B,double *C) { C[0]=A[1]*B[2]-A[2]*B[1]; C[1]=A[2]*B[0]-A[0]*B[2]; C[2]=A[0]*B[1]-A[1]*B[0]; }
C
#include "common_core.h" #include "common_util.h" #include "utf8_analyzer.h" #include <string.h> static int check_bom(unsigned char* header); static int bigram_word_add(char* output, int* output_idx, int output_len, char* cur_word, char* pre_word); /* * uni_type_index м * * in : * out : ڵ *...
C
#include "two_sum.h" //#include <stdio.h> #include <stdlib.h> //for malloc //#include <assert.h> //brute force: for i for rest.. time o(n2), spaceo(1). performance impace by cpu storage (mem and disk),network //so to optimisze,we could go in this dirctions. or you will not to find a nice algo. // //int *two_sum(int *...
C
//---------------------------- Menu -------------------------------------- // It combines the files responsible for menu of a game //------------------------------------------------------------------------ // Team 2 File (Polish Group) /* This file says Team 2 File (Polish Group) However I thought that this file woul...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> double matmul(int, double*, double*, double*); int main(int argc, char **argv) { /* This is the serial main program for CPSC424/524 Assignment #3. Author: Andrew Sherman, Yale University Date: 2/01/2016 */ int N, i, j, ...
C
#include <stdio.h> //program to print table of celsius values converted to fahrenheit and fahrenheit values converted to celsius. // EX 1.15 float fahr2C(float f); float celc2F(float c); # define LOWERF -40 # define UPPERF 300 # define LOWERC -40 # define UPPERC 120 # define STEP 10 main(){ printf(" C = ...
C
#include "types.h" #include "user.h" #include "syscall.h" #include "traps.h" int main(void){ int barrier_id = 1; if(barrier_join(barrier_id) == 1){ printf(1,"My process id is: %d, and I Joined barrier %d\n", getpid(),barrier_id); }else{ printf(1,"My process id is: %d, and I Failed joining barrier %d\n", getpi...
C
#include<reg51.h> // P1 connected to LCD data pins. #define lcd P1 // pins P3.6 and P3.7 to rs and e pins of LCD display. sbit rs=P3^6; sbit e=P3^7; // pins P2.0 and P2.1 are connected to the data pins of the IR sensor. // usually these pins act as a input pins. sbit s1=P2^0; sbit s2=P2^1; // usually ...
C
/* -------------------------------------------------- Weighting functions for ESPIC AGRT 2019 Basic linear particle weighting routines -------------------------------------------------- */ // Function for weighting particles to grid // particle positions parxVec of size Npar // charge density grid of siz...
C
#include<stdio.h> int main() { char ch; ch=getchar(); while(ch != EOF) { putchar(ch+1); ch=getchar(); } puts("DONE"); return 0; }
C
#include <stdio.h> int main(int argc, char const *argv[]) { FILE* file; file = fopen("read.txt","r"); if (!file) { printf("coe lek deu merda"); return -1; } int a,b,c; //aparentemente o fscanf() da um split e pega as informações por espaço fscanf(file, "%d %d %d",&a,&b...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* print.c :+: :+: :+: ...
C
#include<stdio.h> int main() { int arr[6]={-1, -3, -5, -6, 5, 4}; int i=0, l=0, j=0, nega=0; int gg[10]={0}; for(i=0; i<6; i++) { if(arr[i]<0) { nega++; gg[nega]=arr[i]; } } for(nega=0; nega<6; nega++) printf("%d, ", gg[nega]); return 0; }
C
#include "mbed.h" // Load the mbed libraries #include "ChainableLED.h" // Driver for the LED #include "accelerometer.h" // Driver for the accelerometer Accelerometer accelerometer(10, true); ChainableLED rgbLed(D6, D7, 1); // Declare the LED (it's chainable!) Timeout pirTimeout; ...
C
#include <stdio.h> int main(void) { int i = 100; char c = 'c'; float f = 3.2; double d = 3.8; int *ap_int; char *ap_char; float *ap_float; double *ap_double; int **ap_ap_int; ap_int = &i; ap_char = &c; ap_float = &f; ap_double = &d; ap_ap_int = &ap_int; /* Os comandos a s...
C
// // main.c // 5_04 // // Created by Wonkeun No on 2020-04-11. // Copyright © 2020 genne. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include "linkeddeque.h" int insertFrontLinkedDequeChar(LinkedDeque* pDeque, char data) { DequeNode node = {0,}; node.data = data; return insertFron...
C
#include <stdio.h> #include <unistd.h> #include <string.h> #define BUFFER 1024 int main(){ char buff[BUFFER]; ssize_t num; int i = 0; while(76){ printf("[Read] Esperando lectura...\n"); //scanf("%d",&num); num = read(0,buff,BUFFER); buff[num+1] = 0; //strcat(buff,"\0"); printf("La palabra escrita...
C
/* Support for random play selection while avoiding playing inside a possible eye and some other fast checks. */ #include "config.h" #include <stdlib.h> #include <string.h> #include "board.h" #include "cfg_board.h" #include "randg.h" #include "tactical.h" /* Select random legal play. */ move random_play( cfg_b...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ast_aux.c :+: :+: :+: ...
C
#include <stdlib.h> #include <stdio.h> #define RECURSIVE int *read_sequence(char *fname, int *len) { FILE *fp; int cnt = 0; int *data_buf, *p; fp = fopen(fname, "r"); fscanf(fp, "%d", len); data_buf = (int *)malloc((*len) * sizeof(int)); p = data_buf; while (fscanf(fp, "%d", p) != EOF) { ...
C
#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <assert.h> #include <string.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include "fsops.h" #include "inode.h" #include "mfs.h" #include "dblock.h" #include "directory.h" void create_filesystem_image(char* fs_...
C
// // main.c // 匹配括号 // // Created by 汪博文 on 2019/5/4. // Copyright © 2019 汪博文. All rights reserved. // #include <stdio.h> #include <stdbool.h> #include <stdlib.h> typedef struct node{ char data; struct node* next; }node; typedef struct{ node* top; }stack; stack* createStack(); void push(stack* myStack...
C
/************************************************************************* > File Name: nixu.c > Author:foreverlong > Mail:admin@foreverlong.cn > Site:wwww.foreverlong.cn > Created Time: 2018年10月28日 星期日 08时51分34秒 ************************************************************************/ #include<stdio.h> int main...
C
/* programme (c) M Kerrisk, adapté par P. Lalevée */ #include "pse.h" #define BUF_SIZE 1024 int main(int argc, char *argv[]) { int inputFd, outputFd, openFlags, totRead; mode_t filePerms; ssize_t numRead; char buf[BUF_SIZE]; if (argc != 3) { erreur("usage: %s source destination\n", argv[0]); } ...
C
#include<stdio.h> #include<stdlib.h> #define max 50 void input(int a[][max],int new,int old) { int i,j,t; for(i=0;i<old;i++) { for(j=0;j<old;j++) { printf("\n\tEnter MATa[%d][%d] value :-",i+1,j+1); scanf("%d",&a[i][j]); } //for(j=old;j<ne...
C
#include<stdio.h> #include<stdlib.h> #include<ctype.h> #include<string.h> #define MAX 256 #define ALPHA 26 void main(void) { char str[MAX]; int alpha[ALPHA]; int i; memset(&alpha[0],'\0',sizeof alpha );//初期化 for ( ; scanf("%s",&str[0]) !=EOF; ) { for ( i = 0; str[i]!=...
C
/*marks received by student in 3 sub.and we have to find avg and percentage of * these marks*/ #include<stdio.h> int avgper(int ,int ,int ,float *,float *); int main() { int a,b,c; float avg,per; printf("Enter 3 no."); scanf("%d%d%d",&a,&b,&c); avgper(a,b,c,&avg,&per); printf("Average=%f\n",avg); printf("Percen...
C
#include <string.h> #include <stdbool.h> #include <stdlib.h> typedef struct node{ int data; struct node*next; struct node*prev; }Node; Node * head; void insert(Node *, int); void del(Node *, int); Node *find(Node *, int); void display(Node *); int main(){ //Nodo Centinela head = (Node *)malloc(si...
C
#include <stdio.h> int main(){ char c1,c2; c1=97; c2=98; printf("c1=%c\nc2=%c\n",c1,c2); printf("c1=%d\nc2=%d\n",c1,c2); return 0; }
C
/* Author & Email: Edwin M. Leon Du, eleon029@ucr.edu * Partner(s) Name: * Lab Section: 23 * Assignment: Lab 4 Exercise 2 * Exercise Description: Counter exercise * * I acknowledge all content contained herein, excluding template or example * code, is my own original work. */ #include <avr/io.h> #ifdef _SIM...
C
#include <stdio.h> int main() { char buffer[256]; char *ptr; tmpnam(buffer); printf("%s\n", buffer); ptr = tmpnam(NULL); printf("%s\n", ptr); return 0; }
C
#include <common.h> static char buf[512]; int main(int argc, char **argv) { char *fn = "/bigfile.txt"; int fd; if ((fd = open(fn, O_RDONLY, 0)) < 0) errx(-1, "open"); int i; int ret; int blks = 1000; for (i = 0; i < blks; i++) { printf("read %d\n", i); size_t c = sizeof(buf); size_t e = c; if ((ret ...
C
#pragma warning(disable:4996) #include <stdio.h> #include <malloc.h> #include "LinkQueue.h" #define MAX_VERTEX_NUM 20 #define OK 1 #define ERROR 0 typedef char VertexType; //typedef int InfoType; typedef int Status; typedef int QElemType; //߱ typedef struct ArcNode { int adjvex; //ñָλ struct ArcNode *nextarc; //ָ...
C
#include <stdio.h> #ifdef SW #include "prog.h" #else #include "vhdlCStubs.h" #endif int main() { float a, b, c, d; float res1, res2, res3; double res4, res5, res6; printf("Enter 2 floats and two doubles \n"); scanf("%f %f", &a, &b); scanf("%f %f", &c, &d); res1 = doubleDiv(a, b); printf("********************...
C
#include <stdio.h> int main(int argc, char *argv[]) { int i; //printf("\nTotal argc = %d \n",argc); for(i=1 ; i< argc ; i++){ printf("%s ",argv[i]); } printf("\n"); return 0; }
C
/* ************************************************************************** */ /* LE - / */ /* / */ /* ft_itoa.c .:: .:/ . .:: ...
C
// // Created by tobiah on 28.10.17. // #include "../data_structures/static_queue.h" #include "adaptive_huffman_node.h" void two_pass_fill_order_numbers(adaptive_huffman_tree* tree) { uint16_t count = 0; static_queue_tree_node queue; huffman_node* proto_queue[tree->tree.leaf_count]; static_queue_ini...
C
# include <stdio.h> #include <string.h> #include <stdlib.h> #define maxname 20 typedef struct {int classnum;int classpopulation;int mud[3];char name[maxname];int mudvolume;} KIDS;// define the kids type ,with mud dimensions and a name void tellpair(KIDS *,int,int);//pick up a pair from a certain class main() {...
C
/**********************************************************************/ /* Spencer Goles COEN 11 29 November 2018 Version 9.0 */ /* This program will administer a Urgent Care waiting list. */ /* It will be able to add, modify, view, and exit the linked list. */ /* Autosave feature updatin...
C
#include<stdio.h> int main() { int o,e,p,ne,i,n[5]; o =0; e = 0; p = 0; ne = 0; for(i =0;i<5;i++) { scanf("%d",&n[i]); if(n[i]%2 == 0) e++; else o++; if(n[i]>0) p++; else if(n[i]<0) ne++; } printf...
C
#include<stdio.h> main(){ int A,b=0,c=0; while(scanf("%d",&A)!=EOF){c++; if(A==1)b+=6; if(A==2)b+=13; if(A==3)if(b>=5)b-=5; if(c==3||b>=25){ if(b<25) puts("Guerraaaaa!"); else printf("Paz Mundial!\nQuantidade de tijolos: %d\n", b); b=0;c=0;fflush(stdin);} } re...
C
#include<stdio.h> int falviousjosephus(int quantity,int stepsize){ if(quantity==1){ return 1; }else{ return (falviousjosephus(quantity-1,stepsize)+stepsize-1)%quantity+1; } } int main(){ int NC,i,n,k; scanf("%d",&NC); if(NC<=30){ for(i=0;i<NC;i++){ scanf("%d %d",&n,&k); int...
C
#include <stdio.h> #include <string.h> /*hay que incluir la libreria string.h para poder usar strcmp, linea 48*/ void main() { int estado_p1 = 0, estado_p2 = 0; /*si estan a 0 es que estan libres*/ int i; char matric_p1[8], matric_p2[8]; char matricula[8]; char opcion; while (1) { printf("Selec...
C
/********************************************************************/ /* Ex9-1 - Uses functions to count the number of words in a string. */ /* */ /* Author: David Ogor */ /* Date: 07-23-2015 */ /********************************************************************/ #include <stdio.h> #inc...
C
/******************************************************************************************* * I started this racing game experiment on the iphone and with appgamekit mobile during todays f1's forumula 1 race. * * * * Situation 1 - Here I am trying to figure out when to make the bots switch lanes. Trying to m...
C
// // pandc.c // // // Created by Bakulia Kurmant on 5/8/19. // #include <stdio.h> #include <string.h> #include <pthread.h> #include <ctype.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #include <dispatch/dispatch.h> #include <semaphore.h> typedef struct { pthread_mutex_t lock; sem_t semFul...
C
#include <stdio.h> #define MAX 200 int lim; char flag; char board[MAX][MAX]; void dfs(int i, int j) { if(i<0 || j<0 || i>=lim || j>=lim || board[i][j]=='w') return; if (i>=lim-1) { flag = 1; return; } board[i][j] = 'w'; dfs(i-1,j-1); dfs(i-1,j); dfs(i,j-1); dfs(i,j+1); dfs(i+1,j); ...
C
/** * main.c - Entry point for the Recusrive Decent Parser Project * @author Gajjan Jasani * @version 04/08/2016 */ #include <stdio.h> #include <string.h> #include <stdlib.h> #define LINE 100 #define TSIZE 20 /* Global declarations */ char expression[LINE]; /* expression entered by user */ /** * Function prot...
C
// // Memory420.h // Lab02 // // Created by Aaron David Block on 1/28/19. // Copyright © 2019 Aaron David Block. All rights reserved. // #ifndef ACMemory_h #define ACMemory_h //Chars and bytes are interchangable in C, but this will make our code read easier #include <stdlib.h> #define byte char /* To declare ...
C
/*numPass=0, numTotal=5 Verdict:WRONG_ANSWER, Visibility:1, Input:"4 34 13 42 14", ExpOutput:"NO ", Output:"0 NO" Verdict:WRONG_ANSWER, Visibility:1, Input:"4 11 2 18 2", ExpOutput:"YES ", Output:"1 YES" Verdict:WRONG_ANSWER, Visibility:1, Input:"8 1 21 34 45 53 65 71 8", ExpOutput:"NO ", Output:"0 NO" Verdict:WRONG_AN...
C
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <dirent.h> int setcertificate(int argc, char** argv) { if(argc != 2) { fprintf(stderr, "Incorrect number of arguments.\n"); return 1; } char* user = malloc((strlen(argv[1])+1) * sizeof(char)); strc...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char **argv) { int n, m; scanf("%d%d", &n, &m); /* int **mat = (int **)malloc((n + 1) * (m + 1)); */ int mat[255][255]; int matr[255][255]; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) { ...
C
/* * Author: Abhiram R - CS10B060 * Circularly Linked List (Implementation) */ #include "CLinkedList.h" // Create a new empty list CLinkedList* clinked_list_new() { CLinkedList* new; new = malloc(sizeof(CLinkedList)); new->head = NULL; new->tail = NULL; return new; } // Deletes the list, frees ...
C
#include <printErrMsg.h> #include <stdio.h> #include <syslog.h> static unsigned flags = PRINT_ERR_MSG_STDERR; void printErrMsgTo(unsigned f) { f = flags; } void printErrMsg(const char *fmt, ...) { va_list al; if ( (flags & PRINT_ERR_MSG_STDERR) ) { va_start( al, fmt ); vfprintf( stderr, fmt, al ); va_end ...
C
// You may modify this file for testing but this file // will not be submitted. #include <stdio.h> #include <stdlib.h> #include <string.h> #include "utility.h" #include "shuffle.h" int main(int argc, char ** argv) { char deck[MAX_SIZE] = {'A', '2', '3', '4', '5', '6', '7', '8'}; CardDeck orig_deck = { .size = 4, ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_manage_struct.c :+: :+: :+: ...
C
/****************************************************************************** * * Module: UART * * File Name: uart.c * * Description: Source file for the TM4C123GH6PM Microcontroller - UART driver * * Author : Shams Elgohary *******************************************************************************/ ...
C
/* * Programa: prog13_09 * Autores: Jess Carretero Prez, * Flix Garca Carballeira, * Javier Fernandez Muoz, * Alejandro Caldern Mateos * Fecha: 06-2001 * Descripcin: Ejemplo del Captulo 13: * Programa ejemplo de compilacin condicional de cdigo...
C
// Adding element after a perticular value // #include <stdio.h> #include <stdlib.h> typedef struct NODE { int info; struct NODE *next; } node; void incert_after_value(node *); void traverse(node *); int main() { node *START, *temp; char ch = 'y'; START = (node *)malloc(sizeof(node)); printf("\n...
C
/******************* Problem definition **********************************/ /* Implement a program that it shows the message "Hello World" on screen. */ /*************************************************************************/ /* Here, you must include the required libraries */ #include <stdio.h> void main(){ int A,...
C
#include <xc.h> #include <stdio.h> #include <stdint.h> /* Includes uint16_t definition */ #include <stdbool.h> #include "../Settings.h" #include "SYSTEM_Driver.h" #include "ENC_Driver.h" /******************************************************************************* * DEFINES ***...
C
// CS 111 Lab 4 #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <time.h> // for clock_gettime #include <pthread.h> /* Part 1 */ static long long counter; static pthread_mutex_t lock; volatile int lock_s = 0; int opt_yield; char sync; struct Threadargs { long long counter; ...
C
/* Bud Linville 2819130 Lab 2 9/13/16 */ #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "inc/hw_types.h" #include <stddef.h> #include <stdbool.h> #include <stdint.h> #include <stdarg.h> #include "driverlib/sysctl.h" #include "driverlib/gpio.h" //External ...
C
/** * @file subsys.h * * @defgroup subsys Subsystem Module * * Created on: Mar 12, 2014 * @author: Michael * * @version 2014.03.26 changed SystemTick to SubsystemTick so the Task Management Module can own SystemTick() * @version 2.0.1 added version, setup SYSTEM subsystem, changed warning messages to pri...
C
#include "vulkan.h" void texture_init(VkDevice device, const VkMemoryType *memory_types, const texture_init_info_t *init_info, texture_t* dst) { dst->width = init_info->width; dst->height = init_info->height; dst->dirty = true; { VkImageCreateInfo info = { VK_STRUCTURE_TYPE_IMAGE_CRE...
C
/***************************************************************************** Copyright(C) Beijing Carsmart Technology Co., Ltd. All rights reserved. @file : osal_pthread.c @brief : pthread os adapt layer @author : wanglei @history: 2015-8-25 wanglei Created file 2017-10-24 pen...
C
/* Infix To Postfix Converter: A programme which takes in an infix expression (operators between numbers) and and converts it to postfix(operators after numbers). Input: A .txt file containing each of the tokens of the infix equation on a separate line. Output: A .txt file containing the converted postfix eq...
C
#ifndef STRHASH_H_ #define STRHASH_H_ #include <string.h> #include <stdlib.h> #include <stdio.h> #include <stdint.h> /* #include <limits.h> UCHAR_MAX */ /* #include "strhash_priv.h" */ #define sht_malloc malloc #define sht_realloc realloc #define sht_free free #define sht_hash _sht_oat /* types used in an entry */ ...
C
#include <stdio.h> #include <string.h> #include <stdlib.h> int assets = 0; //variabile che conta il numero di risorse totali create int counter; //variabile che conta il numero di risorse trovate in una find struct son { //struct che rappresenta i figli di una data directory char* pathname; //pathname comple...
C
// Считать из task.in строку не более 1000 символов, содержащую неотрицательные целые числа и знаки арифметических операций между ними: + - * /. // Количество арифметических действий в выражении не превышает 100. // Вычислить значение выражения и вывести его в task.out в формате %g. #include <stdio.h> void sliceShift...
C
/*Cagri Aksoy*/ #include <stdio.h> #define MAX_SIZE_OF_KEY 5U #define MAX_SIZE_OF_DATA 17U int CompareDatawithKey(int *Data) { const int glrox[MAX_SIZE_OF_KEY] = {71,76,82,79,88}; int loopVar = 0u; int loopVar2 = 0u; int foundPieces = 0u; for(loopVar = 0u ; loopVar < MAX_SIZE_OF_DATA ; loopV...
C
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be use...
C
#include <stdio.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "st_hash.h" #define ST_INFO __FILE__,__LINE__ static unsigned long prime_array[] = { 10949, /* 0 */ 21911, /* 1 */ 43853, /* 2 */ 87719, /...
C
#include <stdio.h> #include <stdlib.h> int main() { int m,i=0,j; scanf("%d", &m); int a[m]; while (i<m) { do{ scanf("%d", &a[i]); }while(a[i]%2==0); i++; } int c=0; int d=m-1; int sum; j=m/2; while (j>0) { sum=a[c]-a[d]; c++; ...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> FILE *fp; char filepath[15]; void print_prc() { char soz[15]; int i=1; fp = fopen(filepath ,"rb"); if (fp==NULL) { printf("Unable to open %s file. \n",filepath); printf("Please check whether file exists and you have enough privilige.\n"); exit(E...
C
#ifndef _FOLLOW_H #define _FOLLOW_H #include <stdio.h> #include <stdlib.h> #include <string.h> /** * \file follow.h * \brief Gestion du suivi de personnes. * Gestion du suivi des personnes grâce à des listes chaînées. */ #define TRUE 1 #define FALSE 0 typedef unsigned short ident; /** * \struct Follow follow....
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* show_alloc_mem.c :+: :+: :+: ...
C
#include <string.h> #include <stdlib.h> char *rot13 (const char *src) { size_t size = strlen(src) + 1; char *s = malloc(size); memcpy(s, src, size); char *tmp = s; for (int i=0; i<size-1; i++) { char c = *tmp; if (c >= 'A' && c <= 'Z') { c = 'A' + ((c + 13 - 'A') % 26); ...
C
//****************************************************************************** // // GSM Modem Interface to ARM7 Development Board // //****************************************************************************** // FileName: main.c // Microcontroller: LPC2148 // Compiler: Keil...
C
#include <stdio.h> #include <sys/types.h> #include <sys/shm.h> #include <sys/ipc.h> #include <string.h> #include "sem_api.c" static char msg[]="hello share memory!\n"; int main(void) { key_t key; int semid,shmid; char i,*shms,*shmc; struct semid_ds buf; int value = 0; char buffer[80]; pid_...
C
/* queue.c */ /* Do not change this file */ #include "common.h" #include "queue.h" void queue_init(node_t * queue){ queue->prev = queue->next = queue; } node_t *dequeue(node_t * queue){ node_t *item; item = queue->next; if (item == queue) { /* The queue is empty */ item = NULL; } else { /* R...
C
#include <stdio.h> #include <tchar.h> #include <SFML/Window.h> #include <SFML/Graphics.h> #include <SFML/System.h> #include <SFML/OpenGL.h> #include <SFML/Network.h> #include <SFML/Audio.h> #include "time.h" #include "windows.h" sfRenderWindow* window = 0; sfEvent event; sfSprite* LoadSprite(char* nom, int isCente...
C
/* ** EPITECH PROJECT, 2020 ** myftp ** File description: ** generic list test */ #include <criterion/criterion.h> #include <criterion/redirect.h> #include <stdio.h> #include "generic_list.h" Test(generic_list, test) { list_t list_head = NULL; int i = 5; int j = 42; int k = 3; list_add_elem_at_fr...
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include "forkutils.h" /** wraps a commands so that standard input is base64 decoded */ int main(int argc, char *argv[]) { int pfd[2], bfd[2]; pid_t ppid, bpid; if(argc<3) { fprintf(stderr,"usage: %s <string> cmd param1 param2 ...
C
/*biomass_increment.c*/ /* includes */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include "types.h" #include "constants.h" void Get_tree_BB (CELL *const c, int years) { int height; int age; int species; for ( height = c->heights_count - 1; height >= 0; height-- ) { for ( age = c->heights[he...
C
/* ====================================================================== * FILE: FILEIO.C * ====================================================================== * DATE: June 10, 1991 * DESCRIPTION: FILE IO * COMPILER: TURBO C Version 2.0 */ /* INCLUDE FILES * ===============================================...
C
#include <stdio.h> int kwad(int a) { int kwad, i; for(i=1; (i+1)<a; i++) { if(i%2!=0) { kwad = i*i; printf("%d ",kwad); } } return kwad; } int main() { int a; scanf("%d",&a); printf("%d\n", kwad(a)); return 0; }