language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
void titulo(){ /*Contem o Titulo do jogo "PROMPT FIGHT"*/ printf(" \xC9\xCD\xCD\xBB \xC9\xCD\xCD\xBB \xC9\xCD\xCB\xCD\xBB \xC9\xCD\xCD\xBB \xCD\xCD\xCB\xCD\xCD \t\t\xC9\xCD\xCD\xCD \xFE \xC9\xCD\xCD\xCD\xCD \xBA \xBA \xCD\xCD\xCB\xCD\xCD"); printf("\n \xCC\xCD\xCD\xBC \xBA \xBA \xBA \xBA \xBA \xCC...
C
#include "turn_angle_detection.h" #include "ev3api.h" #include "common_definition.h" #define STEER EV3_PORT_C #define DRIVE_L EV3_PORT_A #define DRIVE_R EV3_PORT_B #define IR EV3_PORT_3 #define TOUCH EV3_PORT_2 /*********************************************** * ŝ̉]px̌m **********************************...
C
#define WIN32_LEAN_AND_MEAN #include <stdlib.h> #include <stdio.h> #include <string.h> #include <winsock2.h> #include <conio.h> #include <winbase.h> #include <malloc.h> int sockfd; #define MAX_BUFF_SIZE 1000 void main(void){ struct sockaddr_in server,local; int retval,fromlen; char *Buffer; const char serverip[] = ...
C
#include "getLine.h" int getLine(char *buffer, int n, FILE *stream) { char c; int i = 0; while (1) { c = getc(stream); // if not at end of stream if (!charIsEndOfString(c)) { // then if at end of buffer if (i == (int)n-1) { ...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> /* Takes character array and size of it. Prints character of array followed by newline. */ void print_state(char *state, int size) { printf("%s\n", state); } /* Takes character array and updates the state of the array */ void update_state(char *state, in...
C
#include "infer_types.gen.c" internal Node *alloc_node(BlockGraph *block, enum uop uop) { Node *result = alloc(&block->node_pool, sizeof(Node)); result->uop = uop; return result; } typedef struct { BlockGraphPtrArray blocks; BlockGraph *main; b32 optimise; TypePool *type_pool; Pool block_pool; } ProgramGraph;...
C
#include "sw_conf.h" #include <stdint.h> #include <stdbool.h> #include "../src/gpio_driver.h" #include "../unity.framework/src/unity.h" static GPIO_Port_t portB; static GPIO_Port_t portC; static GPIO_Port_t portD; void setUp() { GPIO_Init(&portB, &portC, &portD); } void test_GpioInitsToInputWithPullUp() { TE...
C
#include "LinerIR.h" #include <assert.h> Operand newOperand(){ return malloc(sizeof(struct Operand_)); } InterCode newInterCode(){ return malloc(sizeof(struct InterCode_)); } void printOperand(FILE* f, Operand operand){ if(operand == NULL) return; switch(operand->kind){ case VARIABLE: ...
C
/** * Copyright (C) 2021 jouyouyun <jouyouwen717@gmail.com> * * 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 3 of the License, or * (at your option) any later version. * ...
C
#include "lexer.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define _PARSER_C #include "parser.h" #undef _PARSER_C static allocator_t *alloc = NULL; list_t *keyValPairs(); void keyValPair(), *key(), *val(), *array(); /** * */ json_t *JsonParse() { json_t *json = malloc(sizeof(json_t)); i...
C
/****************************************************************************** * Projekt - Zaklady pocitacove grafiky - IZG * spanel@fit.vutbr.cz * * $Id:$ */ #include "student.h" #include "transform.h" #include "fragment.h" #include <memory.h> #include <math.h> /**********************************************...
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #include"list.h" #include"canciones.h" int main(){ char archivo[20]; char nombre[41]; char artista[11]; char genero[11]; char lista[10]; char año[7]; Cancion* nuevo; List * listaCanciones; listaCanciones = createList(); i...
C
#include<stdio.h> void main() { int a,sum=0; printf("ENTER THE NUMBER :\n"); scanf("%d",&a); sum=(a*(a-1))/2; printf("THE SUM OF NOS %d IS %d",a,sum); }
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.c :+: :+: :+: ...
C
/* shuf implementation Copyright (c) 2014 Anthony DeDominic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
C
/* Алгоритм работы программы: * * 1. Явная привязка всех процессов программы к строго определенному процессору системы с помощью функции sched_setaffinity() - * необходимо для многопроцессорных и многоядерных систем для предотвращения распределения создаваемой процессами программы нагрузки * 2. Запуск UL_NUM...
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: output.c * * Description: * This file contains the function(s) that will help write the new packed * binary. The new file will be named woody and have the same access rights * as the original ELF. * * Public function(s): * ...
C
/* 2mm.c: this file is part of PolyBench/C */ #include <stdio.h> #include <unistd.h> #include <string.h> #include <math.h> /* Include polybench common header. */ #include "polybench.h" /* Include benchmark-specific header. */ #include "gemm.h" /* Array initialization. */ static void init_array(int ni, int nj, int ...
C
#include<stdio.h> #include<pthread.h> int global[2]; void *sum_thread(void *arg) { int *args_array; args_array = arg; int n1,n2,sum; n1=args_array[0]; n2=args_array[1]; sum = n1+n2; printf("Hello!!! Welcome to LPU\n"); printf("Sum = %d\n",sum); return NULL; } int main() { print...
C
/* * Fairchild FAN5702 LED driver * * Authors: Antti Partanen <aehparta@iki.fi> */ #ifdef USE_I2C #include "fan5702.h" int fan5702_open(struct i2c_device *dev, struct i2c_master *master) { /* try to detect fan5702 */ return i2c_open(dev, master, FAN5702_ADDR); } int fan5702_cfg(struct i2c_device *dev) { /* ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ppm.c :+: :+: :+: ...
C
/* * stub driver for functions convert between int, quaternary, and * vigesimal number * * project: hw3 * name: Nick Boyadjian * date: 17/6/19 * file: itoxDriver.c * notes: */ #include <stdio.h> #include <string.h> #include "itox.h" #define LINE_LENGTH 1024 // Length of each input line #...
C
#include "frog_river_one.h" #include <vector> #include "gtest/gtest.h" struct param_entry_t { param_entry_t(int X, std::vector<int> &A, int result): _X(X), _A(A), _result(result){ }; int _X; std::vector<int> _A; int _result; }; class countAbsDifferenceParameters : public ...
C
#include<stdio.h>///incomplete version remoal form sorted will be easier. int main(){ int a[512], n, l, i = 0, j, k; while(scanf("%d", &n) != EOF){ a[i++] = n; } for(j = 1; j < i; j++){ l = j; while(l != 0){ if(a[j] == a[l-1]){ for( k = j; k < i; k++){ a[k] = a[k+1]; i--; } j--; } ...
C
#include <stdio.h> struct person{ int num; char name[40]; char addr[40]; char hobby[40]; char favor[40]; }; int main(void) { struct person per; FILE *fp; int i; fp=fopen("my.bin","wb+"); while (1) { printf("학번, 이름, 주소, 취미, 음식 : "); i=scanf("%d", &per.num); if(i==EOF) break; getchar(); scanf("%s%...
C
#include <craftcore.h> void cc_entity_refresh_matrix(cc_entity_t *ent) { cc_identity_matrix(ent->matrix); cc_matrix_translate(ent->matrix, ent->px, ent->py, ent->pz); cc_matrix_rotate(ent->matrix, ent->ry, ent->rx, ent->rz); cc_matrix_scale(ent->matrix, ent->sx, ent->sy, ent->sz); } void cc_entity_init(cc_entity...
C
#include <stdio.h> #include <math.h> typedef long int INT64; /* * This is used evaulate the coefficient of (x, y) of * gcd(a, b) = a * x + b * y; */ INT64 x_coeff, y_coeff; INT64 eval_coeff(INT64 a, INT64 b) { INT64 d, temp, gcd; if (b == 0) { x_coeff = 1; y_coeff = 0; //printf("1....
C
#include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <stdlib.h> #define N 128 int main(int argc, const char *argv[]) { char buf[N] = {}; int flags; //使用fcntl函数实现非阻塞I/O //对位或者寄存器的操作,一般使用读、改、写三步 //第一步:读取文件描述符状态标志位 if((flags = fcntl(0, F_GETFL)) < 0) { perror("fail to fcntl"); exit(1); } /...
C
#include <stdio.h> #include <stdlib.h> void main() { int *numero = (int *)malloc(sizeof(int)); // aloque o espaço de um 'int', faça o casting para um valor int e guarde dentro de um ponteiro '*numero'; *numero = 1000; printf("\nvalor do conteúdo do ponteiro: %d\n", *numero); printf("Endereço que está...
C
/** * @file led.h * @author Francois Berder * @date 2017 * @copyright 3-clause BSD */ #ifndef H_CORE_LED #define H_CORE_LED #include <stdint.h> /** Index of LED's */ enum LED_INDEX { LED_0 = 0x01, LED_1 = 0x02, ALL_LEDS = 0x03 }; /** Mode of LED's */ enum LED_MODE { ON_OFF_MODE, TIMER_MODE }; /** Number ...
C
#include <stdio.h> #include <ncurses.h> #include <menu.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <string.h> #include <unistd.h> #include <pthread.h> //<- technically speaking ncurses isn't really threadsafe but it works haha... see: https://stackoverflow.com/questions/29910562/why-has-no-on...
C
#include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <sys/stat.h> #include <sys/mman.h> #include <sys/shm.h> #include "getSamps.h" long get_shared_memory_size(const char *designator){ int md; struct stat file_stat; int mode = S_IRWXU | S_IRWXG; md = shm_open(d...
C
#include <stdlib.h> #include <stdio.h> #include "init.h" #include "util.h" #include "host.h" #include "host-interpreter.h" int main(int argc, char** argv){ // Init magic if(!initBrainfuckDotCl()) fatalError("Failed to initialize Brainfuck.cl"); // Read in some BF code from some file char* code = NULL; if(!re...
C
/* * ------------------------------ * ڿ ġȯ (replace) * * ------------------------------ */ #include <stdio.h> #include <string.h> void replace(char *,char *,char *); char *search(char *,char *); int main(void) { int k; static char text[][256]={" --- ޷ ---", " Ⱑ ܿ"...
C
#include "intmath.h" //#define DEBUG #ifdef DEBUG #include "natfeats.h" #define dbg(format, arg...) do { nf_printf("DEBUG: (%s):" format, __FUNCTION__, ##arg); } while (0) #define out(format, arg...) do { nf_printf("" format, ##arg); } while (0) #else #define dbg(format, arg...) do { ; } while (0) #endif /* DEBUG */ ...
C
/************************** * ex4b2: Prime Factor Server * ============================================================================ * The factor server makes a fifo and then runs at background, * waits for input from client, calculate the prime factors by the algo * and send the result back to client * * ...
C
/** * A base object for rooms located by Spherical coordinates. * * @author devo@eotl * @alias SphericalRoomCode */ inherit RoomCode; default private variables; int *coordinates; default public functions; /** * Return the rho, theta, and phi coordinates of this room within its * containing zone. * * @r...
C
#include "funtzioak.h" void pinInit() { wiringPiSetup(); pinMode(7,INPUT);//7 pinMode(0,INPUT);//11 pinMode(1,INPUT);//12 pinMode(2,INPUT);//13 pinMode(3,INPUT);//15 pinMode(4,INPUT);//16 pinMode(5,INPUT);//18 pinMode(6,INPUT);//22 pinMode(21,INPUT);//29 pinMode(22,INPUT);//31 pinMode(26,INPUT);//32 pinM...
C
#include <pebble.h> static Window *s_main_window; static TextLayer *s_time_layer, *s_date_layer; static BitmapLayer *s_background_layer; static GBitmap *s_background_bitmap; static void update_time_and_date(){ time_t temp = time(NULL); struct tm *tick_time = localtime(&temp); static char time_buffer[] = ...
C
// // This file contains all of the implementations of the replacement_policy // constructors from the replacement_policies.h file. // // It also contains stubs of all of the functions that are added to each // replacement_policy struct at construction time. // // =======================================================...
C
#include <stdio.h> #include <stdlib.h> #include <errno.h> // Contains entries that need to be sorted #define PATH_TO_SORT "../../toSort.txt" // Contains already sorted entries #define PATH_SORTED "../../sorted.txt" static int* read_table(const char *path, int *amount) { // Reads the contents of an unsorted table ...
C
#include "holberton.h" /** * clear_bit - function to set value of a bit to 0 at given index * @n: pointer to number * @index: bit to change * Return: 1 if worked or -1 if not */ int clear_bit(unsigned long int *n, unsigned int index) { if (index >= 64) return (-1); *n &= ~(1 << index); return (1); }
C
//Esme Rubinstein and Nuriel Leve #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <ctype.h> char * convertWordBack(){ char str[100]; bool uppercasep[100]; char * newString; int len; if(scanf(...
C
#include <stdio.h> #include <unistd.h> #include <time.h> #include <stdlib.h> int mrand(int n); void mreverse(int *arr,int n); void printarr(int *arr,int n); int main(int argc,char *argv[]) { printf("随机1-100的整数,倒序打印\n"); printf("可加参数-s指定seed,-n指定范围\n"); int seed=(int)time(0); int n=100; int opt,i; while((opt=geto...
C
/* Code By: Reza Jafar Assignment: Write, in a file called mario.c in your ~/workspace/pset1 directory, a program that recreates this half-pyramid using hashes (#) for blocks. However, to make things more interesting, first prompt the user for the half-pyramid’s height, a non-negative integer no greater than 23. (The...
C
#ifndef KLIBC_LINKED_LIST_T #define KLIBC_LINKED_LIST_T #define UNCHAIN_LINKED_LIST(elem) \ if (elem->prev) elem->prev->next = elem->next; \ if (elem->next) elem->next->prev = elem->prev; #define CHAIN_LINKED_LIST(after, new_elem) \ new_elem->next = after->next; ...
C
/* ** EPITECH PROJECT, 2019 ** my_putstr_detect.c ** File description: ** réussis */ #include <unistd.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include "my.h" int my_putstr_detect (char const *str) { int i; i = 0; if (str[i] < 32) { my_putchar('/'); my_put_nbr(str[i]...
C
// // Created by YANHAI on 2019/5/20. // #include <stdio.h> double tax_calc(double income) { double tax = 0, tax_income; if (income < 0) return -1; tax_income = income - 3500; if (tax_income <= 0) tax = 0; else if (tax_income <= 1500) tax = tax_income * 0.03; else if (t...
C
#include<stdio.h> int main() { int iNo1=0,iCnt=0; printf("Enter Range UpTo:"); scanf("%d",&iNo1); for(int i=1;i<=iNo1;i++) { for(int j=1;j<=(i/2);j++) { if(i%j==0) { iCnt=iCnt+j; } } if(iCnt==i) { printf("%d\t",i); } iCnt=0; } retur...
C
/* Signed exponential Golomb encoder/decoder Part of DataCompressor Andreas Unterweger, 2013-2015 */ #include "err_codes.h" #include "io_macros.h" #include "seg.h" static const io_uint_t zeros[1] = { 0 }; static io_int_t EncodeUEGCodeword(const io_uint_t value, bit_file_buffer_t * const out_bit_buf, ...
C
/************************************************************************* > File Name: client.c > Author: fx > Mail: 1007160080qq.com > Created Time: Thu 24 Aug 2017 07:57:48 PM PDT ************************************************************************/ #include<stdio.h> #include<stdlib.h> #include<string.h> ...
C
#include <stdio.h> #include "helper.h" #include <limits.h> #include "lauxlib.h" #include "lualib.h" #define BITS_PER_WORD (CHAR_BIT * sizeof(unsigned int)) #define I_WORD(i) ((unsigned int )(i) / BITS_PER_WORD) #define I_BIT(i) (1 << ((unsigned int)(i) % BITS_PER_WORD)) typedef struct NumArray{ int size; unsi...
C
#include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <semaphore.h> sem_t s1; sem_t s2; sem_t s3; void* t1 (void* parametro) { sem_wait(&s1); printf("Ma "); sem_post(&s2); pthread_exit(NULL); } void* t2 (void* parametro) { sem_wait(&s2); printf("ra "); sem_post(&s3); pthread_exit(NULL); } void*...
C
#include <stdio.h> #include <stdlib.h> #include "bicicletas.h" #include "LinkedList.h" #include "controller.h" int main() { int opcion=0; int flagBicicleta=0; int flagTiempo=0; int flagOrden=0; char nombreArchivo[40]; LinkedList* listaBicicletas=ll_newLinkedList(); LinkedLis...
C
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <stdbool.h> #include "linkedListLib.h" struct ListNode* deleteDuplicates(struct ListNode* head) { struct ListNode* cur = head; struct ListNode* delMe; if(head == NULL || head->next == NULL) return head; while(cur->next != NUL...
C
/*prerequisite is the program should be correct*/ #include<stdio.h> #include<conio.h> int multiline=0; void remove_comment_and_print(char *s); void main() //main start { FILE *fp = fopen("rcomment.c","r"); char c[500]; int flag; clrscr(); while(NULL!=fgets(c,80,fp)) {remove_commen...
C
/* ============================================================================ Name : delta_stepping.c Author : stam Version : Copyright : Your copyright notice Description : Calculate Pi in MPI ============================================================================ */ #include <stdio.h>...
C
/* * C Program to Implement Queue Data Structure using Linked List */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <queue.h> #include <time.h> /**************************************************** * * * FUNCTION DECLARATION * * *****************************************************/ int fro...
C
/****************************************Copyright (c)**************************************************** ** ** http://www.onecm.com ** **------------------------------------File Info----------------------------------------------------------*/ /* *...
C
#include <cs50.h> #include <stdio.h> #include <string.h> #include <math.h> string lowercase(string key); bool test_alphabetic(string key); bool test_unique(string key); void make_cipher(string key); int main(int argc, string argv[]) { int error = 0; string key = argv[1]; //if no key entered set error to ...
C
/************************************************************************* > File Name: 4.2.c > Author: > Mail: > Created Time: Tue 04 Apr 2017 05:04:24 AM PDT ************************************************************************/ #include<stdio.h> #include<math.h> int main() { int n = 0; printf("请输...
C
#include "winsock2.h" #include "ws2tcpip.h" #include <stdio.h> #include <time.h> #include <string.h> #include "libs/strlib.h" #include <sys/types.h> #include <errno.h> //#include &lt;dir.h&gt; #include <direct.h> #include <sys/stat.h> #define PORT 6789 string getHeader(string filename, int length, int E...
C
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "csapp.h" #include <string.h> #include <time.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/socket.h> #include <pthread.h> #include <unistd.h> /* Recommended max cache and object sizes */ #define MAX_CACHE_SIZ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* print_arg.c :+: :+: :+: ...
C
#include <stdio.h> #define IN 1 #define OUT 0 int main(int argc, char const *argv[]){ int c, nw, state; nw = 0; state = OUT; while((c = getchar()) != EOF){ if(c == '\n' || c == ' ' || c == '\t'){ printf("\n"); } else{ printf("%c", c); } } }
C
/* ** init_server_exchange.c for in /home/renard_e/2/systeme_unix_reseaux/PSU_2016_myftp/src ** ** Made by Gregoire Renard ** Login <renard_e@epitech.net> ** ** Started on Mon May 15 16:08:44 2017 Gregoire Renard ** Last update Wed May 17 09:10:17 2017 Gregoire Renard */ #include "myftp.h" static void init_exc...
C
/* FUNCTION <<strncasecmp>>---case-insensitive character string compare INDEX strncasecmp SYNOPSIS #include <strings.h> int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); DESCRIPTION <<strncasecmp>> compares up to <[length]> characters from the string at <[a]> to the string at <[b]> in...
C
/* * Author: Chengyue Gong, Zixuan Li, Wentao Wang * Orgnization: Washington University in St. Louis */ #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <string.h> int main() { printf ("getuid returned: %d\n", getuid()); int return_val = setuid(0); pri...
C
#include "text.h" #include "mylib.h" void drawChar(int x, int y, char ch, unsigned short color) { for(int down = 0; down < 8; down++) { for(int across = 0; across < 6; across++) { if(fontdata_6x8[OFFSET(across, down, 6)+ch*48]) { setPixel(x + across, y + down, color); } } } } /* * * I didn't c...
C
//ݸʽ #include<stdio.h> int main() { int a; char c; double m,n; scanf("%lf %d %c %lf",&m,&a,&c,&n); printf("%c %d %.2lf %.2lf",c,a,m,n); return 0; }
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int numero, i; int cadenaNumero[6]; for( i = 0 ; i < 6 ; i++ ) { if(!isdigit(cadenaNumero[i])) { printf("Ingrese un numero: "); } } numero = atoi(cadenaNumero); printf("%d" , &numero); return...
C
#include "holberton.h" /** * create_file - creates a file of variable name * (permissions should be rw-------) * @filename: name of created file * @text_content: text to be written into file * * Return: 1 on SUCCESS * -1 on FAILURE */ int create_file(const char *filename, char *text_content) { int fd, wr, i,...
C
#include <stdio.h> #include <string.h> int main(void) { int a; printf("何か整数を入力してください\n"); scanf("%d", &a); a = a % 3; switch (a) { case 0: printf("余りは0です。 %d\n", a); break; case 1: printf("余りは1です。 %d\n", a); break; case 2: printf("余りは2です。 %d\n", a); break; default: printf("その値は無効です。 %d\n",...
C
// Print prime radicals of numbers. // (c) Wendy Rhodes #include <stdio.h> #include <stdlib.h> int rad(int wow) { int prod = 1; int baz = 2; int before; while (wow > 1) { before = wow; while (wow % baz == 0) { wow = wow/baz; // factor! } if (wow < before) prod = prod * baz; // produ...
C
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef int Data; typedef enum dir { no, lft, rgt } dir; enum trv { pre = 1, in = 2, post = 3 }; typedef struct _node { Data data; int id; struct _node* left; struct _node* right; } Node; typedef struct _binarytree { Node* root; Nod...
C
/* ** EPITECH PROJECT, 2019 ** my.h ** File description: ** */ #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <unistd.h> #ifndef MY_H #define MY_H typedef struct flag { char c; int (*f)(va_list*); } flag; int my_putchar(int c); int my_put_nbr(int nb); int my_putstr(char const *str); in...
C
#include <stdio.h> #include<stdio.h> struct priority_preemptive { char pn; int at, bt, ct, wt, tat, priority; int s; }pq[10]; int limit; void at_Sorting() { struct priority_preemptive temp; int i, j; for(i = 0; i < limit - 1; i++) { for(j = i + 1; j < limit; j++) { if(pq[i].at > pq[j].at) { temp = ...
C
#include "core/tint.h" tint rgb(unsigned int red,unsigned int green,unsigned int blue,unsigned int alpha) { return (tint) { .r = red, .g = green, .b = blue, .a = alpha }; }
C
#include <stdio.h> #include <string.h> #include <stdlib.h> struct linkedList { int data; struct linkedList *next; }; typedef struct linkedList *node; node q=NULL,head=NULL; node createNode(int a) { node p=(node)malloc(sizeof(struct linkedList)); p->data=a; p->next=NULL; return p; } node c...
C
#include <xc.h> #include "ST7735.h" #include "hw7.h" char message[19]; void LCD_drawchar(unsigned short x, unsigned short y, unsigned short color, char c){ int ii; int jj; if (x<124 | y<152){ for (ii=0;ii<5;ii++){ for (jj=0;jj<8;jj++){ if (ASCII[c - 0x20][ii]>>jj & 0x1){...
C
#include "box.h" /* draws an object's bounding box */ void drawBoundingBox(BoundingBox box){ /* permet d'avoir une forme sans remplissage */ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glBegin(GL_QUADS); glVertex2f(box.minX, box.maxY); glVertex2f(box.maxX, box.maxY); glVertex2f(box.maxX, box.minY); glVertex2...
C
#include <unistd.h> #include <string.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> char buf1[] = "abcdefgh"; char buf2[] = "ABCDEFGH"; char zero[] = "\0"; int main(int argc, char *argv[]) { int fd; if((fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC)) < 0) { printf("open error\n"); ...
C
#include <string.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/socket.h> #include <arpa/inet.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include "mcpack.h" #define htonll(x) ((1==htonl(1)) ? (x) : ((uin...
C
#include <avr/io.h> #include <util/twi.h> #include <avr/interrupt.h> #include "I2C_slave.h" void I2C_init(uint8_t address){ TWAR = (address << 1); // load address into TWI address register TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN); // set the TWCR to enable address matching and enable TWI, clear TWINT, ...
C
/*! \file * * \brief Simulation Functions Header File * * DESCRIPTION * Specifies functions that are used to get simulation information and start * simulations. * */ #ifndef _SIMULATION_H_ #define _SIMULATION_H_ #include "common-typedefs.h" #include <spin1_api.h> // the position and human readable te...
C
#include <stdio.h> int main() { int a; scanf("%d",&a); int b,i,j; for(i=0;;i++){ int c=0; b=a+1+i; for(j=2;j<b;j++){ if(b%j==0) {c=1; break; } } if(c!=1) break; } printf("%d",b); return 0; }
C
/* * mpu9250.c * * Created on: 24.06.2017 * Author: MyDev */ //=================================================================================================================== //====== Set of useful function to access acceleration. gyroscope, magnetometer, and temperature data //=========================...
C
#ifndef INSTRUCAO_H_ #define INSTRUCAO_H_ /* Tipos de dados e funcoes para tratar instrucoes * codificadas. */ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #define ROTULO_MAX_SIZE 32 //Maior tamanho admitido para um rotulo em codigo assembly //INSTRUCTION SET DA ARQUITETURA: #de...
C
#include <unistd.h> void ft_swap_bit(unsigned char octet) { int i = 128; unsigned char temp1 = octet >> 4; unsigned char temp2 = octet << 4; unsigned char temp = temp1 | temp2; while (i > 0) { if (temp < i) { write (1, "0", 1); i = i / 2; } else { write (1, "1", 1); ...
C
#include <stdio.h> // void InsertSort(int *arr, int len) { for (int i = 1; i < len; ++i) { int temp = arr[i]; int j = i - 1; while (j >= 0 && temp < arr[j]) { arr[j + 1] = arr[j]; --j; } arr[j + 1] = temp; } } //ϣ void ShellSort(int *arr, int len) { int increment = len; ...
C
#include <stdio.h> #include <stdlib.h> int main(int argc, char const *argv[]) { int a, *pa; a = 10; pa = &a; *pa = 20; printf("valor pa -> %i\n", *pa); printf("valor a -> %i\n", a); return 0; }
C
/* * (C) Copyright 2019-2022 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ #include <stddef.h> #include <setjmp.h> #include <stdarg.h> #include <cmocka.h> #include <daos/test_utils.h> #include <daos/checksum.h> #include <daos_srv/evtree.h> #include <daos_srv/srv_csum.h> #include <daos/test...
C
/*************************************************************************** > Filename : 019.c > Author : oneface - one_face@sina.com > Company : 一尊还酹江月 > Time : 2018-04-24 15:31:26 > Description: - This program is free software; you can redistribute it and/or modify it - under the terms of the...
C
/* Authors : Antoine Laurens, Adrien Thabuis, Hugo Viard * this file is the code for the demonstration of the PWM module */ #include <stdio.h> #include <inttypes.h> #include <unistd.h> #include "system.h" #include "io.h" // adresses to write to #define ENABLE_PWM_ADDR 0//0b000 #define PERIOD_ADDR 1//0b001...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_split.c :+: :+: :+: ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* mtrx_new.c :+: :+: :+: ...
C
// // Created by aaron on 16-11-3. // #include <stdio.h> #include <stdlib.h> #include "avltree.h" void main(void) { const int N = 16; AvlTree T = makeEmpty(NULL); int a[] = {1, 2, 3, 4, 5, 6, 7, 16, 15, 14, 13, 12, 11, 10, 8, 9}; for (int i = 0; i < N; ++i) { T = insert(a[i], T); } pos...
C
#include<stdio.h> int main(int argc, char const *argv[]) { printf("Storage size for int: %ld\n",sizeof(int)); printf("Storage size for int: %ld\n",sizeof(long)); printf("Storage size for int: %ld\n",sizeof(char)); printf("Storage size for int: %ld\n",sizeof(double)); printf("Storage size for int: %...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> typedef struct listad{ struct listad *ant; char panc; struct listad *prox; }TLISTA; TLISTA* limpalist(char *panc){ TLISTA *aux,*bef,*inicio; int tam = strlen(panc),a; for(a=0;a<tam;a++){ if(a){ if(...