language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #define _DEFAULT_SOURCE
#define _LARGEFILE64_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
// See https://... |
C | #include <stdio.h>
#include <stdlib.h>
int main (int argc, char const* argv[])
{
int c, n, t, i, ans;
scanf("%d", &c); // 计数输出
while (c--) {
scanf("%d", &n);
ans = 0;
for (i = 0; i < n; i++) {
scanf("%d", &t);
ans += t;
}
printf("%d\n", ans... |
C | #include <endian.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <sys/time.h>
#include <omp.h>
#define calcIndex(width, x,y) ((y)*(width) + (x))
long TimeSteps;
void writeVTK2(long timestep, double *data, char prefix[1024], long w, ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/prctl.h>
#include <time.h>
#include <inttypes.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
int temp_data = 100;
static int temp_bss;
void print_addr ( void )
{
int local_var = 100;
int *code_segment_address ... |
C | /**
* @Author: wayne
* @Date: 26-04-2017
* @Project: Expression Evaluation
* @Filename: data_structures.c
* @Last modified by: wayne
* @Last modified time: 02-05-2017
*/
#include <stdio.h>
#include <stdlib.h>
#include "data_structures.h"
/*Stack Contents*/
void stack_contents(OPSTACK *opstack, VALSTAC... |
C | #ifndef _TYPES_INCLUDED
#define _TYPES_INCLUDED
#include <stdint.h>
#include <stdio.h>
#include <string.h>
typedef unsigned char uchar;
typedef unsigned int uint;
typedef struct string_s {
uchar *str;
uint len;
} string_t;
typedef struct hash_s {
size_t size;
... |
C |
#include<stdio.h>
int main(){
int n = 16;
int soDinh = 4;
int kcach = n/soDinh;
int dem = 0;
for(int i = 0; i <= n / 2; i++){
printf("\n");
for(int j = 0; j<= n; j++){
if((j + i)% kcach == 0 || (j - i)% kcach == 0){
printf(" %d ",j);
}else {
printf(" - ");
}
... |
C | #include<dictionary.h>
int max(int a,int b){
return (a>b?a:b);
}
int height(Record* root){
if(!root)
return -1;
else
return root->height;
}
Record* singleRotateLeft(Record* x){
Record* w=x->left;
x->left=w->right;
w->right=x;
x->height=max(height(x->left),height(x->right))... |
C | #include <stdio.h>
#include <conio.h>
#include <string.h>
#define LINE_BUFFER_SIZE 102400
#define MAX_PASSWORD_LENGTH 1000
#define MAX_FILEPATH_LENGTH 1000
#define MAX_ACTION_COMMAND_LENGTH 5
int main() {
// Get passwort to be searched for
char password[MAX_PASSWORD_LENGTH];
printf("Enter ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
void create_sample_file(void){
FILE* p= fopen("sample.dat","w+");
if(p){
fclose(p);
}
}
/* *********************************** */
#define TRUE 1
typedef struct {
int month;
int day;
int year;
} date;
typedef st... |
C | #include <stdio.h>
int main(int argc, char **argv)
{
int *p;
int x = 13;
//p = (int*) 0x12ff80;
p = &x; // naslov od x
*p=42;
printf("%d\n", x);
printf("%p\n", p);
int a[10];
printf("%p %p\n", a, &a[1]);
int *pa;
pa = a;
pa[1] = 7; // isto kot *(pa+1)=7, a[1]=7
printf... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int age = 15;
if(age >= 18) //si l'âge est supérieur ou égale à 18...
{
printf("vous êtes majeurs !\n");
}
else //sinon...
{
printf("Ah c'est bête, vous êtes mineurs...\n");
}
return 0;
}
|
C | // c0027
// by @thititon
// status: approved by @kewaleeeiei
#include<stdio.h>
int main(){
int month[12]={31,28,31,30,31,30,31,31,30,31,30,31},i,m,d,day,sta=0;
printf("input : ");
scanf("%d",&day);
d=day;
if (day<1 || day>365){
sta=1;
printf("output : Error.");
}
else{
for(i=0,m=1;i<12;i++){
... |
C | /*7- Escreva um pequeno programa que l do teclado uma string e imprimir quantos caracteres dessa string so dgitos. Por
exemplo:
ENTRADA: "Niteri, 06 de maro de 2004" EXIBIR: A frase "Niteri, 06 de maro de 2004" tem 6 dgitos*/
#include <locale.h>
#include <string.h>
#include <stdio.h>
#include <conio.h>
int mai... |
C | /*20. Write a program to find sum of n elements entered by the user. To write this program,
allocate memory dynamically using malloc() / calloc() functions or new operator.
*/
#include <stdio.h>
#include <stdlib.h> //included for memory allocation
int main(){
int n, sum = 0;
int*ptr; //declaring pointer to... |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
// I ran command "ulimit -n 50" before running this program
int main()
{
int i=0, j=0;
for(i=0; i< 100; i++)
{
j=open("fork.c", O_RDONLY);
if(j == -1)
{
perror("Error");
break;
}
... |
C | #include <stdio.h>
#include <string.h>
#include "mpi.h"
int main(int argc, char *argv[])
{
int name, p;
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD, &name);
MPI_Comm_size(MPI_COMM_WORLD, &p);
printf("Hola mundo, desde el proceso %d de %d\n",name,p);
MPI_Finalize();
return 0;
}
|
C | #include <stdio.h>
int main()
{
int num, f1, f2, f3;
do {
printf("Digite um numero: ");
scanf("%d", &num);
if(num<=0) {
printf("\nDigite um numero positivo!");
}
} while (num<=0);
printf("\n0 - 1 - ");
f1=0;
f2=1;
num=num-2;
for(int cont=0; cont<=num; cont... |
C | #include "MultiStage.h"
void init_Graph_MS(pG_MS *pG, int vexnum, int edgnum)
{
int i,j;
(*pG)->vexnum = vexnum;
(*pG)->edgnum = edgnum;
(*pG)->matrix = (int **)malloc(sizeof(int *)*vexnum);
(*pG)->vmsg = (VerMsg *)malloc(sizeof(VerMsg)*(vexnum+1));
//邻接矩阵初始化
for(i=0; i<vexnum; i++)
{
(*pG)->matrix[i] = (int... |
C | #include<stdio.h>
int main(void)
{
float number;
printf("Enter a floating-point value:");
scanf_s("%f",&number);
printf("fixed-point notation:%f\n",number);
printf("exponential notation:%e\n", number);
printf("p notation:%a", number);
return 0;
}
|
C | /*A Distribuidora de Combustíveis Ave Maria ira dar um aumento
em função da quantidade de combustível comprado anualmente por
seus clientes.
Os postos que consomem em média até 50.000 litros de combustível
ao mês, terão aumento de 20%. Os postos que consomem acima desta
média, 12% de aumento. A distribuidora ira forne... |
C | #ifndef LIST_H_INCLUDED
#define LIST_H_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <locale.h>
#define M 124
#define N 5
struct LNode
{
int id;
char *name;//
char *surname; //
int age; //
int number; //
float salary; // (. )
float... |
C | #include<stdio.h>
#include"SLinkList.h"
int main(void)
{
int a1[6] = {1,2,3,4,5,6};
SLinkList SL;
int e;
InitSList(SL);
CreatSList(SL,6,a1);
PrintSList(SL);
//Clear
ClearSList(SL);
PrintSList(SL);
if(SListEmpty(SL))
printf("链表空\n");
else
printf("链表非空\n");
//
InitSList(SL);
CreatSList(SL,6,a1);
P... |
C | #include "holberton.h"
/**
* flip_bits - returns the number of bits you would need to flip to get
* @n: first number
* @m: second number
* Return: returns the number of bits you would need to flip to get from one
*/
unsigned int flip_bits(unsigned long int n, unsigned long int m)
{
unsigned long int flip, i, j =... |
C | // max-subarray.c
#include <stdio.h>
#include <assert.h>
#include <limits.h>
#include "max-subarray.h"
static void max_subarray_int_cross (const int* array, size_t start, size_t mid, size_t end, max_subarray_result_int_t* result)
{
assert((start < mid) && (mid < end));
int left_sum = INT_MIN;
int sum = 0... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstmap.c :+: :+: :+: ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi_base.c :+: :+: :+: ... |
C | void Get_grey_index();
void Get_grey_index()
{
int j,k;
struct Grey_indices *select,*probable,*reject;
struct Grey *grey_priority;
float index;
//calculating the grey index in select category
select=head_select;
for(j=0;j<AIRPORT_NO;j++)
{
select->grey_index=0;
... |
C | //***************************************************
/** while文 課題
* https://monozukuri-c.com/langc-while/
* 10月29日
*/
//***************************************************
#include <stdio.h>
void swap(int *x, int *y)
{
int temp = *x;
*x = *y;
*y = temp;
};
void calc_lcm(int num1, int num2)
{
int... |
C | #include <stdio.h>
#include <stdlib.h>
int is_leap_year(int year)
{
return (year%4==0)&&(year%100!=0)||(year%400==0);
}
int main(void)
{
int year, month, day, n;
int numdaysmonth[]={31,28,31,30,31,30,31,31,30,31,30,31};
printf("Current date <year month day>? ");
scanf("%d%d%d",&year,&month,&day);
if(month<=0|... |
C | #include <stdio.h>
#include <pthread.h>
int a,b;
void add(){printf("a+b: %d\n", a+b);}
void sub(){printf("a-b: %d\n", a-b);}
int main(){
printf("Enter a, b\n"); scanf("%d%d",&a,&b);
pthread_t tid1,tid2;
printf("--> Main process\n");
pthread_create(&tid1,NULL,add,NULL);
pthread_create(&tid2,NULL,sub,NULL);
pthre... |
C | /*************************************************************************
*
* @FileName Csr1010.c
* @Date 2017.03.10
* @Author DS.Chin
* @Description
* Communicate to CSR1010
* Receive data from APP
* Send dato to APP
*
***********************************************************************... |
C | #include <stdio.h>
#include <string.h>
#include "helpers.h"
#include "rle.h"
/*************************************************************
* FUNCTIONS DEFINED FOR THE PURPOSE OF MANIPULATING RLE
* OBJECTS
*************************************************************/
/**********************... |
C | //
// Created by 网安 胡洋 on 2020/10/6.
//
#include "header.h"
#include "stdio.h"
#include "stdlib.h"
AST* makempty(){
AST* p;
if(p = malloc(sizeof(AST))){
p->type = 0;
p->value = 0;
p->fellow = 0;
p->firstson = 0;
return p;
}
else {
printf("cant make empty ... |
C | #include "main.h"
/**
* puts2 - print string by first charactert on line others nextline
* @str: string
*/
void puts2(char *str)
{
int i;
i = 0;
while (*(str + i) != '\0')
{
if (i % 2 == 0)
_putchar(*(str + i));
i++;
}
_putchar('\n');
}
|
C | #ifndef _PROBUTILS_H
#define _PROBUTILS_H
/* =================================================================== */
/* Probability Utils */
/* =================================================================== */
/* GetCND */
/* ------ */
/* This gets us the cumulati... |
C | #include "scheduler.h"
#include <stdio.h> /* required for file operations */
#include <time.h>
#include <stdbool.h>
#include "configLoad.h"
#include "print2screen.h"
#include "mathAlgo.h"
static volatile int dummy;
scheduler_t sData;
static bool initDone ;
void init_threads();
threadData_t Athread;
threadData_t Bthr... |
C | #include <locale.h>
#define CHAR_MAX 127
struct lconv* localeconv(void)
{
static struct lconv lc;
struct lconv *lcp = &lc;
lcp->decimal_point = ".";
lcp->thousands_sep = "";
lcp->grouping = "";
lcp->int_curr_symbol = "";
lcp->currency_symbol = "";
l... |
C | #include "monty.h"
/**
* sub- 2nd - 1st = 2nd
* @line:line arguments came from
* @head:input
*/
void sub(stack_t **head, unsigned int line)
{
stack_t *temp;
if ((*head) == NULL)
{
dprintf(STDERR_FILENO, "L%u: can't sub, stack too short\n", line);
quickExit(*head, willy.words, EXIT_FAILURE);
}
if ((*head)... |
C | /*
* forkex.c - an example of using fork to create processes and execute new tasks
* Author: Jordan Long
*
*/
#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
/**
* count the number of arguments.
*/
int countArguments(const char *commandLine)
{
int num=0;
ret... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* func_misc.c :+: :+: :+: ... |
C | /** Function to shift the current view to the left/right.
*
* http://lists.suckless.org/dev/1104/7590.html
*
* @param: "arg->i" stores the number of tags to shift right (positive value)
* or left (negative value)
*/
void
shiftview(const Arg *arg) {
Arg shifted;
if(arg->i > 0) // left circular shift
... |
C | #include "mylib.h"
int main() {
/*
int age;
char name[100];
int count = sscanf("name:ccc age:51", "name:%s age:%d", name, &age);
printf("count=%d\n", count);
printf("name=%s age=%d\n", name, age);
*/
char op[100];
int lmin, lmax;
int count = sscanf("list 3 5", "%s %d %d", op, &lmin, &lmax);
printf("c... |
C | #include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
void neuralops_image_crop(
size_t in_width,
size_t in_height,
size_t chan,
size_t crop_w,
size_t crop_h,
ptrdiff_t offset_x,
ptrdiff_t offset_y,
const float *in_pixels,
float *out_pixels)
{
size_t p = 0;
for (size_t a =... |
C | #include <stdio.h>
#include <gsl/gsl_blas.h>
typedef unsigned int bool;
#define false 0
#define true 1
//gcc -Wall -02 mpenrose.c -o penrose -lgsl -lgslcblas -lm
// Función que muestra en consola una matriz (estructura propia de libreria gsl)
void mostrar_matriz(const gsl_matrix *m) {
for (int i = 0; i < m->siz... |
C | #include <stdio.h>
int pow_self(int x,int n){
int mul=1;
while(n){
mul*=x;
n--;
}
return mul;
};
int main(){
int m,n;
printf("Enter base and power : ");
scanf("%d %d",&m,&n);
printf("The result is : %d",pow_self(m,n));
return 0;
} |
C | #include <lib.h>
#include <stdlib.h>
#include "thread_queue.h"
#include "../scheduler.h"
typedef struct thread_queue_node * thread_queue_node_t;
typedef struct thread_queue * thread_queue_t;
struct thread_queue_node
{
thread_t thread;
void * extra_info;
thread_queue_node_t next;
thread_queue_node_t prev;
};
... |
C | #include<stdio.h>
#include<conio.h>
#define size 10
int main(){
int a[size];
int i, large;
printf("Enter 10 Numbers: \n");
scanf("%d",&a[0]);
large = a[0];
for(i=1;i<size;i++){
scanf("%d",&a[i]);
if(a[i]>large){
large = a[i];
}
}
printf("\n %... |
C | /****************************************************************************
* *
* Secure Memory Management *
* Copyright Peter Gutmann 1995-2015 *
* *
****************************************************************************/
#if defined( INC_ALL )
#includ... |
C | #include<stdio.h>
int fact(int n)
{
int i,fact=1;
for(i=1;i<=n;i++)
fact*=i;
return fact;
}
int rec_fact(int n)
{
if(n==0||n==1)
return 1;
else
return n*rec_fact(n-1);
}
int main()
{
int n;
printf("Enter a number\n");
scanf("%d",&n);
printf("Factorial of %d using non recursive funct... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_sets.c :+: :+: :+: ... |
C | /*Scrivere un programma che legge da tastiera 5 numeri interi
e scrive sullo schermo la loro somma e la loro media.
Il programma dovra' utilizzare solo 2 variabili .
*/
#include <stdio.h>
int main()
{
int numero;
int somma = 0;
printf("Inserisci 5 numeri e ti dirò somma e media\n");
for(int i=0; i<5; ... |
C | // Obj /d/ruzhou/npc/obj/jiuxi.c
// llm 99/07/09
inherit ITEM;
#include <ansi.h>
void create()
{
set_name("酒席", ({ "jiuxi" }));
if( clonep() )
set_default_object(__FILE__);
else
{
set("long", "這是一桌五色齊全、香味四溢、豐盛的酒席。\n"
HIG"八味拼盤(pingpan) 珍品杲羹(guogeng) 紅燒蹄膀(tipang)\n"
"松... |
C |
/*******************************************Libraries************************************/
#include <stdio.h>
/**************************************Function Prototypes*******************************/
int factorial( int n );
/*********************************************Main**************************************... |
C | #include "pwa.h"
#include "pwa_config.h"
#include "typedef.h"
s16 pwa_interp(PWA_CONST_SEG_ATTR const pwa_descriptor_t *pwa, s16 x)
{
/* calculate 'x' relative to start of the domain */
/* cast to u16 to enforce modular arithmetic instead of integer overflow */
u16 dx = (u16)x - (u16)pwa->min_d;
u16 idx;
s1... |
C | #include <stdio.h>
#include <stdlib.h>
void plustwo(int one, int two);
int main(int argc, char const *argv[]) {
/* code */
int one = atoi(argv[1]);
int two = atoi(argv[2]);
plustwo(one, two);
return 0;
}
void plustwo(int one, int two) {
int t = one + two;
printf("(%d) + (%d) = %d\n",one, two, t);
}
|
C | #include "structure.h"
#include "vecteur.h"
#include "traitement.h"
#include "pile.h"
neurone* allouer_neurone(int nbrPoint){
neurone *n = malloc(sizeof(neurone));
n->v = malloc(nbrPoint*sizeof(double));
// n->distance = 0;
n->nom = malloc(64*sizeof(char));
return n;
}
int nbrNeurone(int nbrVecteur){
return 5*... |
C | /*Mateus Agostinho dos Anjos
//NUSP: 9298191
//Compilado com: gcc -Wall -ansi -pedantic -O2 -o ep1 ep1.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/*constantes utilizadas
*/
#define gap -2
#define mismatch -1
#define match 1
#define SPACE '-'
/*variaveis globais
*/
char *alignS... |
C | #include "link_list.h"
typedef ListNode* PtrToListNode;
#pragma region 通用
//-----------------------------------------------------
void ListError(const char* errMsg)
{
perror(errMsg);
}
//-----------------------------------------------------
void ListFailError(const char* errMsg)
{
perror(errMsg);
exit(-1);
}
//---... |
C | /*******************/
/* ͼƬļϳ */
/*******************/
/* ļԶƵʽȡԶƵʽд뵽һļУʵһļݣͨĺļij */
#include <stdio.h>
#include <stdlib.h>
int main4()
{
FILE *f_pic, *f_file, *f_finish;
char pic_name[20], file_name[20], finish_name[20], ch;
printf("Please input compose image name: ");
scanf("%s", pic_name);
printf("\nPlease i... |
C | #include <stdio.h>
#define MAX_LINEA 80
#define MAX_FRASE 40
int main(int argc, char *argv[]) {
int a, b;
char frase[MAX_FRASE+1];
char linea[MAX_LINEA+1];
printf("Dame el valor de un entero: ");
gets(linea); sscanf(linea, "%d", &a);
printf("Introduce ahora una frase: ");
gets(frase);
printf("Ahora dame ... |
C | #include "../includes/ft_printf.h"
int ft_printf(const char *format, ...)
{
t_printf list;
int i;
int j;
i = 0;
va_start(list.argc, format);
list.i = 0;
list.format = (char *)format;
init_struct_functions(&list);
init_display_functions(&list);
list.count = 0;
while (list.format[list.i] != '\0')
{
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* util.c :+: :+: :+: ... |
C | #include "edna.h"
size_t
bufgetpos(Buffer *buf)
{
assert(buf != NULL);
return buf->pos;
}
size_t
bufgetlen(Buffer *buf)
{
assert(buf != NULL);
return buf->len;
}
Line *
bufprobe(Buffer *buf, size_t off)
{
assert(buf != NULL);
if (off > buf->len) return NULL;
return walk(buf->top, off);
}
int
bufseek(Buff... |
C |
//a153: T902****************************************************************************************************
/*
#include <iostream>
using namespace std;
int main() {
printf("數字: 16 40 38 6 30 11");
}
*/
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main() {
int a[6], i, j;
srand(time(NULL));
... |
C | #include <stdio.h>
#ifndef N
#define N 256
#endif
int findFirstRepeated(unsigned char[]);
int main(void)
{
findFirstRepeated("0012");
return 0;
}
int findFirstRepeated(unsigned char sentence [])
{
unsigned char allChars [N] = {0}; //arreglo de caracteres para contar en 0's
unsigned char *ptr;
unsigned char... |
C | /*
* main.c
*
* Created on: 31 May 2016
* Author: ajuaristi <a@juaristi.eus>
*/
#include <stdio.h>
#include <signal.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/videodev2.h>
#include <sys/stat.h>
#include "utils.h"
#include "appbase.h"
#include "uvc.h"
#... |
C | #include<stdio.h>
#include<stdbool.h>
/**
* Definition for singly-linked list.
*/
struct ListNode {
int val;
struct ListNode *next;
};
struct ListNode* removeElements(struct ListNode* head, int val){
struct ListNode *pNode = head;
struct ListNode *pCur = NULL;
struct ListNode *pPre = NULL;
i... |
C | #include <stdio.h>
#include <signal.h>
void handler(int signo) {
// unsafe, just for demo
printf("handler\n");
}
/**
* Demonstrates that custom handlers for SIGCONT are deferred until SIGCONT is
* unblocked, even though the signal will still wake the process immediatley
*/
int main(int argc, char* argv[]){
sigs... |
C | /*-----------------------------------------------------------------
LOG
GEM - Graphics Environment for Multimedia
GemFuncUtil.h
- contains functions for graphics
- part of GEM
Copyright (c) 1997-2000 Mark Danks. mark@danks.org
Copyright (c) Gnther Geiger. geiger@epy.co.at
Copyright (... |
C | #include "mds.h"
/*
* Create the two main hashes "file hash" and "client hash"
*/
void mds_init() {
mds_files = fh_create();
mds_clients = ch_create();
}
/*
* Add a client C and file F to the MDS and link them together.
* Note: it's possible that the client is either exits or the
* file f already exists, this ... |
C | #include"Heap.h"
//ѣµ㷨
//ǰڵΪ
void AdjustDown2(int* a, int n, int root)//nΪС//rootΪڵ
{
int parent = root;
int child = parent * 2 + 1;
while (child<n)
{
//ҳǸ
if (child + 1<n && a[child + 1] > a[child])//жĸС
{
++child;
}
if (a[child] > a[parent])
{
int tmp = a[child];
a[child] = a[parent];
a... |
C | #include <efi.h>
#include <efilib.h>
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
INTN Argc, i;
CHAR16 **Argv;
InitializeLib(image, systab);
Argc = GetShellArgcArgv(image, &Argv);
Print(L"Argument:\n");
Print(L" Argc=%d\n", Argc);
for (i = 0 ; i < Argc ; ++i)
Print(L" Argv[%d] = '%s'... |
C | #include <stdio.h>
void left(char *d,char *s,int n)
{
for(size_t i=0;i<n;i++)
{
*d=*s;
d++;
s++;
}
return;
}
int main(int argc, char*argv[])
{
char str1[]="exercises";
char str2[32]="abcdefghijklmn";
char str3[32]="abcdefghijklmn";
left(str2,str1,5);
puts(str2);
left(str3,str1,10)... |
C | #include<stdio.h>
#include<string.h>
int main()
{
char str[60];
int R,i;
while(scanf("%s", &str) != EOF)
{
i = 0;
R = 0;
while(str[i])
{
if(str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u')
R++;
else if(str[... |
C |
#include "iostm8l152c6.h"
#include <intrinsics.h> // __enable_interrupt ()
/**
* CLK_DIVR,
* 3 , 5
*/
#define CLK_DIV_1 0x00
#define CLK_DIV_2 0x01
#define CLK_DIV_4 0x02
#define CLK_DIV_8 0x03
#define CLK_DIV_16 0x04
#define CLK_DIV_32 0x05
#define CLK_DIV_64 0x06
#define C... |
C | #include "stdint.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include <time.h>
#include <unistd.h>
#define i32 int32_t
#define p1 "\e[1;31m"
#define p2 "\e[1;32m"
#define p3 "\e[1;33m"
#define p4 "\e[1;34m"
#define p5 "\e[1;35m"
#define p6 "\e[1;36m"
#define p7 "\e[1;41m"
#define p8 "\... |
C | #include <stdio.h>
#include <omp.h>
int main (int argc, char *argv[]) {
int max;
sscanf (argv[1], "%d", &max);
printf("omp_get_nested() = %d\n", omp_get_nested());
#pragma omp parallel for
for (int i = 1; i <= max; i++) {
printf ("Number of threads in outer team %d: \n", omp_get_num_threads());
... |
C | #include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
struct node
{
int data;
struct node *left;
struct node *right;
}*root= NULL;
struct queue
{
int size;
int front;
int rear;
struct node **Q;
}*q=NULL;
void createQueue(int size)
{
q->size = size;
q->front = -1;
q->rear = -... |
C | #include <unistd.h>
#include <stdio.h>
int main() {
long sem_nsems_max = sysconf(_SC_SEM_NSEMS_MAX);
long sem_value_max = sysconf(_SC_SEM_VALUE_MAX);
printf(": %ld\n", sem_nsems_max);
printf("sem_value_max: %ld\n", sem_value_max);
}
|
C | #include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <time.h>
#include "cashier.h"
static cashier_t* cashier_function(cashier_t* current, xmlNode* curNode){
char *data;
char *properties;
properties = (char *) xmlGetProp(curNode, (const xmlChar *)"name");
strcpy(current->name, properti... |
C | /*************************
**Crystopher Echavarria**
*************************/
#include <stdio.h>
#include "graphics.h"
#define PIECEE color(100,100,500)
#define PIECEC color(0,255,0)
#define PIECEF color(0,0,255)
#define PIECEM color(255,0,0)
#define BORDERC color(255,255,255)
#define W 50
#define H 50
#define MW... |
C | /*
nxSDK - ioFTPD Software Development Kit
Copyright (c) 2006 neoxed
Module Name:
Resolve
Author:
neoxed (neoxed@gmail.com) May 13, 2006
Abstract:
Example application, demonstrates how to resolve names and IDs.
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <... |
C | #include <math.h>
#include <glad/glad.h>
#include "camera.h"
Camera new_camera(vec3 position, vec3 world_up, float yaw, float pitch, float speed, float sensitivity, float zoom)
{
vec3 front, up, right;
glm_vec3_zero(front);
glm_vec3_zero(up);
glm_vec3_zero(right);
Camera camera = {
positio... |
C | /**
* Project: Assignment 2 - ProgII subject
* File: a2_e1_test.c
* Version: 2.0
* Date: Mar 18, 2017
* Revision date: May 27, 2018
*
* (C) Alejandro Santorum Varela
* alejandro.santorum@gmail.com
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "element_int.h"
#include "st... |
C | /* 8. Un banco necesita para sus cajeros automáticos un programa que lea una
cantidad de dinero e informe la cantidad mínima de billetes a entregar,
considerando que existen billetes de $100, $50, $10, $5 y $1.
Realizar una función que calcule dichas cantidades. */
#include <stdio.h>
#pragma warning(disable:4996)
void ... |
C | #include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
int main()
{
int a;
int lm=0;
int nm=0;
int line[100][100];
char ch;
FILE *file = fopen("hello.txt","r");
line[0][0];
while (read(file, &ch , sizeof(char))>0){
nm++;
i... |
C |
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct node{
int data;
struct node *left;
struct node *right;
int height;
};
struct node *root = NULL;
struct node *new_node(int data){
struct node *temp = (struct node *)malloc(sizeof(struct node));
temp->data = data;
temp->left = NULL;
temp->rig... |
C | /*
** delete_character.c for 42sh in /home/skyrise/Work/Repositories/Epitech/PSU/42sh/PSU_2015_42sh/srcs/class/line_editor/
**
** Made by Buyumad Anas
** Login <buyuma_a@anas.buyumad@epitech.eu>
**
** Started on Fri Jun 3 22:59:28 2016 Buyumad Anas
** Last update Sun Jun 5 20:15:15 2016 Buyumad Anas
*/
#include <... |
C | #include "DumbNet/dumbnet.h"
void usage(char * arg0)
{
printf("Usage: %s server",arg0);
printf("Usage: %s client [hostname]",arg0);
}
void client_main(const char * host)
{
dn_socket sock = client_connec_init(host);
client_connec_proc(sock);
}
int main(int argc, char * argv [])
{
if ( argc < 1... |
C | #include <stdio.h>
#include <stdlib.h>
#include "m_malloc.h"
#include <string.h>
#include <tgmath.h>
int actual_id = 0;
void* mem;
Lista* lista_libres = NULL;
Lista* lista_ocupados = NULL;
int tamano_actual = 0;
void* m_malloc_aux(int tam) {
if(lista_libres->size > 0) {
Nodo* nodo = lista_libres->prim;
for (int... |
C |
#pragma once
#define check_null(exp, r) check_log(exp != NULL, #exp "is NULL", r)
#define check_log(exp, msg, r) \
if (!(exp)) { \
printf("%s\n\tat %s(%s:%d)\n", msg, __FUNCTION__, __FILE__, ... |
C | // if (root == NULL)
// {
// return root;
// }
// if (balancedfactor(root) == 2 && balancedfactor(root->left) == 1)
// {
// return LLrotate(root);
// }
// else if (balancedfactor(root) == 2 && balancedfactor(root->left) == -1)
// {
// return LRrotate(root);
// }
... |
C | #include<stdio.h>
int j_converse(char s[]);
/**
*main- conversion de tipos
*Return: exit succesfull
*/
int main(void)
{
char numeros[10]= "0123456789";
printf("%d\n", j_converse(numeros));
return (0);
}
/**
*j_converse- function to converter an char type an int
*Return: exit succesfull
*/
int j_... |
C | #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include "headers.h"
int main()
{
printf("Bienvenido a la prueba del programa. Suma de enteros ingresados.\n");
int n, i, *ptr, suma = 0;
printf("Ingresar cantidad de numeros: ");
scanf("%d", &n);
ptr = (int*) malloc2(n * sizeof(int));
... |
C | #include <stdio.h>
/**
* @Author: fiyc
* @Date : 2019-04-07 21:52
* @FileName : demo_6.c
* @Description :
- 统计单词数
*/
#define IN 1
#define OUT 0
int main()
{
int c, nw, state;
state = OUT;
nw = 0;
while((c = getchar()) != EOF){
if(c == ' ' || c == '\t' || c == '\n'){
state = OU... |
C | #include <stdio.h>
#include <stdlib.h>
#include "args.h"
#include "make_with_funcs.h"
void make_with_func(){
int i, j, count;
args_t args;
if (get_args("test.auto", &args)) {
print_args(&args);
}
else {
printf("Falha ao obter args\n");
}
//cria arquivo
FILE * a... |
C | // https://cs50.harvard.edu/x/2021/shorts/singly_linked_lists/
#include <stdio.h>
#include <stdlib.h>
/* Scope:
* [x] Create a linked list
* [x] Search a linked list
* [x] Insert a new node into a linked list
* [x] Delete a single element from the linked list
* [x] Delete/Free the linked list nodes
*/
typedef ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/wait.h>
#include <errno.h>
const double time_out = 20.0;
const double STEP_TIME = 0.1; // time step, second
int status = 0;
int main(int argc, char** argv)
{... |
C | #include <stdlib.h>
#include <math.h>
#include <stdio.h>
typedef struct heap_item
{
int key;
double sort_key;
void *data;
} heap_item;
typedef struct heap
{
heap_item *heap_array;
int size;
} heap;
heap *heap_create(int size)
{
heap *new_heap = (heap *)malloc(sizeof(heap));
new_heap->heap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.