language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include "RCC.h"
typedef struct
{
volatile u32 CR; /* Clock control register, offset = 0x00*/
volatile u32 CFGR; /* Clock configuration register, offset = 0x04 */
volatile u32 CIR; /* Clock interrupt register, offset = 0x08 */
volatile u32 APB2RSTR; /* APB2 peripheral reset register, offset = 0x0C */
volatile ... |
C | #include<stdio.h>
void printCombinations(int a[], int data[], int start, int end, int index, int r, int d[], int l)
{
if(index==r)
{
int j;
for(j=0;j<r;j++) //print the combination from collosus' set
{
printf("%d ", data[j]);
}
for(j=0;j<l;j++) //p... |
C | #include "game.h"
#include "timer.h"
#include "kbd.h"
#include "level.h"
Game* initGame() {
Game* game = (Game*) malloc(sizeof(Game));
game->result = PLAYING;
game->score = 0;
game->currLevel = 0;
game->timePerPlay = TIMEPERPLAY;
initLevels(game);
game->fundo = loadBitmap(
"/home/lcom/lcom1718-t6g08/priso... |
C | /*Scrieti un program pentru scaderea a 2 numere reale. Numarul de cifre -
pana la 1000 de ambele parti ale virgulei
Write a program for the division of 2 real numbers. Number of digits -
up to 1000 on both sides of the comma*/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
int my_strlen (char *str) {
... |
C | #include <stdio.h>
float C;
void C_to_F(float C);
int main(){
printf("Her skal vi regne om celsius til farenheit\n");
printf("Hvor mange grader celsius vil du gjøre om til farenheit?\n");
scanf("%f",&C);
C_to_F(C);
return 0;
}
void C_to_F(float C){
float F;
F = ((9.0/5.0)*C+32.0);... |
C | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
int qtd, i, soma=0;
scanf("%d", &qtd);
int num[qtd];
for(i=0; i<qtd; i++){
scanf("%d", &num[i]);
if(num[i]%2 == 0){
num[i] = +1;
} else {
num[i]= -1;
... |
C | #pragma once
#include <stdint.h>
typedef struct display display_t;
typedef struct display {
void (*draw_line)(display_t *this, uint8_t *line);
void (*show)(display_t *this);
void (*delete)(display_t *this);
} display_t ;
|
C | # 1 "MAP/SAFE-exbench/DAGGER-efm.tmp.c"
# 1 "<command-line>"
# 1 "MAP/SAFE-exbench/DAGGER-efm.tmp.c"
# 18 "MAP/SAFE-exbench/DAGGER-efm.tmp.c"
int nondet() {int i; return i;}
int X1;
int X2;
int X3;
int X4;
int X5;
int X6;
void main()
{
/*
int X1;
int X2;
int X3;
int X4;
int X5;
int X6;
*/
if (! (X1>=... |
C | void ft_swap(int *a, int *b)
{
int x;
x = *a;
*a = *b;
*b = x;
}
|
C | #include <stdio.h>
int main ()
{
float basetriangulo, alturatriangulo, areatriangulo;
printf("entre com a base do triangulo: ");
scanf("%f", &basetriangulo);
printf(" entre com a altura do triangulo: ");
scanf("%f", &alturatriangulo);
areatriangulo= (basetriangulo *alturatriangulo)/2;
pri... |
C | /*
A web client with the following command line usage
webclient url
Invoke the program with
./webclient http://localhost/
which sends a HTTP request “GET URL HTTP/1.0” to the specified URL (e.g., the local Apache http server), where URL is the command line
argument. The web client then calls shutdown(), prints ... |
C | /*
* Application.c
* Facebook username : ahmed mohamed
* Full name : ahmed mohamed mohamed
* Created on: Dec 7, 2019
* Author: Ahmed badra
*/
#include<avr/io.h>
#include<avr/interrupt.h>
#include<util/delay.h>
/*global time variables*/
unsigned char Seconds;
unsigned char Minutes;
unsigned char Hours;
/*t... |
C | #include <fsal/fsal.h>
#include <fsal/dir.h>
#include <core/filesrv.h>
#include <core/fstype.h>
#include <stdio.h>
#include <stddef.h>
#include <drivers/disk.h>
static int __open(void *path, int flags)
{
if (path == NULL)
return -1;
fsal_path_t *fpath = fsal_path_find(path, 1);
if (fpath == NU... |
C | #include "at89x52.H"
#include "UART.h"
#include "my_type.h"
#include "config.h"
/********************************************************************
ܣڳʼ
ڲޡ
أޡ
עޡ
********************************************************************/
void init_uart(void)
{
EA=0;
TMOD&=0x0F;
TMOD|=0x20; //ʱ1ģʽ2
SCON=0x5... |
C | #include <math.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "UTF8.h"
enum state_tag
{
NUMBER,
X,
POWER,
ADD,
SUB,
MUL,
DIV,
NUL
};
struct var
{
double x1;
double x2;
double constant;
};
struct ans
{
double x1;
double x2;
int flag;
}... |
C | #define IHC_IMPL
#include "IHC.h"
#include <stdio.h>
#include <stdlib.h>
static MagickWand *wand;
static MagickWand *staining_wands[NUM_CHANNELS];
int ProcessImageFiles(const char *input_fname,
const char *color_deconvolution_matrix_fname,
const char **output_fnames)
{
... |
C | #include<stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/utsname.h>
#include <limits.h>
#include <unistd.h>
#include <string.h>
#include<ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include<fcntl.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include <memory.h>
#incl... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
int num1, num2;
int year;
if (!0)
{
printf("hello!\n");
}
printf("please input year : ");
scanf("%d", &year);
if (!(year >= 1000 && year < 10000))
{
printf("year format error!\n");
return -1;
}
if (year % 400 == 0 || year %... |
C | #include <stdio.h>
#include <string.h>
void appendLetter(char msg[64])
{
char finalLetter[2];
if (strlen(msg) % 2 != 0)
{
finalLetter[0] = msg[strlen(msg) - 1] != 'X' ? 'X' : 'Y';
strcat(msg, finalLetter);
}
}
void formatMessage(char message[64])
{
for (int i = 0; i < strlen(messag... |
C | #include <stdio.h>
#include <string.h>
void
find_placeof_word( char word[], char characters[][250], int len_column, int cordinate[] );
int
find_placeof_horizontal_word( char word[], char characters[][250], int len_column, int cordinate[] );
int
find_placeof_vertical_word( char word[], char characters[][250], int len... |
C | /*
* ADAT mixer driver
*
* Copyright (c) 2013 Daniel Lopez-Arozena <dlopezaro@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 2 of the License.
*
* Cross-c... |
C | // Useful math functions
int inline abs(int val) {
return val > 0 ? val : val * -1;
} |
C | #include "holberton.h"
#include <stdio.h>
#include <stdlib.h>
/**
* argstostr - cat all the args
* @ac: integer
* @av: character
* Return: yes
*/
char *argstostr(int ac, char **av)
{
int i, j;
int buffer = 0;
int length = 0;
char *ptr;
if (ac == 0)
return (NULL);
if (av == NULL)
return (NULL);
for (i... |
C | #include<stdio.h>
int main(void){
int a, b, c;
c = a + b;
printf("sum is %d", c);
c = a * b;
printf("product is %d", c);
c = a / b;
printf("quotient is %d", c);
c = a % b;
printf("remainder is %d", c);
return 0;
}
|
C | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include "listaAdjacencia.h"
int main()
{
printf("A localidade corrente agora � %s \n", setlocale(LC_ALL, ""));
system("cls");
grafoBairros *grafo = lerArquivo("MatrizBairros.csv");
grafo = lerArquivoDistancias(grafo, "MatrizBairros.csv... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* max_byte_main.c :+: :+: :+: ... |
C | /**
* @file functions.c
* @author Federico Peccia
* @brief Example functions which will be tested
* @version 0.1
* @date 2019-08-20
*
* @copyright Copyright (c) 2019
*
*/
/**
* @brief Simple addition function
*
* @param a
* @param b
* @return int
*/
int sum(int a,int b )
{
return a+b;
}
/**
... |
C | #include "../src/calc.h"
#include "../thirdparty/ctest.h"
#include "../src/input.h"
#include "../test/calculation.h"
#include <gtk/gtk.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
double Calc(char* str, int launch, int end);
char* input;
CTEST(plus, CALCULATION)
{
const double ... |
C | #include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#define NSTACK 100
volatile int waiting_pid;
pid_t pid_stack[NSTACK];
int count=0;
void sig_ign(struct sigaction* act){
act->sa_sigaction = NULL;
act->sa_handler = SIG_IGN;
sigset_t sigset;
int sigem;
if((sigem=sigemp... |
C | #include <stdlib.h>
#include <stdio.h>
#include <pcap.h>
#include <Winsock2.h>
void bin_prnt_byte(int x)
{
int n;
for(n=0; n < 8; n++)
{
if((x & 0x80) !=0)
{
printf("1");
}
else
{
printf("0");
}
x = x<<1;
}
}
void debug_print_... |
C | /**
* @file gost89_mac.c
* @brief GOST 28147-89 emplementation.
* @author Gerasimov A.S.
*/
#include "typedef.h"
#include "crypto/gost89.h"
#include "memory/memory.h"
/**
* @brief
* Calculate MAC summ by GOST algorithm.
*
* @param ctx : [in] point to GOST context.
* @param dst : [out] buffer for o... |
C | #include"../tree.h"
void options_av(tree *t)
{
do{
printf("\n MENU : ");
printf("\n 1: Balance Factor ");
printf("\n 2: Inorder ");
printf("\n 3: Search ");
printf("\n 4: Insert ");
printf("\n 5: Delete in AVL ");
printf("\n 6: Other Displays ");
printf("\n 7: Lowest Common Ancestor ");
print... |
C | #include "common.h"
//// io ports
#define DATA_BITS_8 3
#define STOP_BITS_1 0
#define DATA_REG(n) (n)
#define INT_ENABLE_REG(n) ((n) + 1)
#define FIFO_CTRL_REG(n) ((n) + 2)
#define DIVISOR_LO_REG(n) (n)
#define DIVISOR_HI_REG(n) ((n) + 1)
#define LINE_CTRL_REG(n) ((n) + 3)
#define MODEM_CTRL_REG(n) ((n) + 4)
#define L... |
C |
/// start
#include "print.h"
#include "itoa.c"
// For memory IO
void print_char(const char c)
{
char *p = (char*)OUT_MEM;
*p = c;
return;
}
void print_string(const char *str)
{
const char *p;
for (p = str; *p != '\0'; p++)
print_char(*p);
print_char(*p);
print_char('\n');
return;
}
// For mem... |
C | /* Partner 1 Name & E-mail: Andrew Cruz acruz029@ucr.edu
* Partner 2 Name & E-mail: Jonathan Kaneshiro jkane002@ucr.edu
* Lab Section: 24
* Assignment: Lab #4 Exercise #3
* Exercise Description: [optional - include for your own benefit]
* A household has a digital combination deadbolt lock system on the doorway.
* The ... |
C | #include "rtos_hal.h"
#include "stdio.h"
#include "plp_math.h"
#include "data.h"
#include "defines.h"
void cluster_entry_i32(void* args) {
printf("Cluster entered. Compute for i32.\n\n");
int32_t result=0;
// We also count the number of cycles taken to compute it.
// This structure will hold the configurat... |
C | /*32. Find out the value of a.
a = b > c ? c > d ? 12 : d > e ? 13 : 14 : 15
for
1. b=5;c=15;d=e=8;
2. b=15;c=10;d=e=8;
3. b=5;c=15;d=e=20;
4. b=c=9;d=20;e=19; */
#include<stdio.h>
int main()
{
int a,b=5,c=15,d=8,e=8;
a = (b>c) ? ( (c>d) ? 12 : ( d>e ? 13:14)) : 15 ;
printf("a=%d\n",a)... |
C | /**
* @file command_module_util.c
* @author Alex Amellal (loris@alexamellal.com)
* @brief Utility functions for the command module
* @version 0.1
* @date 2021-11-19
*
* @copyright Dalhousie Space Systems Lab (c) 2021
*
*/
#include "command_module_util.h"
int cmd_parse(char* cmd, size_t cmd_len) {
// Get ar... |
C | /*
** incantation.c for zappy in /home/guilbo_m/rendu/PSU/PSU_2016_zappy
**
** Made by Mathis Guilbon
** Login <guilbo_m@epitech.net>
**
** Started on Sun Jun 24 14:10:14 2017 Mathis Guilbon
** Last update Sun Jul 2 00:06:59 2017 Baptiste Veyssiere
*/
#include <unistd.h>
#include "server.h"
bool incant_underway(... |
C | #include "ensemble.h"
//limitações: Esse algoritmo só funciona bem quando todos os ensembles tem o mesmo número de agrupamentos, que é igual ao número de agrupamentos alvo.
unsigned int *normalize_clusters(unsigned int *cluster,unsigned int Nelements){
unsigned int *taken = CALLOC(unsigned int,NCLUSTERSMAX);
unsign... |
C | #include <stdio.h>
#include <netdb.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>
#include "client.h"
#include "calcul.h"
void *client(void *pt)
{
ClientArgs *args = (ClientArgs *)pt;
struct sockaddr_in adr;
adr.sin_famil... |
C | #include"../header/header.h"
int hashValue(char *string)
{
// printf("\n in hashfun \n");
int count = 0;
int total = 0;
int i, res;
count = strlen(string);
for( i = 0; i < count; i++)
{
total += *(string + i);
}
res = total % 10;
return res;
//printf("\n total is =%d \n", total);
}
|
C | /**
* PLATOTerm64 - A PLATO Terminal for the Commodore 64
* Based on Steve Peltz's PAD
*
* Author: Thomas Cherryhomes <thom.cherryhomes at gmail dot com>
*
* terminal.c - Terminal state functions
*/
#include <stdbool.h>
#include <string.h>
#include "../include/terminal.h"
#include "../include/screen.h"
#defin... |
C | #include "main.h"
#include "utils.h"
#include "irc.h"
int strpos(char *needle, char *haystack) {
char *dest = strstr(haystack, needle);
return (dest - haystack) + 1;
}
int instr(const char *h, const char *n) {
return (strstr(h,n)!=NULL);
}
int instrf(const char *h, const char *n, ...) {
va_list args;
va_start(... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* errors.c :+: :+: :+: ... |
C | #include<stdio.h>
#include <unistd.h>
unsigned char swap_bits(unsigned char octet)
{
unsigned char rev;
int i = 0;
rev = 0;
while (i < 8)
{
rev |= octet & 1;
rev <<= 1;
octet >>= 1;
i++;
}
return (rev);
}
int main(void)
{
printf("%c\n", swap_bits(0b11110000));
return (0);
}
|
C | /**
Copyright 2014 Simon Zolin
*/
#include <test/tests.h>
#include <FFOS/test.h>
#define x FFTEST_BOOL
static int state;
static void test_conn_onconnect(void *userptr, int result);
static ssize_t test_conn_getvar(void *obj, const char *name, size_t namelen, void *dst, size_t cap);
static const fsv_connect_cb test_... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parse.c :+: :+: :+: ... |
C | // Reading from a file
#include<stdio.h>
int main()
{
FILE *fptr;
int c, stock;
char buffer[200],item[10];
float price;
/* myfile.txt : Inventory \n 100
Widget 0.29 \n End of List */
fptr = fopen("myfile.txt","r");
fgets(buffer,20,fptr); /* read a line */
printf("%s\n",buffer);
fscanf(fptr,"%d %s... |
C | #include<stdio.h>
#include<stdlib.h>
#define start 0
#define end 199
FILE *fout;
void display(int ar[25],int n){//function for calculating head movement
int i,cnt=0,t;
for(i=0;i<n-1;i++){
//printf("\t%d",order[i]);
t=ar[i]-ar[i+1];
cnt+=t<0?t*-1:t;
}
printf("Total head movement:... |
C | /*Задача 5.
Дефинирайте и инициализирайте int променлива = 34 и
пойнтер към нея.
Опитайте да ги разместите, като поредност (първо да е
пойнтерът, после променливата).*/
#include <stdio.h>
int main(){
int *p;/*=&a не работи защото я декларираме след пойнтера*/
int a=34;
p=&a;
printf("%d value %... |
C | #ifndef CHAR_STACK_H
#define CHAR_STACK_H
#include "minimax.h"
#define CAPACITY (3*(BOARD_SIZE))
struct CharStack {
char a[CAPACITY];
int head;
};
void
empty_stack(struct CharStack *s);
int
is_empty_stack(struct CharStack const *s);
void
push_stack(struct CharStack *s, char c);
char
peek_stack(struct Cha... |
C | /*
* Serial port setup
*/
#include <string.h>
#include "stm32f1xx_hal.h"
#include "stm32_hal_legacy.h"
#include "serial.h"
static USART_HandleTypeDef husart2;
static GPIO_InitTypeDef usart2_pins;
/* Private prototypes */
void init_usart2_pins(void);
void init_usart2_pins(void)
{
// Enable GPIOA Clock
__HA... |
C | #include <netinet/in.h> /* sockaddr_in6 */
#include <stdlib.h> /* malloc() */
#include <string.h> /* memset() */
#include "message.h"
#include "server.h"
#define COAP_MSG_MIN_SIZE 4
/* RFC 7252 - Section 4.6 */
#define COAP_MSG_MAX_SIZE 1152
#define COAP_DEFAULT_PORT 5683
void
server_run ()
{
int sockfd;
st... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "input_functions.h"
#include "meta_commands.h"
#include "virtual_machine.h"
#include "definitions/row_definition.h"
#include "definitions/table_definition.h"
int main(int argc, char* argv[])
{
Table* table = db_open(argc < 2 ... |
C | #include <stdio.h>
int main(int argc, char *argv[])
{
int i = 0;
int j = 0;
int n_check[10];
for (i=1; i<10; i++){
n_check[i] = 0;
}
for (i=1; i<argc; i++){
n_check[atoi(argv[i])]++;
}
for (i=1; i<10; i++){
if (n_check[i]>0){
printf("%d, ", i);
}
}
printf("\n");
return 0;
}
|
C | /*******************************************************************************
Algoritmos bsicos de manipulao de uma rvore de Adelson-Velskii Landis.
Os ns da rvore so decompostos e armazenam elementos do tipo TELEM.
*******************************************************************************/
#incl... |
C | /*$$$ SUBPROGRAM DOCUMENTATION BLOCK
C
C SUBPROGRAM: NUMMTB
C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23
C
C ABSTRACT: THIS ROUTINE SEARCHES FOR AN ENTRY CORRESPONDING TO IDN
C IN THE BUFR MASTER TABLE (EITHER 'B' OR 'D', DEPENDING ON THE VALUE
C OF IDN). THE SEARCH USES BINARY SEARCH LOGIC, S... |
C |
/*
this source code is for returing the days of given month
*/
#include <stdio.h>
int month_day[] = {0, 31, 28, 31, 30, 31 ,30, 31, 31, 30, 31, 30, 31};
// 0 1 2 3 4 5 6 7 8 9 0 1 2
int isLeapYear(int year)
{
return year % 4 == 0 && year % 100 != 0 || year % 400 == 0... |
C | // p_2.c
#include <stdio.h>
void hoge(int i) {
printf("%p\n", &i);
}
int main() {
int i = 100;
printf("%p\n", &i);
hoge(i);
return 0;
}
|
C | #include <assert.h>
int solution(int number) {
int total = 0;
for(int i=3; i<number; i = i+3) {
total += i;
}
for(int i=5; i<number; i = i+5) {
if (i % 3 != 0)
total += i;
}
return total;
}
// Test Code
int main (int argc, char *argv[]) {
assert(solution(10... |
C | #include <stdio.h>
#include <stdlib.h>
int add(int x, int y);
int sub(int x, int y);
int main() {
int a = 10;
int b = 20;
// Calculate sum
int sum = add(a, b);
printf("The sum of %d and %d is %d.\n", a, b, sum);
// Calculate difference
printf("The difference of %d and %d is %d.\n", a, b, sub(a,b));
... |
C | #include<stdio.h>
int main()
{
int dn,kn,i,j,m;
printf("enter the no of bits in message");
scanf("%d",&dn);
char data[dn+1];
printf("enter the data");
scanf("%s",&data);
printf("enter no of bits in key");
scanf("%d",&kn);
printf("enter the key");
char key[kn+1];
scanf("%... |
C | #include<stdio.h>
#include<con
#include<process.h>
#define size 8
int main()
{
int arr[size],r=-1,f=0,nc=0,c,x,p;
for(;;)
{
system("cls");
printf("1. Insert Rear\n");
printf("2. Delete Front\n");
printf("3. Display\n");
printf("4. Exit\n");
printf("Enter Choice : ... |
C | // ksr.c, 159
//need to include spede.h, const-type.h, ext-data.h, tools.h
#include "spede.h"
#include "const-type.h"
#include "ext-data.h"
#include "tools.h"
#include "ksr.h"
#include "proc.h"
// to create a process: alloc PID, PCB, and process stack
// build trapframe, initialize PCB, record PID to ready_que
void S... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: ... |
C | #include <inttypes.h>
#include <stdbool.h>
/*
* USAGE:
* char ipadddress_buffer[PREFIX_LENGTH]; // (16)
* memset(ip_address_buffer, 0, PREFIX_LENGTH);
* char *ip_address = "192.168.2.10";
* char mask = 20;
* get_broadcast_address(ip_address, mask, ip_address_buffer);
* printf("Broadcast address = %s\n", ip_addr... |
C | #include "included.h"
#include "stdio.h"
int plusOne(int x)
{
return factorial(x + 1) + 1;
}
int main()
{
int c;
scanf("%d", &c);
printf("%d", plusOne(c));
return 0;
}
|
C | //
// keygen.c
// Description: Creates a one-time pad keyfile of specific length, determined by user input
// Characters used as key include the 26 English alphabet, and the space character.
// Created by Brian Sia on 8/4/16.
//
//
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//main()
//intializes ran... |
C | #include "stm32l4xx.h" // Device header
int period;
float freq;
int main(void)
{
int last_value =0;
int current_value=0;
RCC->AHB2ENR |=1;
GPIOA->MODER &=~0xc00;
GPIOA->MODER |=0x800;
GPIOA->AFR[0] |=0x00100000;
//configuring TIM2
RCC->APB1ENR1 |=1;
TIM2->PSC ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Includes for process control
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
// Add custom linked list library
#include "linkedList.h"
// User input constants
#define MAX_INPUT_SIZE 9999
void manageProcessStatus(pid_t pi... |
C | #include<stdio.h>
#include<stdlib.h>
void ex1_3()
{
short sum, s = 32767;
sum = s + 1;
printf("s+1=%d\n", sum);
sum = s + 2;
printf("s+2=%d\n", sum);
} |
C | #include <stdio.h>
int main(int argc, char* argv[]) {
FILE* f = NULL;
f = fopen("Exo5.c", "r"); /* On ouvre le fichier source du code */
int c = 0;
if (f!=NULL) { /* Si le fichier est trouvé */
c = fgetc(f); /* On récupère les caractères un par un */
while (c!=EOF) { /* Tant qu'on ne tombe pas sur la ... |
C | /*
* licence kaneton licence
*
* project kaneton
*
* file /home/buckman/kaneton/libs/libia32/task/tss.c
*
* created renaud voltz [mon apr 10 01:01:34 2006]
* updated matthieu bucchianeri [sun sep 10 12:57:09 2006]
*/
/*
* ---------- information ---------------------------... |
C | /*
创建一个函数,对元素个数为n的int型数组v进行倒序排列。
void rev_intary{int v[],int n)
*/
#include <stdio.h>
void diaohuan(int a,int b){
int c = 0;
c = a;
a = b;
b = c;
}
void rev_intary(int v[],int n){
int c = 0;
// for(int i=0;i<n;i++){
// // diaohuan(v[i],v[n-(i+1)]);
// // c = v[i];
/... |
C | #include <stdio.h>
#include <math.h>
int main()
{
double a, b, c, discriminant, root1, root2, realPart, imaginaryPart;
scanf("%lf %lf %lf",&a, &b, &c);
discriminant = b*b-4*a*c;
// condition for real and different roots
if (discriminant > 0)
{
// sqrt() function returns squ... |
C | #include "stdio.h"
#include "stdlib.h"
#include "math.h"
#define RAND 200
#define POINTS 200
#define TRUE 1
#define FALSE 0
#define TOP 1
#define BOTTOM -1
#define IGNORE 0
// data structures
typedef struct Point
{
int x;
int y;
} Point;
// signatures
Point newPoint(int x, int y);
void printPoint(Point pt);
... |
C | #include<stdio.h>
#include<string.h>
int main()
{
char s[20]="abcdecf";
char s1[20];
int i,j=0;
for(i=0;s[i]!='\0';i++)
{
if(s[i]!='c')
{
s1[j]=s[i];
j++;
}
}
s1[j]='\0';
printf("%s",s1);
}
/*#include<stdio.h>
#include<conio.h>
#include<string.h>
void del(char str[], char ch);
void m... |
C | // SPDX-License-Identifier: Apache-2.0
// Copyright 2019 Charles University
#include "../theap.h"
#include <ktest.h>
#include <mm/heap.h>
/*
* Tests that kmalloc() returns a valid address. We assume
* there would be always enough free memory to allocate 8 bytes
* when the kernel starts.
*/
void kernel_test(void)... |
C | /*
** EPITECH PROJECT, 2019
** My_revstr
** File description:
** [file description here]
*/
int my_strlen(char const *str);
void my_swap_char(char *a, char *b);
char *my_revstr(char *str)
{
int nb_char;
int i;
i = 0;
nb_char = my_strlen(str) - 1;
while (i <= (nb_char / 2)){
my_swap_char(... |
C | // Praktikum EL2208 Pemecahan Masalah dengan C
// Modul : 8
// Percobaan : 2
// Tanggal : 11 Maret 2016
// Nama (NIM) : Ngakan Putu Ariastu Krisnadi Rata (13214137)
// Nama File : problem2.c
// Deskripsi : menghitung BMI user dengan inputan tinggi dan berat badanya , lalu menent... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* convert_length.c :+: :+: :+: ... |
C | #ifndef THREADSMANAGING_THREADS_MANAGER_H_
#define THREADSMANAGING_THREADS_MANAGER_H_
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
/**
* Status = 0 -> Thread da eliminare; = 1 -> Thread attivo;
*
*/
struct _thread_list_e... |
C | /*
============================================================================
Name : twr-lib-tester.c
Author : Digital Logic
Description : Tester for twr-comm library
Tester for easy SN/ID
============================================================================
*/
#include "../li... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* msh_helpers1.c :+: :+: :+: ... |
C | /*
** EPITECH PROJECT, 2017
** MY_STRNCAT.C (FOR LIB)
** File description:
** For lib: function for concatenate two strings with n caractere
*/
#include <stdlib.h>
#include "my.h"
char *my_strncat(char *dest, char const *src, int nb)
{
int i = 0;
int j = 0;
int cpt = my_strlen(dest) + nb;
char *save = malloc(size... |
C | /* devuelve la cantidad de caracteres en cadena sin contar el '\0' */
int largo_cadena(char cadena[])
{
int largo=0
while (cadena[largo]!='\0') largo++;
return largo;
}
|
C | #include<stdio.h>
int main()
{
int t,n,temp,k,arr[100],i,sum;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&arr[i]);
scanf("%d",&k);
sum=0;
for(i=0;i<k;i++)
{
scanf("%d",&temp);
sum+=arr[temp-1];
}
printf("%d\n",sum);
}
return 0;
}
|
C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "mpi.h"
#define SlaveSize 100
#define MasterSIze 100000
long int globalSum(int* vector, int size) {
long int sum = 0;
for (int i = 0; i < size; i++) {
sum += vector[i];
}
return sum;
}
int ElementsSum(int vector[], int size) {
... |
C | /*
Luke Manzitto
11/23/2020
Lab8 - Step1
Creates a file with random numbers between 0-19.
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
FILE *fp;
char buffer [sizeof(int)];
int i;
fp = fopen("testInput.txt", "w");
for (i=0; i<100; i++){
sprintf(buffer, "%d\n",... |
C | #include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include "classAnalyzer.h"
using namespace std;
mushroomAnalyzer::mushroomAnalyzer(){}
/*
* The detailed initializer of mushrronAnalyzer; using the input
* to fill-in:
* DLStat, the 3-dimensional array that stores how... |
C | /**************************************************************************
** stackapp.c
** Author: Chris Kearns
** Stack application for validating balanced [{()}] in input
** string. See algorithm at bottom of file.
** Call from command line: prog '[{()}]'
** Requires #include dynArray.h (Implementation of stack and... |
C | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int n,cont=0;
printf("informe o numero de entradas");
scanf("%d",&n);
int *v=malloc(n*sizeof(int));
int w[n/2];
for (int i=0;i<n;i++){
scanf("%d",&v[i]);
}
int k=0,f=0;
for (int i=0;i<n;i++){
for(int j=i;j<n-1;j++){
if(v[i]==v[j+1]... |
C | /************************************************************************|
| Simulação de Escalonamento de Processos com Gerenciamento de Memória |
| |---------------------------| |
| | Integrantes: | |
| | João Marcos Rosa | |... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <unistd.h>
#define MAXLINE 1000
#define NAME_LEN 20
char *EXIT_STRING = "exit";
int tcp_connect(int af... |
C | #include "dataModel.h"
//Struct
struct stParam{
char adv_name[3+1];
char val_1[6+1];
char val_2[6+1];
char val_3[6+1];
};
//struct stParam mParam[3];
//static const int mMaxDat=3;
struct stParam mParam[10];
static const int mMaxDat=10;
static const int mAdvNamesize=3;
static const int mOK_CODE =1;
static const in... |
C | /* needs stdint.h */
#ifndef UTF8_TO_UTF32_H
#define UTF8_TO_UTF32_H
static int
utf8_to_utf32(const uint8_t *utf8, uint32_t *utf32, int max)
{
unsigned int c;
int i = 0;
--max;
while (*utf8) {
if (i >= max)
return 0;
if (!(*utf8 & 0x80)) {
utf32[i++] = *utf8++;
} else if ((*utf8 & 0xe0) == 0xc0) {
... |
C | #include <stdio.h>
#include <stdint.h>
uint8_t and_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) & ((b >> 0) & 0x01);
}
uint8_t xor_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) ^ ((b >> 0) & 0x01);
}
uint8_t or_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) | ((b >> 0) & 0x01);
}
uint8_t ... |
C | /************************************************** INFO **************************************************/
/**
* \brief OpenMP implementation of a 3D version of the Game of Life by John Conway
* for the Parallel and Distributed Computing course at IST 16/17 2nd Semester
* taught by Professor José Monteiro a... |
C | #include <stdio.h>
#include <stdlib.h>
int sigma(int);
int main(void)
{
int m ;
printf("Enter an integer:\n");
scanf("%i",&m);
int answer = sigma(m);
printf("%i \n",answer);
}
int sigma(int n)
{
if(n == 0) return 0 ;
if(n == 1) return 1 ;
else return (n + sigma(n-1));
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.