language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #pragma once
#include "Point.h"
#include <cstdlib>
struct polar_point;
typedef struct
{
void (*point) (struct point*);
polar_point* (*make_polar_point) (double x, double y);
} polar_point_func_table;
typedef struct polar_point
{
point* inherited;
polar_point_func_table* vmt;
} polar_point;
polar_point* polar_po... |
C | /*
ssortdir.c - performs a selection sort on the given directory.
Copyright (C) 2002 Imre Leber
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 Lice... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// a slow dumb fib function
int fib(int n) {
if (n == 0 || n == 1) {
return 1;
}
else {
return fib(n-1) + fib(n-2);
}
}
int main(int argc, char *argv[]) {
char *a;
long x;
long f;
if (argc > 1) {
a = ar... |
C | #pragma once
struct Node {
int value;
struct Node *next;
};
typedef struct Node Node;
//
#define nodeLinkToNode(node, anotherNode) \
node.next = &anotherNode;
//
#define getValueByNodeAddress(node) \
node->value
//
#define getNextNodeByNodeAddress(node) \
node->next
//
#define moveToNextNodeBy... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_free.c :+: :+: :+: ... |
C | /**********************
*** CstTool.c ***
**********************/
#include <string.h>
#include <stdlib.h>
#include "Uigp/igp.h"
#include "CstType.h"
#include "Ubst/BstType.h"
cst_type *
cst_alloc( int byte_no )
{
cst_type *cst;
cst = (cst_type *)malloc( sizeof(cst_type) );
cst->BYTE_NO = byte_no;
if( cst->BY... |
C | #include <stdio.h>
struct things
{
char itemcode[6];
char itemname[20];
int qty;
};
int main()
{
int option,iterate;
char find;
char file[100];
FILE *f,*f2;
struct things things1;
struct things things2;
printf("do you want to add item or get item list?\npress number\n 1 = add\n ... |
C | /*
el primer d´ıa le dar´a un
c´entimo de euro, el segundo otro c´entimo de euro y a partir del tercero siempre le dar´a el doble de lo que
le dio dos d´ıas antes m´as lo que le dio justo el d´ıa antes. Jaime calcula cu´antos d´ıas tardar´a en tener el
dinero suficiente, pero... a veces se pregunta cu´anto tardar´ıa e... |
C | #include "header.h"
#include "std.h"
#include "std_io.h"
struct Type INT_TYPE() {
struct Type t;
t.type_category = INT_;
return t;
}
struct Type
CHAR_TYPE() {
struct Type t;
t.type_category = CHAR_;
return t;
}
int is_struct_or_union(const struct Type *t)
{
return t->type_category == STRUCT_NOT_UNION || t->ty... |
C |
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
void manejador(int signum)
{
switch (signum)
{
case SIGUSR1:
printf("He recibido la señal ejecuto P1 \n");
break;
c... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_put_pixel.c :+: :+: :+: ... |
C | #include <assert.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stddef.h>
#define DEBUG 0
#define debug_print(...) \
do { if (DEBUG) fprintf(stderr, ##__VA_ARGS__); } while (0)
#define ALIGNMENT 8
#define ALIGN(size) (((size) + (ALIGNMENT-1)) & ~(ALIGNMENT-1))
typede... |
C | #include <mintpl/substitute.h>
#include <mintpl/generators.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
inline static bool is_whitespace(char c) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}
static mtpl_result perform_substitution(
mtpl_generator generator,
const mtpl_al... |
C | #include <windows.h>
#include <stdio.h>
#define MAILSLOT_FORMAT "\\\\%s\\mailslot\\theslot"
void main(void)
{
HANDLE hSlot;
char aBuffer[50];
char aMailslotName[100];
DWORD dwWritten;
printf("Mailslot name: ");
scanf("%s", aBuffer);
sprintf(aMailslotName, MAILSLOT_FORMAT, aBuffer);
hSlot = CreateFile(aMailsl... |
C | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <regex.h>
#include "cJSON.c"
#define MAX 80
#define PORT 12345
#define SA struct sockaddr
int grid[3][3];
regex_t regex;
int print_grid()
{
puts("");
for (int i = 0; i < 3;... |
C | #include "unicode/unum.h"
#include "unicode/ustring.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
UErrorCode status = U_ZERO_ERROR;
UNumberFormat *fmt = unum_open(UNUM_CURRENCY, NULL, 0, "en_GB", 0, &status);
int num;
UChar ures[255];
c... |
C | /********************************************
* Pointer Arithemetic operations
* (a) Array elements are always stored in contiguous memory locations.
* (b) A pointer when incremented always points to an immediately next
* location of its type.
**************************************/
# include <stdio.h>
void ... |
C | #include <stdlib.h>
#include "utone.h"
int ut_progress_create(ut_progress **p)
{
*p = malloc(sizeof(ut_progress));
return UT_OK;
}
int ut_progress_destroy(ut_progress **p)
{
free(*p);
return UT_OK;
}
int ut_progress_init(ut_data *ut, ut_progress *p)
{
p->nbars = 40;
p->skip = 1000;
p->cou... |
C | #include <stdio.h>
#include <stdlib.h>
int bucket_union(int **, int cols, const int [cols]);
int **dynamic_alloc_2darray(int);//generate a 1 * cols 2D array
int **add_1_row(int**, int, int);//add a row to 2D array (must given cuurent size)
//(array name, how "many" rows it has, cols)
void scanfile(FILE *, int *, int ... |
C | void moveZeroes(int* nums, int numsSize) {
// 效率不高的算法,多余计算量很多
/*
int i = 0, j;
while(nums[i] != 0 && i < numsSize)
i++;
if(i < numsSize - 1)
{
j = i + 1;
while(nums[j] == 0 && j < numsSize)
j++;
if(j != numsSize)
{
nums[i] = nu... |
C | // binaschex - A library that supports converting ASCII/BINARY/HEX values
// expressed as strings. E.g. the form of '4142434445' (hex) is taken
// and converted to the binary represented by the hex digits. e.g.
// 'abcde'.
//
// (C) 2015 KB4OID Labs, A division of Kodetroll Heavy Industries
// File: binaschex.c - C Sou... |
C | #include "libft.h"
void ft_putnbr(int nb)
{
if (nb < 0){
ft_putchar('-');
nb = -nb;
}
if (nb == 0)
ft_putchar('0');
if (nb / 10)
ft_putnbr(nb / 10);
ft_putchar(nb%10 + '0');
}
/*int main()
{
int nb;
int res;
nb = 42;
ft_putnbr(nb);
}
if (nb == (0))
... |
C | #include <stdio.h>
#define XMAX 80
#define YMAX 24
unsigned char cells[YMAX][XMAX];
static void
consoleclear(void)
{
printf("\033[2J\033[2H");
}
static void
display(void)
{
int x, y;
consoleclear();
y = 0;
while (y < YMAX) {
x = 0;
while (x < XMAX) {
putchar(cells[y][x]);
x = x + 1;
}
putcha... |
C | /*
this program initializes 2 signal actions, assigns same handler to both actions.
while action1 is handled, SIGUSR2 will be blocked on delivery.
*/
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <wait.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/... |
C | #include "ioAT89C51.h"
#include "intrinsics.h"
//#include "reg52.h"
// Define pins
#define Dirctl (P0_bit.P0_7)
#define runctl (P3_bit.P3_0) // run/stop
#define run (P3_bit.P3_1) // run/stop control
#define Dir1 (P3_bit.P3_2) // direction-1
#define Dir2 (P3_bit.P3_3) // direction-2
#define Inc (P3_bit.P3_4) ... |
C | #include <stdio.h>
#include <stdlib.h>
/* Defines a tf abstract data type (ADT) */
typedef struct timeFormat tf;
/* It receives a double 'seconds' that represents an amount of time
and returns a tf ADT pointer. In the backgrounds it partitionalizes
theses seconds into days, hours, minutes, seconds, miliseconds and ... |
C | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
int my_atoi(const char *str) {
int i;
int result = 0;
int bit = 1; // 初始化為個位,即乘以 1
// 檢查是否包含非數字字符,若找到則返回 0
for (i = 0; str[i] != '\0'; i++) {
if (!isdigit(str[i])) {
return 0;
}
}
//... |
C | #include<stdio.h>
void calcular_media (int *A, int *B){
if(*A<*B){
int aux = *A;
*A = (*A+*B)/2;
*B = (aux+*B)%2;
}else{
int aux = *B;
*B = (*A+*B)/2;
*A = (*A+aux)%2;
}
}
void main(void){
int A, B;
scanf("%d %d", &A, &B);
calcular_media (&A, &B);
printf("A = %d\nB = %d", A, B);
} |
C | #include <stdio.h>
void mergeSort(int arr[], int temp[], int start, int end);
void merge(int arr[], int temp[], int start, int mid, int end);
int main(){
int arr[5] = {5,3, 6, 0, 1};
int temp[5];
mergeSort(arr, temp, 0, 4);
for(int i =0; i < 5; i++)
printf("%d ", arr[i]);
}
void mergeSort(int arr[], int temp[]... |
C | /* Check stack variations */
#include <stdio.h>
#include <stdlib.h>
/* $begin scheck-c */
int main() {
int local;
printf("local at %p\n", &local);
return 0;
}
/* $end scheck-c */
|
C | #include <stdio.h>
#include <string.h>
#define MAX_C (105)
#define infty (0x3f3f3f3f)
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
int c,s,q;
int custo[MAX_C][MAX_C];
void floyd()
{
int i,j,k;
int temp;
for (i=0; i<MAX_C; ++i)
custo[i][i]=0;
for (k=0; k<c; ++k)
... |
C | #include <stdio.h>
#include "calc.h"
#include <time.h>
const int width = 15; // 横幅
const int height = 15; // 縦幅
const int start_x = 0; // 開始x
const int start_y = 7; // 開始y
const int goal_x = 14; // 終点x
const int goal_y = 7; // 終点y
int main (void) {
clock_t start = clock();
// グリッドを生成
Grid* board_star... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int numero1=9;
float numero2;
char letra;
float suma;
printf("Ingrese un numero entero:");
scanf("%d", & numero1);
printf("Ingrese UN numero con Coma: ");
scanf("%f", & numero2);
printf("indique una letra: ");
le... |
C |
#include <unistd.h>
#include <stdio.h>
#include <dart.h>
#include "../utils.h"
#define REPEAT 5
int main(int argc, char* argv[])
{
int i;
char buf[200];
dart_ret_t ret;
dart_unit_t myid;
size_t size;
dart_init(&argc, &argv);
dart_myid(&myid);
dart_size(&size);
fprintf(stderr, "Hello World, I'm ... |
C | #include "Params.h"
#include "Misc.h"
#include "Sonar.h"
#include <errno.h> // gestion minimale des erreurs
#include <fcntl.h> // Pour le flag NON_BLOCK
#include <stdio.h>
int atoi(const char * str);
float atof(const char * str);
void close(int id);
int system(const char *string);
void usleep(int us);
char... |
C | /**
* This file, alder_file_mkdir.c, is part of alder-file.
*
* Copyright 2013 by Sang Chul Choi
*
* alder-file 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... |
C | #include <stdlib.h>
#include <stdio.h>
#include <omp.h>
int compare(double* a, double* b, int n){
for(int i = 0; i < n; i++){
if( a[i] != b[i] )
return 0;
}
return 1;
}
int main(int argc, char const *argv[]){
printf("\nMultiplicación de vectores elemento a elemento\n----------... |
C | #include <kernel/kheap.h>
#include <kernel/paging.h>
#include "frame.h"
#include <kernel/tty.h>
//static functions
static void expandHeap(uint32_t new_size, heap_t* heap);
static uint32_t contractHeap(uint32_t new_size, heap_t* heap);
static uint32_t kmalloc_internal(uint32_t size, uint32_t align, uint32_t* physical_... |
C | /*
* =====================================================================================
*
* Filename: 010-ivenvd.c
*
* Description: Calculate the sum of all the primes below two million.
*
* Version: 1.0
* Created: 2009年10月31日 03时37分21秒
* Revision: none
* Compiler: ... |
C |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define Max 100
typedef struct char10 { char c[10]; } String;
char* Roman_Numeral_Converter(int num){
String *Roman;
Roman = malloc (sizeof (String));
strcpy(Roman->c, "");
while(num != 0)
{
if (num >= 1000) // 1000 - m
... |
C | #include<stdio.h>
void main()
{
int i;
int a=0,b=1,c=2,sum;
printf("Tribonacci series upto 20\n");
printf("%d\t%d\t%d\t",a,b,c);
for(i=0;i<=17;i++)
{
sum=a+b+c;
printf("%d\t",sum);
a=b;
b=c;
c=sum;
}
}
|
C | #include<stdio.h>
int facto(int c)
{
if(c<1)
return 1;
return c*facto(c-1);
}
int Combo(int a,int b)
{
int x;
x = facto(a)/(facto(b)*facto(a-b));
return x;
}
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
printf("\n");
for(int k=1;k<n-i;k++)... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
char c1;
printf("пJ@Ӧr:");
scanf(" %c",&c1);/* sJ@Ӧr */
printf("c1=%c ASCIIX=%d\n",c1,c1); /* XrASCIIX */
system("pause");
return 0;
}
|
C | #include "DicoInstruct.h"
int sizeDico = 0;
INSTRUCTION* AllocateDico(FILE *file, int* sizeDico)
{
if(!fscanf(file, "%d", sizeDico))
return 0;
return (INSTRUCTION*)malloc(*sizeDico * sizeof(INSTRUCTION));
}
INSTRUCTION*InitializeDicoInstruct(char *nameDicoFile)
{
FILE *file = NULL;
int index... |
C | #include "queue_array.h"
#include "array.h"
#include "graph_nav.h"
//Strukt ni ska anvnda fr noderna om ni tnkt anvnda generate matrix
typedef struct {
bool visited; //br vara false fr ny nod
char *cityName; //minnet fr strngen br ha allokerats dynamiskt
} mapvertice;
//Struct fr resultatet frn generateMatrix... |
C | /*
A 42
{1, f}
{b, a, r, {2, g}}
A 84
{1, f}
{b, a, r, {2, g}}
B 126
{1, f}
{b, a, r, {2, g}}
*/
#include <stdio.h>
char g_char;
int g_int;
struct foo {
int a;
char b;
} g_foo;
struct bar {
char c, d, e;
struct foo f;
} g_bar;
int main() {
char c = 'A';
int a = 42;
struct foo f = { 1, 'f'};
struc... |
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 | #include<stdio.h>
int main()
{
int a,sum=0;
for(a=2;a<=100;a++)
{
if (a%2==0)
{
sum=sum+a;
}
}
printf("sum=%d\n",sum);
return 0;
}
|
C | #include "graph.h"
#include "config.h"
void printGraph(AdjGraph g)
{
for (int i = 0; i < MAXV; i++) {
if (g->adj[i].outDegree != -1) {
printf("%d (%d, %d): ", i, g->adj[i].inDegree, g->adj[i].outDegree);
Anode *p;
p = g->adj[i].firstarc;
while (p != NULL) {
... |
C | #include <curses.h>
int main()
{
int key;
initscr();
keypad(stdscr,1);
while(1){
key = getch();
switch(key){
case KEY_DOWN:
printw("DOWN\n");
break;
case KEY_UP:
printw("UP\n");
break;
case KEY_LEFT:
printw("LEFT\n");
break;
case KEY_RIGHT:
printw("RIGHT\n");
b... |
C | #include <stdio.h>
int main() {
int num, foundEven = 6;
scanf("%d", &num);
while (foundEven) {
if (num % 2 !=0){
printf("%d\n", num);
foundEven--;
}
num++;
}
} |
C | #include <stdio.h>
/*
Nicolas Marcondes Molina
RA:743584
exercicio lab2
*/
//escolhi usar o bubble sorte pela simples implementacao para ordenar o vetor
void insertionsort(int vetor[], int n){
int i, j, aux;
for (int i = 1; i < n; i++){
aux = vetor[i];
j = i - 1;
while ((j >= 0) && (vet... |
C |
#ifndef PIO_H
#define PIO_H
//------------------------------------------------------------------------------
// Headers
//------------------------------------------------------------------------------
#include <board.h>
//------------------------------------------------------------------------------
// ... |
C | #include <stdio.h>
#include <stdlib.h>
struct Jogador{
int passe;
int drible;
union{
int finalizacao;
int defesa;
}posicao;
};
struct Player{
char nome[20];
struct Jogador p;
};
void preenche(struct Jogador* p1,int esc){
printf("Quantos de passe[0-100]?: ");
scanf("%d",&(*p1).passe);
printf("Quanto de dri... |
C | #include <stdio.h>
#include <stdlib.h>
#define UPPER_LIMIT 100
int main()
{
// Stores whether or not the number
// If an entry is non zero, then that entry is a prime
int primes[100];
// Initialize the array
int i;
for(i = 1; i <= UPPER_LIMIT; i++) {
primes[i - 1] = i;
}
// 1 is not a prime number
primes... |
C | /*
* string_util.c
*
* Created on: 2013-7-19
*/
#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
/*
Checks if char* q starts with char* p
*/
int strstarts(const char *p, const char *q)
{
while(*p && *p == *q){
++p;
++q;
}
// if *p is null return false else return... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
enum {
Size = 40,
};
char buffer[Size];
int num;
int conv(int start){
int t;
int ret = 0;
for(t = start; t < start + 8 ; t++){
ret *= 2;
ret += buffer[t] -'0';
}
return ret;
}
int fun(){
int i;
int... |
C | #include <stdio.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
int mat[n][m];
int mat1[2][2];
int max=0;
int zbir=0;
int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
scanf("%d",&mat[i][j]);
}
}
for(i=0;i<n-1;i++)
{
for(j=0;j<m-1;j++)
{
zbir=0;
zbir+=mat[i][j];
zbir+=mat[i][j... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
float x,y;
printf("x=");
scanf("%f",&x);
if(x>0)
printf("y=1");
else if(x=0)
printf("y=0");
else printf("y=-1");
return 0;
}
|
C | #define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <float.h>
void cpp4_8_1() {
char name[40];
char family_name[40];
printf("ֺ:");
scanf("%s", name);
scanf("%s", family_name);
printf("%s%s\n", name, family_name);
}
void cpp4_8_2() {
char n... |
C | #include<stdio.h>
int main () {
int mat[3][3], INT_MENOR = 10000;
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
scanf("%i", &mat[i][j]);
}
}
printf("\n\nExibindo Matriz\n\n");
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
p... |
C | /*************************************************************************
> File Name: fork3.c
> Author:
> Mail:
> Created Time: 2018年07月28日 星期六 14时28分48秒
************************************************************************/
#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
#include<stdlib.h>
int ... |
C | #include "../includes/push_swap.h"
/*
** this function adds elements at the beginning of the list
*/
t_node *ps_add_node_front(t_node *stk, int nb)
{
t_node *element;
if ((element = (t_node *)malloc(sizeof(t_node))) == NULL)
return (NULL);
element->nb = nb;
element->next = element;
if (stk == NULL)
return ... |
C | #ifndef __STACKS_H__
#define __STACKS_H_
/* stack_int_ptr definitions */
typedef struct stack_int_ptr{
int** elems;
int ptr;
int size;
}stack_int_ptr;
stack_int_ptr* stack_int_ptr_alloc(int elems);
void stack_int_ptr_free(stack_int_ptr* pstack);
int stack_int_ptr_len(stack_int_ptr* pstack... |
C | /*************
Compile: g++ -o sender sender.c
run: ./sender -h localhost -p 1234 -f sender.c -d .1 -l .01 -j 10
************/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#inclu... |
C | /* Author: Andrew Peklar
* Title: Assingment 5 - csc60mshell
* Teacher: Prof. Nguyen
* Date: 11/25/2015
*/
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <sys/wait.h>
#include <sys/types.h>
#define MAXPATH 256
#define MAXLINE ... |
C | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "Callback.h"
#include "2dArrayCall.h"
double multiply(double x, double y)
{
return x * y;
}
double sinufy(double x, double y)
{
return sin(x) * sin(y);
}
double maxify(double x, double y)
{
return (x > y) ? x : y;
}
void func(... |
C | #include "function_pointers.h"
/**
* print_name - Function that prints a name.
* @name: Name variable to print
* @f: name of the function pointer
*/
void print_name(char *name, void (*f)(char *))
{
if (f == NULL)
return;
if (name == NULL)
return;
f(name);
}
|
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... |
C | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void print_arr(int*arr, int sz)
{
int i = 0;
for (i = 0; i < sz; i++)
{
printf("%2d", arr[i]);
}
printf("\n");
}
void bubble_sort(int* arr, int sz)
{
int i = 0;
for(i=0; i<sz-1; i++)
{
int j = 0;
for(j=0; j<sz-1-i; j++)
{
if(arr[j] > arr[j+1])
{... |
C | /*
Victor Andres Villarreal
A01039863
13/03/2020
Convert the sequence of hexadecimal numbers that the user inputs using the command line to the
corresponding decimals. User may input as many numbers as desired and any invalid number is
not converted and outputs an error message.
*/
... |
C |
#include <stdio.h>
enum weekday {
Monday=1, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
};
char *nazwa[] =
{ "",
"poniedziałek", "wtorek", "środa", "czwartek", "piątek",
"sobota", "niedziela" };
int main() {
enum weekday d;
d=Thursday;
printf("%d. dzień tygodnia to %s\n", d, nazwa... |
C | /*
* thomas_alg.c
*
* Copyright 2019 Suraj Pawar <supawar@okstate.edu>
*
* This program solves the tridogonal matrix Ax = b using Thomas algorithm. The three basic steps are
* 1. LU decomposition
* 2. Forward substitution
* 3. Backward substitution
*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h... |
C | #include <stdio.h>
#define MAX 30
#define MIN 20
int main() {
#if defined(MAX) // if MAX
printf("The maximum value : %d",MAX);
#else
printf("The minimum value : %d",MAX);
#endif
printf("\n");
#if MIN //... |
C | /*
1. Faça um programa que possua um vetor denominado A que armazene 6 numeros intei- ´
ros. O programa deve executar os seguintes passos:
(a) Atribua os seguintes valores a esse vetor: 1, 0, 5, -2, -5, 7.
(b) Armazene em uma variavel inteira (simples) a soma entre os valores das posic¸ ´ oes ˜
A[0], A... |
C | // print the transition probability table of action : 4(down) to ./action_4.csv
#include <stdio.h>
#include <stdlib.h>
int main() {
float action_1[100][100] = {{0}};
int i = 0;
int j = 0;
FILE *fp;
for(i = 10; i <= 99; ++i) // assume all get into the down cell when taking action : 4(down)
... |
C | #include <stdio.h>
#define STOP_MAX_PASS 10000
#define PRINT_LIST 0
#define BUS_MAX_PASS 250
#define MAX_STOPS 500
#define PASS_STATUS_END_LIST 255
#define PASS_STATUS_EMPTY 0
#define PASS_STATUS_TO_ARRIVE 1
#define PASS_STATUS_ARRIVED 2
#define PASS_STATUS_IN_BUS 3... |
C | #ifndef _AMF_H
# define _AMF_H
#include <stdint.h>
#include "endian.h"
#define AMF_NUMBER (0x00)
#define AMF_BOOLEAN (0x01)
#define AMF_STRING (0x02)
#define AMF_OBJECT (0x03)
#define AMF_NULL (0x05)
#define AMF_UNDEFINED (0x06)
#define AMF_ARRAY (0x08)
#define AMF_OAEND (0x09)
#define AMF_TYPEDOBJECT (0x... |
C | /******************************************************************************
*
* Copyright 2019 Barun Corechips All Rights Reserved
*
* Project : 12_IF
* Filename : main.c
* Author : sj.yang
* Version : 1.0
*
*******************************************************************************/
#include <stdio.h>... |
C | #include <stdlib.h>
#include <stdio.h>
void main() {
int A;
int B;
int C;
printf("veuillez entrer un cote AB:");
scanf_s("%d", &A);
printf("veuillez entrer un cote BC:");
scanf_s("%d", &B);
printf("veuillez entrer un cote CA:");
scanf_s("%d", &C);
if ((A + C >= B) && (B + C >= A) && (B + A >= C)) {
printf(... |
C | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Slabs memory allocation, based on powers-of-N. Slabs are up to 1MB in size
* and are divided into chunks. The chunk sizes start off at the size of the
* "item" structure plus space for a small key and value. They increase by
* a mult... |
C | // Author: Walerij Hrul
//
// Imitation of worker class implementation
//
#ifndef WORKERS_H
#define WORKERS_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include "sort.h"
#include "projects.h"
#include "project_worker.h"
#include "managers.h"
// return worker... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* sub.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define HIGH 3
#define MEDIUM 2
#define LOW 1
struct node{
int val;
int priority;
struct node* next;
};
struct node *head = NULL;
void insert(int val, int priority){
// Flag is unset when the element is added to its proper position
int ... |
C | /* NAME : FNU SHIVA SANDESH
Email : sandesh.shiva362@gmail.com
UID : 111111111
Project 2A - Summer 2017 - CS 111 */
#include <stdio.h> // for stadard in and out
#include <stdlib.h> // for Standard in
#include <string.h> // for strerror
#include <pthread.h>
#include "So... |
C | #include <stdio.h>
#include "holberton.h"
/**
* print_rev - Prints a string in reverse
* @s: The string to be reversed
*/
void print_rev(char *s)
{
while (*s != '\0')
s++;
s--;
while (*s)
{
_putchar(*s);
s--;
}
_putchar('\n');
}
|
C | #include "elf32.h"
#include "color.h"
#include "stdlib.h"
void read_Elf32_Ehdr(FILE *fp) {
printf("\n");
printf(GRAY"##############################################################################################\n"NONE);
printf("\n");
printf(GRAY" 展示 ELF32文件内容 之 ELF头(Ehdr) 结构\n");
printf("\n")... |
C | /*
* William Beasley, Chris Ragan, William Boatman, Mike Dozier, Jeff Grabowski
* Client.c
* UDP Client
*
*/
#include "Common.h"
#define RECBUFSIZE 65535
int commands[22] = {1, 2, 3, 4, 6, 4, 1, 2, 5, 4, 1,
2, 6, 4, 1, 2, 3, 4, 6, 4, 1, 2};
int sleepTimes[6] = {5, 1, 1, 1, 5, 1};
/* Args: ./client <UDP Hos... |
C | /*
һջ֪ԪصĽջУжһջԪɵǷǿܵijջС
磬ջΪ1 2 3 4ܵijջ4 3 2 11 4 3 2ȡ1 4 2 3Ͳǡ
ʽ
ӱȡ롣
һһN3N10NԪأջ1 2 3 N
ڶԿոָ1~NֵһС
ʽ
ӡ
ǿܵijջУӡYESӡNOĩҪһس
4
1 4 3 2
YES
ʱޡ
1
*/
#include<stdio.h>
enum {MAX = 10};
main()
{
int standard[MAX] = {0}, array[MAX] = {0}, i, j = 0, n;
int stack[MAX] = {0}, top = -1;
scanf("%d", &n);
for(i = 0;i < n;i++){
... |
C | //
// lab-4.server.c
// CIS 075B
//
// Created by John Towler on 5/31/11.
// Copyright 2011. All rights reserved.
//
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <setjmp.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#i... |
C | //heap sort try#2
#include<stdio.h>
int heap[100];
void heapify(int n,int i)
{
int temp;
int root=i;
int lchild=2*i+1;
int rchild=2*i+2;
if(lchild<n&&heap[lchild]>heap[root])
root=lchild;
if(rchild<n&&heap[rchild]>heap[root])
root=rchild;
if(root!=i)
{
temp=heap[i];
heap[i]=... |
C | #include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
void *thread1(void *arg)
{
while (1) {
}
}
void *thread2(void *arg)
{
while (1) {
}
}
int main()
{
pthread_t pid1, pid2;
pthread_create(&pid1, NULL, thread1, NULL);
pthread_create(&pid2, NULL, thr... |
C | /*****************************************************************************
*Author Calvin Zhuoqun Huang
*Licence MIT Licence
*File Name poly_bbst.c
*Space for Tab YES
*Tab size 4
*Time Created 30 April 2018 (Monday)
*Last Edited 30 April 2018 (Monday)
*Brief:
Poly... |
C | /*
author :: Durwasa Chakraborty
programming language :: C
programming organization :: Codechef
*/
#include <stdio.h>
#include <stdlib.h>
#define gc getchar_unlocked
long long int get_i() {
char c = gc();
while(c<'0' || c>'9') c = gc();
long long int ret = 0;
while(c>='0' && c<='9') {
ret = 10 ... |
C | // A. Compile fib objects
// cc -Wall -g -c -o fib1.o fib1.c
// cc -Wall -g -c -o fib2.o fib2.c
// B. Compile and link main
// cc -Wall -g main.c fib1.o -o main # OK
// cc -Wall -g main.c fib2.o -o main # OK
// cc -Wall -g main.c fib1.o fib2.o -o main # This will ... |
C | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <pthread.h>
#include "ppmio.h"
#include "blurfilter-pthreads.h"
#include "gaussw.h"
#include "image_utils.h"
#define MAX_RAD 1000
#define ROOT 0
/* Mutex object to use for critical section locks */
static pthread_mutex_t mu... |
C | #include "holberton.h"
/**
* rev_string(:)? (- rev string)?
*
* @s: input string
* Return: 0 or 1
*/
void rev_string(char *s)
{
char k;
int i = 0, j, l;
while (s[i] != '\0')
{
i++;
}
l = i - 1;
for (j = 0 ; j < (i / 2); j++)
{
k = s[l];
s[l] = s[j];
s[j] = k;
l--;
}
}
|
C | /* CSC 435
* Final - Diffusion openmp
*
* Author: GnuForce
*
*
*/
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
#include<omp.h>
//declaration of the variables that define the system at the beginning
// and will be used throughout the program
double mTotal, currTime, urms, D, rSize, rDiv, tStep... |
C | # include <stdio.h>
char pole[9] = { '1','2','3','4','5','6','7','8','9' };
int b = 1;
int p;
int a;
void tab(b)
{
int i;
if (b != 2) {
for (i = 0; i <= 9; i++)
{
if (i == 2 || i == 5 || i == 9)
printf("%2c\n", pole[i]);
else
printf("%2c", pole[i]);
}
}
}
void czyX(p)
{
switch (p)
{
case 1:... |
C | #include <stdio.h>
#include <stdlib.h>
void Mensagem ( int x, char *Pomodoro [ ] ) {
printf ( "%s\n", Pomodoro [ x ] );
}
int main(){
int horas,minutos,tempoSOMADO,pomodori=0,intervalo=0,sobro,A,tempo,intervaloMaior=0,B;
char nomeT[500],pontos[1];
system(" title Tecnica Pomodoro ");
static char *Pomod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.