language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include<stdio.h>
#include<stdlib.h>
struct node
{
int info;
struct node *next;
};
struct Tnode
{
int info;
struct Tnode *lchild;
struct Tnode *rchild;
};
struct node *middlelinklist(struct node *head,int n)
{
struct node *current;
int i;
current=head;
while(i<=n/2)
{
current=current->next;
i++;
}
if(head==NULL)
... |
C | #ifndef __buf_h
#define __buf_h
#include <stddef.h>
#include <string.h>
#include "base.h"
#include "req.h"
#include "memory.h"
#include "interval.h"
#define dobuf(buf, index, ...) { \
size_t size = buf_size(buf); \
for (size_t index = 0; index... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
/*
* Return an array of size *returnSize.
* Note: The returned array must be malloced, assume caller calls free().
*/
char** letterCombinations(char* digits, int* returnSize) {
int total_d;
struct dinfo {
char *substr;
... |
C | #include <stdio.h>
void multk(int m[][4], int k, int l, int c)
{
if (c == 4)
{
c = 0;
l += 1;
}
if (l == 4) return;
if (c == l)
{
m[l][c] = m[l][c] * k;
}
multk(m, k, l, c+1);
}
void mostrar(int m[][4], int l, int c)
{
if (c == 4)
... |
C | //
// Created by Blanchard, Sean on 2019-09-04.
//
#ifndef C_TUT_PERSON_H
#define C_TUT_PERSON_H
typedef char NAME[41];
struct date
{
int month;
int day;
int year;
};
typedef struct date DATE;
struct person
{
NAME name;
int age;
float height;
DATE bday;
};
typedef struct person PERSON;
vo... |
C | #include <stdio.h>
int main(void)
{
char lo = 's';
char *p = &lo;
printf("%c", *p);
return 0;
}
|
C | /*
program name: pointUtilityBabakF.h
Discussion: Specification -- pointUtility Class
Writen by: Babak
Due daate: 2016/12/13
*/
#ifndef pointUtilityBabakF_H
#define pointUtilityBabakF_H
#include "fractionBabakF.h"
void menu(void);
void update(pointBabakF*& firstPoint, pointBabakF*& secondPoint);
void init(... |
C |
#define progname "hex2bin"
#include "stdio.h"
#include "ctype.h"
#include "mydefs.h"
/* Program to convert *.HEX files to binary (e.g: .SAV) files of RT-11.
By Antti Karttunen, at 28.12.1990.
*/
FILE *myfopen();
FILE *input,*output;
char *myfgets();
UINT get_byte();
UINT linecount=0;
ULI by... |
C | #include <kernel.h>
#define TRAIN_NUMBER "20\0"
static WINDOW train_window= {0, 0, 80, 10, 0, 0, ' '};
//Variable to pause/sleep between commands
int sleep_ticks = 10;
//current config
int config =0;
//Variable to determine whether train auto-pilot is active
int running =0;
void ClrBuffer(void);
void Concatenat... |
C | #include<stdio.h>
#include<math.h>
#include<stdlib.h>
int step_direction(int seed);
void main(){
int seed;
scanf("%d",&seed);
int i;
int position = seed;
printf("seed: %d\n", seed);
for(i=0;i<21;i=i+1){
int step = step_direction(seed);
if (step == 1){positionx = positionx - 1;};
if (step == 2){positionz... |
C | /*********************************************************************************************************
Faa um algoritmo que receba um inteiro positivo e retorne sua representao no formato binrio.
*********************************************************************************************************/
#include <... |
C | #include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/unistd.h>
#include <linux/time.h>
#include <asm/uaccess.h>
#include <linux/sched.h>
#include <linux/kallsyms.h>
#define __NR_syscall 335 /* 系统调用号335 */
unsigned long * sys_call_table;
unsigned int clear_and_return_cr0(void);
... |
C | #include <stdio.h>
int main()
{
int a = 5;
int b = 20;
int c;
if(a && b)
{
printf("Line 1 - a&&b true\n");
}
if(a || b)
{
printf("Line 2 - a||b true\n");
}
a = 0;
b = 10;
if(a && b)
{
printf("Line 3 - 0 && b true\n");
}else{
printf("Line 3 - 0&&b false\n");
}
if(!(a&&b))
{
printf("Line 4... |
C | // 有向图的传递闭包
#include <stdio.h>
#include <stdlib.h>
#define SIZE 4
void warshall(int (*a)[SIZE])
{
int r[SIZE][SIZE];
for (int i = 0; i < SIZE; i++)
for (int j = 0; j < SIZE; j++)
r[i][j] = a[i][j];
for (int k = 0; k < SIZE; k++)
{
for (int i = 0; i < SIZE; i++)
{
... |
C | /*statistik.c*/
/*
Projekt: statistik
*/
/*
History:
FS 17.11.2014 erstellt
*/
#define MAX_WERTE 10
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "statistik.h"
int main(void);
int main()
{
/*
Dieses Modul liet Werte aus einer .txt Datei ein,
berechnet deren Me... |
C | //
// list.c
// xCodeAs1_300
//
// Created by Dipansh Arora on 2020-05-27.
// Copyright © 2020 Dipansh Arora. All rights reserved.
//
#include "list.h"
static List headsArray[LIST_MAX_NUM_HEADS];
static Node nodesArray[LIST_MAX_NUM_NODES];
static int headsUsed = 0; //num of elements used in headsArray
static int... |
C | #include <stdio.h>
#include <string.h>
struct libro
{
char titulo;
char autor;
char editorial;
int edicion;
int paginas;
} biblioteca[1];
int i = 0;
void ingresarLibros(void)
{
getchar();
printf("Ingrese el titulo del libro: ");
scanf("%s", &biblioteca[i].titulo);
printf("Ingrese ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "counts.h"
counts_t * createCounts(void) {
counts_t* ans=malloc(sizeof(*ans));
ans->cntArr=NULL;
ans->cntSize=0;
ans->unknown=0;
return ans;
//WRITE ME
}
void addCount(counts_t * c, const char * name) {
if(name==NULL)
{... |
C | #include "LedDriver.h"
#include "TrafficLight.h"
typedef struct TrafficLightInternals {
TrafficLightLamps lamps;
TrafficLightState state;
} TrafficLightInternals;
typedef struct TrafficLampStates {
LedState red, amber, green;
TrafficLightState next;
} TrafficLampStates;
static TrafficLampStates _states[4] = ... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct nodo{
int valor;
struct nodo *sig;
struct nodo *ant;
} nodo;
typedef nodo *puntero;
void agregarElemento(nodo *cabeza,nodo *cola);
void borrarElemento(nodo *cabeza,nodo *cola);
void imprimirLista(nodo *cabeza);
void imprimirListaRevez(nodo *cola);... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_error.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "repaso.h"
#define LEN 3
typedef struct
{
float precio;
char codigo[7];
}eProducto;
int main()
{
eProducto arrayProducto[LEN];
//float precios[LEN];
//char codigos[LEN][7];
int i;
int j;
for(j=... |
C |
/*
*/
#include "hash.h"
#include <stdio.h>
#define MIN_TABLE_SIZE 10
int main()
{
HASH_TABLE H = initilize_hash(12);
int table_size = H->table_size;
if (table_size != 13)
{
printf("initilize_hash failed. Table size, expected:%d, actual:%d\n",
13, table_size);
}
else
... |
C | /*
* 有关C语言的声明
* 优先级规则
* A 声明从他名字开始读取,然后按照优先级顺序依次读取
* B 优先级从高到低依次是:
* B.1 声明中被括号括起来的部分
* B.2 后缀操作符:
* 括号表示这是一个函数()
* 方括号表示这是一个数组[]
* B.3 前缀操作符:星号*表示 指向...的指针
* C 如果const或者volatitle后跟着类型说明附,则它作用于类型说明符( int long等)。在其他情况下,作用于它左边紧邻的星号。... |
C | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
// ʵҵ
// һС
typedef struct LINKNODE{
struct LINKNODE* next;
}LinkNode;
//
typedef struct LINKLIST{
LinkNode head;
int size;
}LinkList;
// һ
typedef struct Person{
LinkNode node;
char name[1024];
int age;
}Person;
// ʼ
LinkList* Init(){
Link... |
C | #include<stdio.h>
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int left,right,a,temp,answer;
scanf("%d%d%d",&left,&right,&a);
if(left==right)
{
temp=a/2;
answer=(2*left)+(2*temp);
}
else if(right>left)
... |
C | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "sort.h"
void printArr(int *arr,int n)
{
int i=0;
for(i=0;i<n;i++)
{
printf("%d ",arr[i]);
}
printf("\n");
}
void main()
{
int arr[10] = {6,7,8,9,4,5,2,3,1,0};
printf("\nbefore: ");
printArr(arr,10);
//qui... |
C | //
// HHArray.h
// HHArray
//
// Created by Harlan Haskins on 4/21/15.
// Copyright (c) 2015 harlanhaskins. All rights reserved.
//
#ifndef __HHArray__HHArray__
#define __HHArray__HHArray__
#include <stdio.h>
#ifndef _HHARRAY_DEFINED_
typedef struct { } *HHArray;
#endif
extern const size_t HHArrayNotFound;
/**... |
C | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc,char *argv[])
{
int fd;
if(argc < 2)
{
printf("Usage:%s <filenmae>\n",argv[0]);
exit(0);
}
fd = open(argv[1],O_WRONLY|O_CREAT|O_... |
C | // FINALLY PASSED!!!
// STILL NEED TO BE TESTED!!!
//#include <stdio.h> // del
#include <stdlib.h>
struct s_node {
void *content;
struct s_node *next;
};
struct s_stack {
struct s_node *top;
};
struct s_node *new(void *c)
{
struct s_node *p;
p = (struct s_node *)malloc(sizeof(str... |
C | #include <math.h>
#include "Params.h"
#define PI 3.141592
/*--- scale_rotate_shift --- gk,],ړi`Ԗ@j-------------------
image_in: ͉摜z
image_out: o͉摜z
zx: g嗦ij
zy: g嗦icj
deg: ]pixj
px: S_ij
py: S_icj
-----------------------------------------------------------------------------*/
void scale_rotate_shift(u... |
C | #include<stdio.h>
#include<stdlib.h>
#include "tbt.h"
#include <signal.h>
#include <unistd.h>
#include "debug.h"
#include<pthread.h>
typedef void (*sighandler_t)(int);
struct token_ts
{
int cps;
int token;
int token_max;
int subscript;
pthread_mutex_t mutex_t_token;
};
static struct token_ts *token[NUM_MAX];
s... |
C | #include <cs50.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
int length;
printf("arr length: ");
scanf("%i", &length);
int arr[length];
printf("Enter %i elements in the array: ", length);
for (int i =0; i < length; i++)
{
... |
C | #include "holberton.h"
/**
* print_diagonal - a function that draws a diagonal line on the terminal
* @n: number of diagonal lines
* Return: void
*
*/
void print_diagonal(int n)
{
int a, b;
if (n > 0)
{
for (b = 1; b <= n; b++)
{
for (a = 1; a <= b; a++)
{
if (a > 1)
_putchar(' ');
if (a... |
C | /*-----------------------------------------------------------------------------
* file: sr_pwospf.c
* date: Tue Nov 23 23:24:18 PST 2004
* Author: Martin Casado
*
* Description:
*
*---------------------------------------------------------------------------*/
#include "sr_pwospf.h"
#include "sr_router.h"
#includ... |
C | #include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "../err_exit.h"
void echo_srv(int sock)
{
char recvbuf[1024];
struct sockaddr_in peer_addr;
socklen_t pee... |
C | #include<stdio.h>
#include<stdlib.h>
int main ()
{
int i=0,v[5]={0,1, 2, 3, 4};
while (i<5)
{
printf("imprime %d \n ",v[i]);
i=i+1;
}
return (0);
} |
C | #include <stdio.h>
#include <malloc.h>
#include <strsafe.h>
#include <tchar.h>
#include <windows.h>
typedef struct RB_Node* RBNodePtr;
typedef struct RB_Node {
int key;
int red; //red = 0 일시 black
RBNodePtr left;
RBNodePtr right;
RBNodePtr parent;
}RB_Node;
typedef struct RB_Tree* RBPtr... |
C | #include <stdio.h>
#include<stdlib.h>
#include "libRandevu.h"
#include <ctype.h>
#include<string.h>
/*
* @file libRandevu.c
* @description Headher dosyasındaki fonksiyonların tanımlandıgı dosya.
* @assignment BP3_Odev2
* @date 26.12.2019
* @author Furkan Gundogan - furkangundogan14@outlook.com
*/
const char... |
C | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int a[100000];
int max(int x,int y)
{
int i,less=3;
for(i=x;i<=y;i++)
{
if(a[i]<less)
less=a[i];
}
return less;
}
int main() {
int l,T;
scanf("%d%d",&l,&T);
int i,en[T],ex[T],m[T];
fo... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 40
/* Reverse */
int main()
{
int bubble[SIZE];
int inner, outer, temp, x;
srand((unsigned)time(NULL));
/* Display original array */
puts("Original Array:");
for (x = 0; x < SIZE; x++)
{
bubble[x] = rand();
... |
C | #include <time.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
int main(){
int status;
if(fork() == 0){
srand(time(NULL));
if(rand()<RAND_MAX/4){
kill(getpid(),SIGTERM);
}
return rand();
}else{
wait(&status);
if (WIFEXITED(status)) {
printf("Child exited with st... |
C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdbool.h>
// taken from project writeup:
// for 'status' variable:
#define INELIGIBLE 0
#define READY 1
#define RUNNING 2
#define FINISHED 3
#define MAX_LENGTH 1024
#define MAX_CHILDREN 10
... |
C | #include <stdio.h>
#include <string.h>
//for exit function:
#include <stdlib.h>
//to use clock funtion in time library we have to add:
#include <time.h>
//for read,close,write functions we have to add:
#include <unistd.h>
//for open function we have to add:
#include <sys/types.h>
#include <sys/stat.h>
#include <... |
C | #include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "flag.h"
int fd;
int main(int argc,char *argv[])
{
if(argc < 2){
fprintf(stderr,"usage:%s\n",argv[0]);
exit(1);
}
fd = open(argv[1],O_WRONLY,0777);
if(fd < 0... |
C | #include <stdio.h>
int main(void)
{
/*
* Se crean dos printf para imprimir nombre y dirección, creando una nueva línea después
*/
printf("Juan Andrés Urrea Niño\n");
printf("Evergreen Terrace 123\n");
return 0;
} |
C | #define _XOPEN_SOURCE
#include <stdio.h>
#include <unistd.h>
int main()
{
const char *password = "password";
const char *salt = "";
const char *rv = crypt(password, salt);
printf("rv: %s\n", rv);
return 0;
}
|
C | #define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "cdr.h"
#include "dest_list.h"
#include "cdr_list.h"
int cdr_list_insert(struct cdr_listnode **head, struct cdr* data)//imediate insert with the use of next_insertion
{
if((*head)==NULL)//empty list
{
(*he... |
C | #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <sys/mman.h>
#include "globalVariables.h"
int main(){
int i,n, sock, sock_recv, clientLen;
struct sockaddr_in my_addr;
struct sockaddr_i... |
C | #include<stdio.h>
#include<stdlib.h>
struct queue
{
int front1;
int rear1;
int front2;
int rear2;
int size;
int data;
int *p;
};
typedef struct queue queue;
void create(queue *q)
{
printf("Enter the size of the queue: ");
scanf("%d",&q->size);
q->front1=-1;
q->rear1=-1;
... |
C | // server.c -*-c-*-
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void error(char *msg);
char* uint8_t2bin(uint8_t num);
int main() {
struct sockaddr_in clientAddr, serverAddr;
int len, received, sockfd;
c... |
C | /*
** EPITECH PROJECT, 2020
** n4s
** File description:
** for the dist-desu
*/
#include "my.h"
int *dist_mallocer_2(int *rsl, int len)
{
int i = 0;
rsl = malloc((len + 1) * sizeof(int));
if (rsl == NULL)
return NULL;
for (; i < len; i++)
rsl[i] = 0;
rsl[0] = len;
rsl[len] = -... |
C | #include <stdio.h>
#define N 10
int main(int argc, char *argv[])
{
int f[N]={0};
int i,j;
for(i=0;i<N;i++)scanf("%d",&f[i]);
j=0;
for(i=0;i<N;i++)
{
if(f[i]<f[j]) j=i;
/*if(f[i]<f[i+1])
min=f[i];*!*/
}
printf("%d\n",f[j]);
return 0;
} |
C | #include <timer_delay.h>
int td_init(struct td_timer *timer, TD_TIMER_TYPE (*get_counter)(void),
TD_TIMER_TYPE period) {
if (timer == 0 || get_counter == 0) {
return -1;
}
timer->get_counter = get_counter;
timer->period = period;
return 0;
}
int td_start(struct td_timer *timer) {
if (timer == 0) ... |
C | #include<stdio.h>
#include<stdlib.h>
struct node
{
struct node *left,*right;
int d;
};
struct node *root=NULL,*current,*p;
int r=0;
void btree()
{
int data;
scanf("%d",&data);
while(data!=0)
{
current=(struct node *)malloc(sizeof(struct node));
current->d=data;
current->left=NULL;
current->right=NULL;
i... |
C | //16. Write a C program to enter a number and print its reverse.
#include<stdio.h>
int main(){
int no,reverseNo = 0, lastDigit = 0;
printf("enter a number\n");
scanf("%d",&no);
while(no != 0){
lastDigit = no % 10;
reverseNo = reverseNo * 10 + lastDigit;
no/=10;
}
printf("reverse no is \n");
printf("%d\n... |
C | #include <stdio.h>
#include <ctype.h>
#include <stdbool.h>
int main(void)
{
int ch, w_sum, c_sum, pre;
ch = w_sum = c_sum = 0;
bool isword = false;
while ((ch = getchar()) != EOF)
{
if (isspace(ch) && !isword)
isword = true;
if (!isspace(ch))
c_sum++;
pre = ch;
if (isspace(pre) && isword)
w_sum+... |
C | // Faire la rotation de Yaroslavsky
#include "iio.h"
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <fftw3.h>
// déclaration des fonctions
int trans_ligne(float *img,int w,int h,float *vect_trans,int l) ;
int trans_colonne(float *img,int w,int h,float *vect_trans,int l) ;
void fourier1dForward(... |
C | #include<stdio.h>
void numpalindrome(int a)
{
int r=0,x;
x=a;
while(a!=0)
{
r=r*10;
r=r+a%10;
a=a/10;
}
if(r==x)
printf("The number is a palindrome");
else
printf("The number is not a palindrome");
}
void main()
{
int z;
printf("Enter a number ... |
C | #include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,mul;
clrscr();
printf("\n Enter two numbers for multiplication:");
scanf("%d%d",&num1,&num2);
mul=num1*num2;
printf("\n Multiplication of two numbers is %d",mul);
getch();
} |
C | #include<stdio.h>
void main()
{
int a;
printf("enter the value");
scanf("%d",&a);
if(a%2==0)
{
pintf("even number");
}
else
{
print("odd number");
}
}
|
C | /*
* Copyright 2017 Katherine Flavel
*
* See LICENCE for the full copyright terms.
*/
#include <assert.h>
#include <string.h>
#include "jdom.h"
#include "xalloc.h"
static struct {
const char *s;
enum json_valuetype t;
} a[] = {
{ "object", JSON_VALUE_OBJECT },
{ "array", JSON_VALUE_ARRAY },
{ "string"... |
C | #include "libft.h"
static size_t seek(int i, const char *str, const char *to_find, size_t s)
{
size_t j;
size_t temp_i;
j = 0;
temp_i = i;
while (to_find[j] == str[temp_i] && str[temp_i] != '\0' && temp_i < s)
{
temp_i++;
j++;
}
return (j);
}
char *ft_strnstr(const char *str, const char *to_find, size_... |
C | #include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
char s[25];
clrscr();
printf("\n value");
scanf("%d",&n);
printf("\n string:");
scanf("%s",s);
for(i=0;i<n;i++)
{
printf("%c",s[i]);
}
getch();
}
|
C | /***********************************************************
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is her... |
C | #ifndef Expression
#include"tree.h"
TreeNode* MakeExpTree(char* express); // ǥ ڿ Ʈ Ʈ ȯ
int EvaluateExpTree(TreeNode* main); //Ʈ ּҸ .
void showNodeData(int data);
void showInfix(TreeNode* main); //MakeExpTree ȯǾ. ǥ
void showPrefix(TreeNode* main); // ǥ
void showPostfix(TreeNode* main); // ǥ
#en... |
C | /*
* tipo_atividade.h
*/
#ifndef TIPO_ATIVIDADE_H
#define TIPO_ATIVIDADE_H
struct TipoAtividade {
char codigo[3];
char *descricao;
};
typedef struct TipoAtividade TipoAtividade;
/*
* Returns a pointer to the vector of activity types ended by a null pointer.
* A null pointer will be r... |
C | #include "holberton.h"
/**
* _strcmp - function that compares 2 strings
* @s1: pointer
* @s2: pointer
*
* Return: returns integer
*
*/
int _strcmp(char *s1, char *s2)
{
while (*s1)
{
if (*s1 != *s2)
break;
s1++;
s2++;
}
return (*s1 - *s2);
}
|
C | /******************************************************************************
* @File: main.c
* @Author: Milandr, L.
* @Project: Demo_Project_12-1
* @Version: 1.0.0
* @Compiler: ARM Compiler V5.06 (build 750)
* @Microcontroller: К1986ВЕ92QI
* @Device: Отладочная плата «МилКиТЭС»
* @Date: 16.04.2020
* @Purpos... |
C | /* Setup */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
const int N = 16;
int main ()
{
pid_t pid[N];
int i;
int status;
/* Making babies
How many second does the FIRST baby wait?
How many second does the LAST baby wait?
*/
for (i = 0; i... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#define NUM 10
#define MAXVALUE 100
void initialArray(int *_data)
{
int i;
for (i = 0; i<NUM; ++i)
{
_data[i] = rand()%MAXVALUE;
}
}
void printfArray(int*array)
{
int i;
printf ("The Array is :[");
... |
C | #include "p5lib.h"
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// Example 14-7: rotateX
float theta = 0.0;
void setup() {
p5_size(200, 200);
p5_frameRate(10);
}
void draw() {
p5_background(255);
p5_stroke(0);
p5_fill(175);
p5_translate(p5_width/2, p5_height/2);... |
C | #include <stdio.h>
#include <stdlib.h>
#include "common.h"
/* This test checks that pointers aren't immediately re-used between
* allocations. */
int main(void) {
void *p = malloc_noinline(ALLOCATION_SIZE);
void *q = p;
free_noinline(p);
p = malloc_noinline(ALLOCATION_SIZE);
if (p == q)
{
... |
C |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
//ejercicio17
main(){
float peso, altura;
puts("Introduce tu peso en kilogramos y luego tu altura en metros");
scanf("%f %f", &peso, &altura);
printf("Para tu peso %0.1f y tu altura %0.2f te corresponde un IMC de:\n \t", p... |
C | /*
* led_control.c
*
* Created on: 2020. 12. 26.
* Author: WANG
*/
#include "led_control.h"
#include "led.h"
extern eeror_t Error;
extern flags_t f;
uint8_t flight_mode, flight_mode_counter, flight_mode_led, headfree_mode_counter, headfree_mode_led;
uint32_t flight_mode_timer, headfree_mode_timer;
////... |
C | #include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
/* BSD sysexits.h */
#define EX_USAGE 64
#define EX_DATAERR 65
#define EX_IOERR 74
#define SIMS 32767
#define BINS 1023
#ifndef ARG_MAX
# define QUAS 128
#else
# define QUAS ARG_MAX
#endif
uns... |
C | #include <stdio.h>
extern struct { char *name; int *ids; } scr[];
extern int noOfScreens;
/*
! this is part of the driver
*/
/* Win3208:
Vlj duc
Ls in metamod.<ducnr>
Lnka Duc<ducnr>.DLL
loop {
Kontrollerar vilka vars som anvnds i aktuell bild
Hmtar dessa variabler
id = Dll-anrop(id);
Uppdatera bilden (text ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* exit.c :+: :+: :+: ... |
C | // This Tutorial is created by Aditya Panda
/*
In this Program we will learn about while loop..
syntax:
while (testExpression)
{
// statements inside the body of the loop
}
How while loop works?
# The while loop evaluates the test expression inside the parenthesis ().
# If... |
C | #include <stdlib.h>
#include <stdio.h>
#include "extmem.h"
#include <string.h>
/*
* ʵҪʹڴ棨 Buffer ʵ㷨ɶ峤ȴ10ͻַ顣
* ϵRAB AֵΪ[20, 60]BֵΪ[1000, 2000]
* ϵSCDCֵΪ[40, 80]DֵΪ[1000, 3000]
* ֵΪintͣ4ֽڣRSÿԪĴСΪ8ֽڡ
* 1. Ŀеѡӣ ǻڹϵĵһԣR.A S.C
2. ʵݾģϵһ15ͬԪ顣Ϊҵԣ5ͬԪ飺(40,1243),(41,1829),(42,1422),(58,1256),(58,1747)
3. ʵֻʹڴ滺520ֽڣ... |
C | int lengthOfLastWord(char* s) {
char *c = s;
int prev = 0,
cur = 0;
while (*c != '\0') {
if (*c == ' ') {
if (cur != -1) {
prev = cur;
}
cur = -1;
} else {
if (cur == -1)
cur = 0;
cur ++;
}
c++;
}
return cur == -1 ? prev: cur;
}
|
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_first_step.c :+: :+: :+: ... |
C | // Reverse the linked list by changing the link of the nodes only.
#include <stdio.h>
#include <malloc.h>
struct node
{
int data;
struct node *next;
} *start;
int main(){
int numberOfNodes;
struct node *t, *prev, *temp, *last;
scanf("%d", &numberOfNodes);
for (int i = 0; i < numberOfNodes; i++){
t = (struct... |
C | /*
* Nicholas Patience U07985691
* Nickspatience@gmail.com
* C/C++ Programming II : Dynamic Memory and File I/O Concepts
* 134312 Ray Mitchell
* 09/29/2018
* C2A1E2_main.c
* Win 10
* Visual C++ 2017
*
* Prints out a count of the command line arguments provided
* as well as the arguments themselves
*/
#incl... |
C | // В файле task.in дана строка длиной не более 100 символов.
// Прочитать строку в память и произвести ее реверс.
// Результат вывести в task.out.
#include <stdio.h>
#define STRING 101
int main() {
char str[STRING];
int scan = STRING;
FILE *in = fopen("task.in", "r");
FILE *out = fopen("task.out", "... |
C | /*
* NetWork.c
*
* Created on: 2016718
* Author: j
*/
#include <stdio.h>
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <pthread.h>
#include "Rout... |
C | #include <stdio.h>
#include <stdlib.h>
int main(){
int valor1, valor2, resultado;
char operador;
printf("Digite o primeiro valor: ");
scanf("%d", &valor1);
printf("Digite o segundo valor: ");
scanf("%d", &valor2);
resultado = valor1 - valor2;
printf("A subtracao dos valores e: ... |
C | /*
* Check if abstract declarator works well.
*/
#include <stdio.h>
typedef int T;
void f(double (T));
void g(double (t));
double h(int);
int main()
{
f(h);
g(3.0);
return 0;
}
void f(double (*pf)(int))
{
printf("`f' called\n");
double d = (*pf)(100);
printf("d = %f\n", d);
... |
C | inherit "/players/stark/room";
#include "/players/stark/defs.h"
reset(arg){
if(!present("student")) {
if(random(2)>0){
MOCO("/players/stark/utena/mon/student.c"),this_object());
}
}
if(!present("yuuko")) {
MOCO("/players/stark/utena/mon/yuuko.c"),this_object()); }
if(!present("aiko")) {
MOCO("/players/stark... |
C | #include <stdio.h>
void main()
{
char a, b;
printf("Input the first:");
scanf("%c", &a);
if('m'==a || 'M' == a)
{
printf("Monday\n");
}
else if('w' == a || 'W' == a)
{
printf("Wednsday\n");
}
else if('f' == a || 'F' == a)
{
printf("... |
C | #include <stdio.h>
int a[1001], b[1001];
int main(){
int l; scanf("%d", &l);
int n; scanf("%d", &n);
int lng = 0, ans1=0;
for (int i=1; i<=n; i++){
int f, t; scanf("%d %d", &f, &t);
if ( t-f > lng) lng=t-f, ans1=i;
for (int j=f; j<=t; j++) {
if(a[j]) continue;
a[j]=i;
}
}
for (int i=1; i<=l; i++) ... |
C | #include <SDL.h>
#include <stdio.h>
/* Main */
int main(int argc, char ** argv)
{
if(SDL_Init(SDL_INIT_VIDEO) != 0)
fprintf(stderr,"Could not initialize SDL: %s\n", SDL_GetError());
printf("SDL Initialized\n");
SDL_Quit();
printf("SDL Shutdown\n");
return 0;
}
|
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int K[1001];
struct Argus{
int num;
int period;
int rear;
}argu[1000];
void ADJUST(int i,int n);
void HEAP(int n,int m);
int cmp(const void *a, const void *b);
int main()
{
int n=0,m;
char str[100];
scanf("%s",str);
while (strcmp(str,"#")!=... |
C | /*
** EPITECH PROJECT, 2018
** 42sh_termcaps
** File description:
** termcaps
*/
#include "my.h"
void ctrl_f(termline_t *line)
{
line->check = 1;
write(1, "\033[D", 4);
tputs(line->del, 0, write_char);
if (line->pos < line->len) {
write(1, "\033[C", 4);
line->pos += 1;
}
}
void ctrl_h(termline_t *line)
{
l... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
main(){
char sorteio[4][50]={"Paula","Maria","Joana","Ana Lice"};
int pessoa;
srand(time(NULL));// pra no gerar numeros repetidos
pessoa=rand()%4;
printf("\n\t%s", sorteio[pessoa]);
getch();
}
|
C | // add a bunch of standard libraries
#include <stdio.h>
#include <stdlib.h>
/**
* Attempts to add two int arrays a and b elementwise, and store
* the results in the third array c.
*/
void add_arr(int* a, int* b, int* c) {
int len = sizeof(a);
for (int i = 0; i < len; i++) {
*(c + i) = *(a + i) + *(b + i);
... |
C | #include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
static void usage(const char *proc) {
printf("please use : %s [ip] [port]\n", proc);
}
int main(int argc, char *argv[]) {
if (argc != 3) {
usage(argv... |
C | /*Дефинирайте и инициализирайте двумерен масив с по 5
елемента (5 x 5). След като сте готови, направете въвеждане на данните в
масива, като четете от потребителя със scanf.*/
#include<stdio.h>
int main() {
int arr[5][5];
int i, j;
for(i = 0; i < 5; i++){
for(j = 0; j < 5; j++){
printf(... |
C | #include <unistd.h> // For execv
#include <stdlib.h> // For putenv
#include <stdio.h> // For printf
#include <omp.h> // For omp_get_cancellation, omp_get_thread_num()
#define DBsize 1024
#define key 10
int main(int argc, char** argv) {
unsigned long position, i;
double * DB;
if(!omp_get_cancellatio... |
C | /*==============================================================================
Purpose : matrix multiply
Author : Rudolf Berrendorf
Department of Computer Science
Bonn-Rhein-Sieg University of Applied Sciences
53754 Sankt Augustin,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.