language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include<iostream>
using namespace std;
class A
{
private:
int x,y;
public:
void setdata(int x,int y)
{
this->x=x,this->y=y;
}
int modify()
{
x=-x,y=-y;
return *this;
}
void print()
{
cout<<"x="<<this->x<<"y="<<this->y<<endl;
}
};
... |
C | #include "ucode.c"
#define BLKSIZE 1024
int main(int argc, char *argv[ ])
{
char buf[1024];
int n,i;
int fd = open(argv[1], O_RDONLY);
creat(argv[2]);
int gd = open(argv[2], O_WRONLY);
while (n = read(fd, buf, BLKSIZE))
{
for (i = 0; i < n; i++)
{
if (buf[i] >= 'a' && buf[i] <= 'z')
buf[i] = buf[i... |
C | // ------------------------------------------------------------------
// exemple-sigaction-3.c
// Fichier d'exemple du livre "Developpement Systeme sous Linux"
// (C) 2000-2019 - Christophe BLAESS <christophe@blaess.fr>
// https://www.blaess.fr/christophe/
// ------------------------------------------------------------... |
C | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <conio.h>
#include <string.h>
#include "arrayEmployess.h"
#include "validaciones.h"
#define EMPTY 1
#define OCCUPIED 0
int initEmployees(Employee* employees, int lengthEmp)
{
int i;
for(i=0; i<lengthEmp; i++)
{
... |
C | //
// firdespm_example.c
//
// This example demonstrates finite impulse response filter design
// using the Parks-McClellan algorithm.
//
// SEE ALSO: firdes_kaiser_example.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "liquid.h"
#define OUTPUT_FILENAME "firdespm_example.m"
int main(int argc, c... |
C | //cnproj.c - protocol for secured data transfer over UDP
// Sends and receives the given file
//
//Usage: ./cnproj Sender/Recveiver filename listenport
//
//Authors: Syed Muazzam Ali Shah Kazmi
// Muhammad Hasnain Naeem
//
//NOTE: this file contains code for both the sender and the receiver
#include <stdio.h>
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_errors.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#define CL_KERNEL_FILE "./heat_diffusion.cl"
#define INPUT_FILE "./diffusion"
#define MAX_KERNEL_SIZE 1048576 // 1 Kbytes
#define ARRAY_MATRIX 1
#define DEBUG 0
/*open cl version 1.2*/
#ifndef CL_TARGET_OPENCL_VERSION
#define CL_TARGET_OPENC... |
C | #include <stdio.h>
#pragma warning(disable:4996)
int main()
{
int old;
printf("̸ ԷϽÿ : ");
scanf("%d", &old);
if (old <= 7)
printf(" Դϴ.");
else if (old <= 12)
printf("500 Դϴ.");
else if (old <= 19)
printf("700 Դϴ.");
else if (old <= 64)
printf("1500 Դϴ.");
else if (old >= 65)
printf("1000 Դϴ.");
} |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/ipc.h>
#include <sys/sem.h>
//shared memoryの文字列受け取って文字数を代入する側
int main(int argc, char *argv[])
{
char *p, *ptr, count[4096];
int fd, re... |
C | #include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
#include "../include/http.h"
#include "../include/log.h"
static void parse_http_req_method(char** req_str, struct http_request_t* req) {
if (req_str == NULL || *req_str == NULL || req == NULL) {
log(ERROR, "I... |
C | #include <string.h>
#include <stdio.h>
#include "PIlha_String_Header.h"
//Questao -5
void inverter_string(tipo_pilha* pilha, char* dado, int tam)
{
tipo_pilha *a;
int size;
for (int i = 0; i < tam; i++)
{
if(empilhar(pilha, dado) == 0)
{
printf(" Letra nao pode ser al... |
C | #include "./guk.h"
#include <math.h>
void
phis_guk_sym(int *sym, int *n)
{
int i, j;
int *map_sym;
int map_sym_ident[]={0,1,2,3,4,5,6,7,8};
int map_sym4[]={0,1,3,4,2};
int map_sym8[]={0,1,8,7,2,6,3,4,5};
double *scfvectors;
Type_3 *not_needed;
int n2;
FILE *dump_fp;
if (*n < nAct) {
*n = -nAct;
return... |
C | // Filename: qr_codes.c
#include "cheats.h"
#include "hid.h"
/********************************
* *
* QR Codes *
* *
********************************/
u32 o_islandwait = 0x0043DAA8,
o_qr100 = 0x3313EF33;
// Q... |
C | #include "config.h"
int server;
int client;
int working;
pid_t pid;
pid_t child;
char *name;
key_t serverKey;
key_t clientKey;
void signalHandler(int signal);
bool startsWith(char * prefix, char * text);
void registerClient();
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Blad w linii komen... |
C | //
// David Zheng
// September 27, 2018
// CIS2107 Computer Systems and Low-Level Programming
// Section 4
// Lab 4 Part 1
// Arrays2D.c
// Objective: Design and implement functionsto process 2DArrays
//
// Created by David Zheng on 9/21/18.
// Copyright © 2018 David Zheng. All rights reserved.
//
#include <s... |
C | #include <stdio.h>
int main()
{
int num = 20;
int a;
if(num < 20)
{
a = (num++) - (num * num);
}
else if(num > 20)
{
a = (num--) * (num / 20);
}
else
{
a = num / (num + (3*num));
}
printf("%d", a);
} |
C | /* This program uses red-black tree to
remove multiple occurences of the same
value from its paramaters.
For example:
a.out 6 7 3 4 1 4 1 3 5
writes:
1 3 4 5 6 7
*/
#include <stdio.h>
#include <stdlib.h>
#include "sglib.h"
typedef struct rbtree {
int n;
char color_field;
struct rbtree *l... |
C | #include<stdio.h>
#include<stdlib.h>
int main(int argc, char const *argv[])
{
int a, b, c, d, e, f, g;
int sum;
scanf("%d%d%d%d%d%d%d", &a, &b, &c, &d, &e,&f,&g);
sum=a+b+c+d+ a*e+b*e+c*e+ c*f+d*f+ e*g +f+g;
printf("%d", sum);
return 0;
} |
C | #include "minishell.h"
int find_bin(char *cmnd_name, char *path)
{
DIR *dir;
struct dirent *dir_ptr;
if ((dir = opendir(path)))
{
while ((dir_ptr = readdir(dir)))
if (ft_strcmp(dir_ptr->d_name, cmnd_name) == 0)
{
closedir(dir);
return (1);
}
closedir(dir);
}
return (0);
}
char *path(ch... |
C | #define _CRT_SECURE_NO_WARNINGS
#include "Hash_Table/Hash_Sep.h"
#include "Link_List/link_list.h"
#include <string.h>
void DisplayHashTablePostion(Position pos);
void DisplayLinkListPostion(ListPosition pos);
void DoTask(Position pos, void* arg);
void DealWithText(char* str, HashTable ht);
int WordCmp(void* arg1, vo... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "empleados.h"
#include "ArrayList.h"
empleados* empleados_new(void)
{
empleados* returnAux = (empleados*) malloc(sizeof(empleados));
return returnAux;
}
int empleados_setid(empleados* this, int id)
{
int retorno=-1;
if(this!=NUL... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
void error(char* msg)
{
fprintf(stderr, "%s: %s\n", msg, strerror(errno));
exit(1);
}
int beers = 2000000;
void* drink_lots(void *a)
{
int i;
for(i=0; i<100000; i++)
{
beers -= 1 ;
... |
C | #include <stdio.h>
#include <string.h>
int main (void)
{
if(strcmp("na", "a"))
{
printf("Whaaaat?");
}
else
{
printf("NO");
}
} |
C | #include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <stdbool.h>
#define BLOCK 512
#define INTERVAL 2
#define TRUE true
#define FALSE false
// Forward Declarations
int install_handler(int sig, void (*handler)(int));
void sigin... |
C | struct Point2D{
public:
Point2D(){}
Point2D(int x, int y){
this->x = x;
this->y = y;
}
int x;
int y;
};
|
C | /*
============================================================================
Name : FWOAWR7.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <stdio.h>
... |
C | /*
* Very simple and small shell
* Copyright (C) 2008 Claudio M. Alessi
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later... |
C | /**
* @file I2C.c
* @brief I2C communication module
* @date 11/15/2014
* @author a7med
* @version 1.0
**/
#include "I2C.h"
/******************************************************************************************************************************/
/**
* Description: Function is used to Initialize I2C mod... |
C | /*!
\ingroup Logging
\brief This function registers a logging callback that will be used to
handle the wolfSSL log message. By default, if the system supports it
fprintf() to stderr is used but by using this function anything
can be done by the user.
\return Success If successful this function... |
C | // Programmdescription
// Author: Marian Sievers
// dd.mm.yyyy v0.x
#include <stdio.h>
int maximum(int numberA, int numberB) {
if (numberA > numberB)
{
return numberA;
} else {
return numberB;
}
}
int main() {
printf("The biggest number is %i\n", maximum(12, 42));
return 0;
}
|
C | #ifndef guardar_h
#define guardar_h
#include "struct.h"
#include "obtenerproducto.h"
char guardarReporte(){
FILE *archivo;
char guardado;
Producto *productos;
int numeroProductos;
int i;
float costoTotal;
float precioTotal;
int cantidadTotal;
productos = obtenerProductos(&numeroProductos); /* ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_put.c :+: :+: :+: ... |
C | #include "List.h"
#include <stdio.h>
#include <malloc.h>
List *listNew(void *data,List*next)
{
List *list = malloc(sizeof(List));
list->data=data;
list->next=next;
return list;
}
void listDump(List *list,void (*dump)(void*))
{
while(list!=NULL)
{
dump(list->data);
list=list->next;
}
} |
C | #include <stdio.h>
#include <stdlib.h>
int main (int argc, char* argv[]){
if (argc > 1) {
for (int argIter = 1; argIter < argc; ++argIter) {
char *resolved_path_buffer = NULL;
char *result = realpath(argv[argIter], resolved_path_buffer);
puts(result);
if (result != NULL) {
free... |
C | /*
pq.h
Visible structs and functions for priority queues.
Skeleton written by Grady Fitzpatrick for COMP20007 Assignment 1 2021
*/
/* The priority queue. */
#ifndef PATH_STRUCT
#define PATH_STRUCT
struct path {
int vertex;
int *prevToCur;
int cost;
};
#endif
#ifndef PQ_STRUCT
#define PQ_STRUCT
struct pq {
i... |
C | #include<stdio.h>
#include<time.h>
int main()
{
int h1,h2,h3,m1,m2,m3;
scanf("%d:%d",&h1,&m1);
scanf("%d:%d",&h2,&m2);
m3=((h1*60+m1)+(h2*60+m2))%120;
m3=m3/2;
h3=(h1+h2)/2;
printf("%02d:%02d",h3,m3);
}
|
C | /**
* @input A : Read only ( DON'T MODIFY ) Integer array
* @input n1 : Integer array's ( A ) length
* */
int compare(const void *a1,const void *b1){
int a = *(int*)a1;
int b = *(int*)b1;
int i=0;
char arr[10000]={0};
char brr[10000]={0};
sprintf(arr, "%d%d", a, b);
sprintf(br... |
C | /*
Brandon Wu
*/
// UCLA CS 111 Lab 1 command reading
#include "command.h"
#include "command-internals.h"
#include <error.h>
/* TODO:
1. Proper error msg format
2. Better documentation
3. Detect single & as an ERROR
FIXME:
1. Subshell commands across multiple lines only picks up last word
*/
#include <std... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* and_or_xor.c :+: :+: :+: ... |
C | #include<stdio.h>
#include<stdlib.h>
#define N 100
int cmp(char a,char b){
if((a=='+'||a=='-')&&(b=='*'||b=='/'))return -1;
else if((b=='+'||b=='-')&&(a=='*'||a=='/')) return 1;
else return 0;
}
int main(){
int i=0,j=0;
char a[N],ch;
do
{
ch=getchar();
a[i]=ch;
... |
C | #include "data.h"
#include "process.h"
#include<unistd.h>
void run(Node *instruction,Stack *scope,Stack *inputStack)
{
//////////////////////////////////////////////////
// Recursive loop that grabs the next instruction & proceses it
//
// Uncomment for debugging
// printf("Processing %s [%s] [%s]\n", instruction-... |
C | /**
* @file
*
* @author jeff.daily@pnnl.gov
*
* Copyright (c) 2015 Battelle Memorial Institute.
*/
#include "config.h"
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(_MSC_VER)
#include <io.h>
#define READ_FUNCTION _read
#else
#include <unistd.h>
#de... |
C | #include<stdio.h>
double SquareMeter(int);
int main()
{
int iValue=0;
double dRet=0.0;
printf("Enter a Area in Square Feet :");
scanf("%d",&iValue);
dRet=SquareMeter(iValue);
printf("Area : %lf",dRet);
return 0;
}
double SquareMeter(int iValue)
{
double dSquareFeet=0.0;
dSquareFeet = iValu... |
C | //2+4+6+.....+nth
#include<stdio.h>
int main()
{
int a,s=0,ath,n;
scanf("%d",&n);
a=1;
m:ath=2*a;
s+=ath;
a++;
if(a<=n) goto m;
printf("%d",s);
return 0;
}
|
C | /*TO COMPILE THE PROGRAM PUT BOTH FILES THAT ARE ON MY GITHUB
-majo.h and binary.c
then to start the program start by adding a user:
add ....
to delete a user:
delete user + password
to show the data:
show...*/
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#include"majo.h"
#define LIM 100
int main() {
... |
C | /*
* Copyright (C) 2017, Saul Lawliet <october dot sunbathe at gmail dot com>
* All rights reserved.
*
* 维持首尾两个指针, 和首尾的最大高度, 然后向中间寻找
* 如果遇到'坑', 就把'坑'的深度累加到结果中
*/
#include "c/data-structures/array.h"
#include "c/test.h"
int trap(int *height, int heightSize) {
int rtn = 0,
left_max = 0, right_max = 0,
l... |
C | //
// Vector.m
// Carnivores
//
// Created by Dmitry Nechay on 18.08.09.
// Copyright 2009 Action Forms. All rights reserved.
//
#include "Common.h"
#include "FastMath.h"
#include "Vector.h"
float Vector3D_DistanceToVectorSQR(Vector3D *v, Vector3D *nv, Vector3D *p)
{
Vector3D vc = Vector3D_Su... |
C | #include "Sorter.h"
/* prints an error message and exits the program */
void ERROR(char *error)
{
fprintf(stderr,"ERROR: %s\n",error);
exit(1);
}
/* wrapper around malloc to detect out of memory errors */
void *safeMalloc(size_t size)
{
void *p;
p=malloc(size);
if(p==NULL)
ERROR("Out of me... |
C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int convert_deci(char *s,int b)
{
int q=1,d=0;
int l=strlen(s);
int i;
for(i=l-1;i>=0;i--)
{
if(s[i]>='0'&&s[i]<='9')
{
d+=(s[i]-48)*q;
}
else if(s[i]>='A'&&s[i]<='F')
{
d+=(s[i]-55)*q;
}
q=q*b;
}
return d;
}
long ... |
C | #include <jni.h>
#include <stdio.h>
#include "Arrays.h"
JNIEXPORT jintArray JNICALL Java_Arrays_reverse(JNIEnv * env, jobject obj, jintArray array)
{
jint *body = (*env)->GetIntArrayElements(env,array,0);
jsize len = (*env)->GetArrayLength(env,array);
for (int i = 0; i <= len/2; ++i)
{
int temp = body[i];
bod... |
C | //Tipos de variables
#include<stdio.h>
int main() {
char b = 'F'; //1byte Rango: 0...255 %c
short c = -15; //2bytes Rango: -128...127 %i
int d = 1024; //2bytes Rango: -32768...32767 %i
unsigned int e = 128; //2bytes Rango: 0...65535 %i
long f = 123456; //4bytes %li
float g = 15.678; //4bytes %f
double h = 12312... |
C | #ifndef ARRAY_HEADER
#include <stdlib.h>
/* array(int) my_variable; */
#define array(__data_type, __args...)\
__data_type* ## __args
/* array_new(int, 10); */
#define array_new(__data_type, __size) \
(__data_type*)malloc(__size * sizeof(__data_type))
/* array_resize(int, 20); */
#define array_resize(__data_... |
C | #include "holberton.h"
/**
* _pow - calculates the value of `x` to the power of `y`
* @x: the base integer
* @y: the exponent integer
*
* Return: the result of `x` raised to the power of `y`
*/
int _pow(int x, int y)
{
if (y > 0)
return (x * _pow(x, y - 1));
else if (y < 0)
return (-1);
else
return (1)... |
C | /******************************************************************************
* @file Madragon main program. *
* @author Linas Kaminskas and Nis Agger. *
* @date 29-10-2015 *
... |
C | #include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
main()
{
int count = 0;
while (count < 100)
{
printf("This goes on forever, HELP!!!\n");
count +=10;
printf("\t%d", count);
count -= 10;
printf("\t%d", count);
pri... |
C |
#include <stdio.h>
#include <alloc.h>
#include <conio.h>
#include "matrixop.h"
float *aloca( int dim1, int dim2 )
{ float *rez;
rez = (float*) malloc( dim1*dim2*sizeof(float) );
return rez;
}
void atribuie_val( float *mat, int dim1, int dim2 )
{ float i,j;
for(i=0;i<dim1;i++)
for(j=0;j<dim... |
C | /*
Minimal TCP client example. The client connects to port 8080 on the
local machine and prints up to 255 received characters to the console,
then exits. To test it, try running a minimal server like this on your
local machine:
echo "Here is a message" | nc -l -6 8080
*/
#include <sys/types.h>
#i... |
C | #ifndef CONV_H
#define CONV_H
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include "uwnet.h"
#include "image.h"
// Add bias terms to a matrix
// matrix m: partially computed output of layer
// matrix b: bias to add in (should only be one row!)
void forward_convolutional_bias(matrix m, matrix b);
// Cal... |
C | /*Write a program that reads three floating values and check if it is possible
to make a triangle with them
*/
#include<stdio.h>
int main(){
int s1,s2,s3;
printf("Enter length of first side\n");
scanf("%d",&s1);
printf("Enter length of second side\n");
scanf("%d",&s2);
printf("Enter length of third side\n");
sca... |
C | //Programa 9: desenvolver um programa que utilize a função concat(char *str1, char *str2) para concatenar duas strings. A função deve fazer a alocação dinâmica de memória para acomodar a nova string concatenada na memória. Lembre-se de verificar o tamanho do espaço de memória disponível e caso não haja espaço suficient... |
C | #include<stdio.h>
#include<signal.h>
#include<stdlib.h>
#include<unistd.h>
void ouch(int sig){
printf("Oh, I got signal %d\n", sig);
(void) signal(SIGINT, SIG_DFL);
}
int main(){
(void) signal(SIGINT, ouch);
while(1){
printf("hello world!\n");
sleep(1);
}
}
|
C | #include "hash_tables.h"
/**
* key_index - return the index which the key should be save
* @key: The key of the disctionary
* @size: The size of the array
* Return: The index. This index is the value of the size % hash of key.
*/
unsigned long int key_index(const unsigned char *key, unsigned long int size)
{
uns... |
C | //аналог ls -l и ls-lR (а так же ls файлового)
//Компиляция: gcc art-ls.c -o art_ls
//Пример запуска: ./art_ls -lR /home/user/Desktop/
#include <string.h>
#include <stdio.h>
#include <sys/stat.h>
#include <grp.h>
#include <stdlib.h>
#include <dirent.h>
#include <time.h>
#include <pwd.h>
inline void abort_prg(const... |
C | # include <stdio.h>
int main(){
int a[] = {2,3,7,8,8,12}, aL = sizeof(a)/sizeof(int);
int b[] = {7,8}, bL = sizeof(b)/sizeof(int);
int i, j, k;
int c[20];
for(i=0, j=0, k=0 ; ; ++k){
if((i >= aL-1)&&(j >= bL-1))
break;
else if(j >= bL-1){
c[k] = a[i];
i++;
continue;
}
else if(i >= aL-1... |
C | #include <stdio.h>
int main()
{
int marks;
printf("Enter marks: ");
scanf("%d", &marks);
if (marks>=85 && marks<=100)
printf("The kid's grade is A!");
else if (marks>=70 && marks<85)
printf("The kid's grade is B!");
else if (marks>=55 && marks<70)
printf("The kid's grade is C!");
else if (mar... |
C | /*
barrier_nocheck.c
Sets up a barrier blocking n threads.
If more than n arrive, the rest can go through.
Doesn't check for errors.
*/
#include <pthread.h>
#include <stdio.h>
static pthread_cond_t bcond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t bmutex = PTHREAD_MUTEX_INITIALIZER;
static int count ... |
C | /* Description: This file checks the if there is missing files from jan-may missing txt files
Compile Instructions:
* gcc -o check_jan-may_missing_txt check_jan-may_missing_txt.c -std=c99
* ./check_jan-may_missing_txt
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
int main() {
... |
C | #include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int c,f;
//nhap do c
printf("nhap do c =");
scanf("%f", &c);
printf("nhap do f =");
scanf("%f", &f);
c =((f-32)/9)*5;
}
|
C | /**
* @file
* VuoMesh C type definition.
*
* @copyright Copyright © 2012–2016 Kosada Incorporated.
* This code may be modified and distributed under the terms of the MIT License.
* For more information, see http://vuo.org/license.
*/
#ifndef VUOMESH_H
#define VUOMESH_H
#include "VuoPoint2d.h"
#include "VuoPoin... |
C | #include "human.h"
struct teacher {
human thehuman; // "human"
int WorkExp; //
char Degree[40]; //
char FacultyName[30]; //
};
//
void SetDegree(teacher* edit_teacher, char new_degree[]);
//
void SetFacultyName(teacher* edit_teacher, char new_facultyname[]);
//
teacher CreateTeacher(human buf_human, ... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a = 7;
int b = a & ;
printf("%d\n", b);
} |
C | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdbool.h>
void main(){
int mat[8][8],i,j;
bool sim = true;
loop:
srand(time(NULL));
for(i = 0;i < 8;i++){
for(j = 0;j < 8;j++){
mat[i][j] = rand()%2;
}
}
for(i = 0;i<8;i++){
for(j = 0;j < 8;j++){
if(mat[i][j] ... |
C | #ifndef STRUCTSERVIDOR_H_
#define STRUCTSERVIDOR_H_
#include <stddef.h>
/* Este es el Struct que manda el Servidor, y recibe el Cliente */
typedef struct structServidor structServidor_t;
structServidor_t* structServidor_crear(unsigned int id, int x, int y, int estado, unsigned int tipo);
unsigned int structServidor... |
C | /*һά.
ÿдǵģÿдϵǵ.
вһǷڡ
ʱ临ӶСO(N)
飺
1 2 3
2 3 4
3 4 5
1 3 4
2 4 5
4 5 6
1 2 3
4 5 6
7 8 9*/
#include<stdio.h>
#include<Windows.h>
#define N 3
#pragma warning(disable:4996)
int Find(int a[N][N], int row, int col)
{
int key;
printf("Ҫҵ\n");
scanf("%d", &key);
int row1 = row - 1;
int col1 = 0;
while (row1 < row&&col1 ... |
C | // gcc -Wall -g `pkg-config --libs --cflags gtk+-3.0` label.c -o label
#include <gtk/gtk.h>
static void on_window_closed (GtkWidget *widget, gpointer data)
{
gtk_main_quit ();
}
int main (int argc, char *argv[])
{
GtkWidget *window, *label;
/* Initialization */
gtk_init (&argc, &argv);
/* Create... |
C | #include <stdio.h>
// int aloca(int numero){
// int contador, *numeros;
// numeros = (int *)malloc(num*sizeof(int));
// for(contador = 0; contador < numero; contador++){
// printf("Numero [%d]: ", contador + 1);
// scanf("%d", &numeros[contador]);
// }
// return numeros;
// }
// float media(int... |
C | /* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strtol.c .:: .:/ . .:: ... |
C | /*********************************************************************
genmapcon.c
written by IL
edited by CAS
EDIT: change zoom from *2.0 to +0.5
********************************************************************/
#include "fpp.h"
void highlightmarker(BOOL high);
#define ZINC 0.25
/********... |
C | /*Scrieți un program care afișează numerele pare cuprinse
între 1 și x, unde x este un număr întreg citit de la
tastatură.*/
#include <stdio.h>
void main() {
int n, i;
printf("Introdu un numar:\n");
scanf("%d", &n);
printf("Numerele pare in ordine crescatoare de la 1 la %d sunt: 1 \n", n);
for (i = 1; i <= n;... |
C | /*
** my_framebuffer_create.c for my_framebuffer_create in /home/lyliya/rendu/G_Graphical_prog
**
** Made by Guillaume
** Login <lyliya@epitech.net>
**
** Started on Mon Nov 14 07:50:48 2016 Guillaume
** Last update Wed Jan 4 15:30:01 2017 Guillaume
*/
#include <unistd.h>
#include <stdlib.h>
#include "my.h"
t_m... |
C | #include <stdio.h>
#include <string.h>
int wcount(char *s) {
int words, space, c;
char carray[128];
memset(carray, 0, 128);
words = c = 0;
space = 1;
if (gets(carray) && strlen(carray) > 0) {
for (c = 0; c < strlen(carray); c++) {
if (isspace(carray[c])) {
if (!space) {
words++;
}
sp... |
C | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
//关于结构体的使用
/*情景: 图书馆里的书 有四个属性
1, Title
2, Author
3, Subject
4, Book ID*/
//结构体的定义
/*
struct tag{
member-list
member-list
member-list
...
}variable-list;
tag 是结构体的标签
member-list是标准的变量定义, 比如 int/float 或者其他有效的变量定义
variable-list 结构变量,定义在结构体的末尾,最后一... |
C | //environment.h: scanning for walls, holes, and victims
const double coordToGPS = 0.06; //the gps measurement that corresponds to one tile
pair<int, int> getCoords() {
//use GPS coordinates to get integer coordinates of the robot
pair<double, double> diff;
pair<int, int> newCoords = startingCoord;
diff... |
C | #include <Stdio.h>
int main ()
{
long n,a,d,i;
a=0;
d=0;
char s[100000];
scanf("%li",&n);
for(i=0;i<=n;i++)
{
s[i]=getchar();
if(s[i]=='A') a++;
if(s[i]=='D') d++;
}
if(a>d) printf("Anton");
if(d>a) printf("Danik");
if (d==a) p... |
C | // RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_fixunssfsivfp
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
extern unsigned int __fixunssfsivfp(float a);
#if defined(__arm__) && defined(__ARM_FP) && (__ARM_FP & 0x4)
int test__fixunssfsivfp(float a)
{
unsigned int actual = __... |
C | #include<stdio.h>
#include<string.h>
void main()
{
char s[100];
int count = 0;
char c;
printf("Enter a sentence: ");
gets(s);
printf("Enter a character to know it's repetance in sentence: ");
scanf("%c", &c);
for(int i = 0; i < strlen(s); i++)
{
if(s[i] ... |
C | #include<stdio.h>
int main()
{
char str[100];
int i,j;
printf("Enter the String: ");
fgets(str,sizeof(str),stdin);
for(i=0;str[i]!='\0';i++)
while(!(str[i]>='a'&&str[i]<='z')&&!(str[i]>='A'&&str[i]<='Z')&&!(str[i]=='\0'))
{
for(j=i;str[j]!='\0';j++)
{
... |
C | #include "stdio.h"
int main(){
int A,B,C;
int A_temp,B_temp,C_temp;
scanf("%d %d %d",&A,&B,&C);
int roomcounter=0;
while (1)
{
if ((A%2==1)||(B%2==1)||(C%2==1)) {
break;
}
if (A==B) {
if (A==C) {
... |
C | /* ppa.c
a) Escreva um programa que processe os argumentos da linha
de comando, inicialize a estrutura de tipo "vector_t" a usar e,
finalmente, mostre o estado do vector partilhado por via da invocação
da função "print_vector()" (incluída em util.c)
Exemplo de invocação:
./ppa 6000 4000
*/
#include ... |
C | /*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
/*
* A simple main function that gives a command line to the CuTest suite.
* It lets users run the entire suites (default), or choose individual
* suite(s), o... |
C | /**
* WipEout Pure DLC Region Converter
* Copyright 2021 Thomas Perl <m@thp.io>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWA... |
C | #include "headers.h"
int delay(int sec)
{
int mili = 1000 * sec;
clock_t timestart = clock();
while (clock() < timestart + mili)
{
fd_set fds;
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 0;
int ret_val;
FD_ZERO(&fds);
FD_SET(0, &fds);
r... |
C | #include <stdio.h>
int main(void){
int i,j,k;
for(i=0;i<6;i++){
for(j=0;j<6-i;j++){
printf(" ");
}
for(k=0;k<=i;k++){
printf("* ");
}
printf("\n");
}
} |
C | /*
** EPITECH PROJECT, 2018
** init_3.c
** File description:
** initialisation
*/
#include <stdlib.h>
#include <fcntl.h>
#include "map.h"
#include "my.h"
int get_next_nd(char *str)
{
for (; *str != ','; str++);
str++;
return (my_getnbr(str));
}
int get_option(char *str)
{
for (; *str != ','; str++);
str++;
for... |
C | #include <zjunix/vfs/vfs.h>
#include <zjunix/vfs/err.h>
#include <zjunix/vfs/errno.h>
#include <driver/vga.h>
#include <zjunix/debug/debug.h>
/****************************** 外部变量 *******************************/
extern struct dentry * pwd_dentry; /* 当前工作目录 */
extern struct vfsmount ... |
C | /********************************************************************
* Nombre : ALEAT01.H *
* Funcin : Variables aleatorias. *
* Parmetros : -- *
* Compilador : Turbo C++ v1. *
* Hecho por : Jos Rafael Sosa Briceo. ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi_base.c :+: :+: :+: ... |
C | //
//
////
////
////#include <stdio.h>
//////1~4
////#if 0
//////1
////int odd_cnt(int n){
//// int i,cnt = 0;
//// for (i = 1; i <= n; i++){//i=0;i<n안됨
//// if ((i % 2) != 0) cnt++;
//// }
//// return cnt;
////}
//////2
////int odd_sum(int n){
//// int i, sum = 0;
//// for (i = 1; i <= n; i++)... |
C | /**********************************************
* *
* ļ: 05_array_lists\01 SequenceArray *
* *
* ļ: SequenceArray.h *
* *
* : زб *
* ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.