language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
#include <stdlib.h> #include <stdio.h> union type{ int i; float f; }; int main (int argc, char **argv){ union type toto[]={1,0.1,2,"la"}; return 1; }
C
#include "toTcpClientThread.h" #include <pthread.h> //Thread que se encarga de la comunicacion desde la EDU-CIAA hacia el socket TCP. void* toTcpClient (void* arg) { int *conectionFd=(int*) arg; char buffer[BUFFER_SIZE]; int i,nr; //Contadores parciales int n; //Contador total de caracteres en el buffer...
C
#include "timers.h" #include "globalvars.h" #include "sudoku_cube.h" #include <GL/glut.h> #include <assert.h> #include <unistd.h> /* globalne promenljive * inicijalizacija aktivnosti tajmera */ int timer_rotate_active = 0; int timer_move_active = 0; int timer_spin_active = 0; int timer_jump_active = 0; /* vreme ...
C
#include "stdio.h" #include "stdlib.h" #include "sys/types.h" #include "sys/wait.h" //функция переворачивающая слово void reverse(char* beg, char* end){ char* from = beg; char* to = end + 1; char sym; while(beg < end) { sym = *beg; *beg = *end; *end = sym; ++beg; --end; } while(from < to) { printf("...
C
/* * LibpigpioWrap_main.c * * Created on: 2018/09/18 * Author: CountrySideEngineer */ #include <stdio.h> #include "pigpio.h" #include "LibpigpioWrap.h" #define LIB_VERSION_MAJOR (0xFF) #define LIB_VERSION_MINOR (0x01) static int IsInit = 0; /** * @brief Initialize pigpio l...
C
#include<stdio.h> void main(){ int n,i,*p; printf("Nhap n:\n"); scanf("%d",&n); p=(int*)malloc(n*sizeof(int)); for(i=0;i<n;i++) { printf("a[%d]=",i+1); scanf("%d",p+i); } int max,min; max=min=*p; for(i=0;i<n;i++) { if(*(p+i)>max) max=*(p+i); if(*(p+i)<min) min=*(p+i); } printf("max=%d\...
C
/* This program is to print the counts taken for the element 1 to reach to the middle of a 5*5 matrix*/ #include<stdio.h> int main() { int A[5][5]; int i, j; int c = 1; for(i = 1; i <= 5; i++) { for(j = 1; j <= 5; j++) { scanf("%d ",&A[i][j]); } } for(i = 1; i <= 5; ...
C
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include <limits.h> #include <pthread.h> #include <stdbool.h> #include<semaphore.h> #define DEFAULT_CONSUMERS 1 pthread_mutex_t print_mutex, buffer_mutex; sem_t wake_consumer, wake_producer; int number_of_consumers = DEFAULT_CONSUMERS; ...
C
#include <stdlib.h> #include <stdio.h> #include <locale.h> #define SIZE 99 //int mode(int freq[],const int *answer[]); //int printArray(const int *a[]); //int mean(const int *answer[]); //int median(int answer[]); //int bubbleSort(int n, int (*a)[n]); int mean(int *answer[]) { int total; int j; total = 0; prin...
C
#include<stdio.h> #include<cs50.h> void SayHello(); int main(void) { SayHello(); } void SayHello() { string Name = get_string("What is your name ?\n"); printf("hello , %s\n", Name); }
C
/****************************************************************************** * Author: Kyle Chisholm * Title: Lab3-prog1 * Date: 05/02/2015 * Course: CST8244 Real-Time Programming * Instructor: Douglas King *****************************************************************************/ #include <stdio.h> #inclu...
C
#include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/mman.h> #include <sys/stat.h> #include <stdlib.h> int main(int argc, char *argv[]){ struct stat statbuf; if (stat(argv[1], &statbuf) == -1) { printf("Usage: %s <code.bin>\n", argv[0]); exit(0); } void * a = mmap(0, statbuf.st_siz...
C
// RUN: test.sh -e -t %t %s #include <string.h> // memcmp() past the end of a memory object. int main() { char c[] = "abcdef"; char *d = &c[0]; memcmp(&c[0], d, 20); return 0; }
C
/* * * SNOOPY * * Laís Mendes & Helena * * TR2 1/2018 * */ #include "types_global.h" #include "snoopy.h" void spider (void) { pid_t pid; while(1) { //requisicoes vindas do navegador conexao_cliente = esperandoRequisicao (proxy_socket); //a funcao fork cria uma thread filho rodando as me...
C
#include "includes.h" #include "helper.h" #include "game_state.h" #include "mtwister.h" void init() { helperData.digitsSprite = spriteCreate("assets/digits.png", 8, 9); helperData.blocksSprite = spriteCreate("assets/blocks.png", 8, 8); helperData.buffer = (char *) malloc(128); } void draw(SDL_Texture * te...
C
#include<stdio.h> int find(int num); int main() { int i, n, friendnum[40] = {0}, count = 0, flag = 0, temp; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%d", &temp); friendnum[find(temp)] = 1; } for(i = 0; i < 40; i++) { if(friendnum[i] == 1) { count++; } } printf("%d\n", count); for(i =...
C
/* ######################### # # # OMANSAK # # # ######################### Reverse A Singly Linked List */ #include <stdio.h> #include <stdlib.h> struct LinkedList { int Item; struct LinkedList *Next; }; typedef struct LinkedList *xL...
C
/** * \file production.c * \brief Fichier contenant les fonctions utiles pour le calcul de la production photovoltaique * \author Benoit Eche * \date 28/08/11 */ #include "../inc/production.h" //Fonctions /** * \name Rendement_geo * \brief Renvoi le rendement geographique * \param ST_DonneGeo Donnee...
C
#include <windows.h> #include <stdio.h> #include <tchar.h> #include <Psapi.h> #include <strsafe.h> #pragma comment( lib, "Psapi.lib" ) void ErrorExit(LPTSTR lpszFunction); DWORD PROCESSMANAGE_GetProcessesIDs(DWORD *pwszProcesses, int size); PWSTR PROCESSMANAGE_GetProcessName(DWORD dwPid); DWORD PROCESSMANAGE...
C
#include <stdlib.h> #include <stdio.h> extern void FrazioneEgizia(int n, int d); void rec(int n, int d){ if(d%n==0) return; int under = d/n; } void FrazioneEgizia(int n, int d){ if(n<=0 || d<=0 || n>=d){ printf("\n Impossibile convertire la frazione data in frazione egizia."); re...
C
#include<stdio.h> int main() { int i,j,k,u,v,n,cost[10][10],dist[10]; printf("Enter the number of vertices: "); scanf("%d",&n); printf("Enter the source vertex: "); scanf("%d",&v); printf("Enter the cost matrix: "); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&cost[i][j]); for(i=1;i<=n;i++) ...
C
#include<stdio.h> int converter(); int main (){ int celcius; printf("Enter the value of celcius:\n"); scanf("%d",&celcius); printf("The Value Of farhenhiet is %d\n",converter(celcius)); return 0; } int converter(int celcius){ int farhen ; farhen = (celcius * 9/5) + 32; r...
C
/** * \file vccrypt_key_agreement_keypair_create.c * * Create a keypair using the provided keypair algorithm. * * \copyright 2017 Velo Payments, Inc. All rights reserved. */ #include <cbmc/model_assert.h> #include <string.h> #include <vccrypt/key_agreement.h> #include <vpr/abstract_factory.h> #include <vpr/para...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* geometry_line.c :+: :+: :+: ...
C
#define BUFSIZ 1024 int read(int, char *, int); int write(int, char *, int); int main(void) { char buf[BUFSIZ]; int n; while ((n = read(0, buf, BUFSIZ)) > 0) write(1, buf, n); return 0; }
C
#ifndef _INTERRUPT_H_INCLUDED_ #define _INTERRUPT_H_INCLUDED_ extern char softvec; #define SOFTVEC_ADDR (&softvec) /* * ソフトウェア割り込みベクタの種類 *(わかりやすいようにsoftvec_type_t型とする) */ typedef short softvec_type_t; /* * 割り込みハンドラの型の定義 * (割り込みハンドラ(関数)をsoftvec_handler_t型とする) */ typedef void (*softvec_handler_t)(softvec_type_t ...
C
#include<stdio.h> int main() { char ch; printf("\n enter a character"); scanf(" %ch",&ch); if(ch=='a'||ch=='A'||ch=='e'||ch=='E'||ch=='i'||ch=='I'||ch=='o'||ch=='O'||ch=='u'||ch=='U') { printf("\n entered character is a vowel"); } else { printf("\n entered character is a ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* input_data.c :+: :+: :+: ...
C
/* For the certain electrical circuit with an inductance L and resistance R, the damped natural frequency is given by frequency = sqrt((1/LC)-(R^2/4*C^2)) it is described to study the variation of this frequency with C (capacitance). Write a program to calculate the frequency for different values of C starting from 0....
C
// dir watch #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/types.h> #include <sys/inotify.h> #include <string.h> #define EVENT_SIZE (sizeof(struct inotify_event) + FILENAME_MAX + 1) #define BUFF_SIZE 128 * EVENT_SIZE void poll_for_file(int fd); int main (int argc, char * argv[]) { int ...
C
/* libdlb - data structures and utilities library * Copyright (C) 2013 Daniel Beer <dlbeer@gmail.com> * * 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 cop...
C
// 1 // 1 1 // 1 1 2 // 1 1 2 3 // 1 1 2 3 5 #include<stdio.h> int main(){ int n; int t1=0,t2=1,t3,i,j; printf("Enter the no. of terms:") scanf("%d",&n); for(i=1;i<=n;i++){ t1=0; t2=1; printf("%d\t",t2 ); for(j=1;j<i;j++){ t3=t1+t2; printf("%d\t",t3 ); t1=t2; t2=t3; } printf("\n"); } }
C
#include <stdio.h> #include <string.h> int main(void) { char* s1 = "abcd"; char* s2 = "abce"; if (strcmp(s1, s2) < 0) printf("s1 is less than s2"); else printf("s1 is greater than or equal to s2"); return 0; }
C
#include <stdio.h> int rata1[3], rata2[3], gabung[6],hasil[6]; void depan(int n[3], int bilInt[3][20]){ int i,j; for( i=0; i<3; i++){ rata1[i] = 0; for(j =0 ; j< n[i]/2; j++){ rata1[i] = rata1[i] + bilInt[i][j]; } rata1[i] = rata1[i] / (n[i]/2); } } void belakang(int n[3], int bilInt[3][20]){ int i,...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* draw_graphics.c :+: :+: :+: ...
C
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<signal.h> #include<string.h> void act(int signo); int main() { int i=0; struct sigaction sig; sig.sa_handler=act; sigemptyset(&sig.sa_mask); sig.sa_flags=0; if(sigaction(SIGTSTP,&sig,0)==-1) { printf("signal(SIGTSTP) error\n"); return -1; ...
C
/****************************************************************************** * * SEMPRA PROJETOS (PIC32MX775F256L) * ****************************************************************************** * Nome do Arquivo: Mostradisplay7seg_main.c * Dependencias: Veja a seo INCLUDES abaixo *...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstnew.c :+: :+: :+: ...
C
#pragma once #include "ctdl.h" #include "InOutFile.h" //============================================================ void menu(); void themLop(DSLOP &dsl); void xuatDSL(DSLOP &dsl); int ktTrung(string a, DSLOP dsl); void xoa(DSLOP dsl); string taoMaLop(DSLOP dsl); //===========================================...
C
#include <stdio.h> #include <string.h> #include <unistd.h> int strcmp(const char *s1, const char *s2) { // Always return 0. printf("\ncompare %s and %s\n",s1,s2); printf("reversed "); for(int i=strlen(s2); i>=0; i--){ printf("%c", s2[i]); } printf("\n"); return 0; } int usleep(__useconds_t usec){ r...
C
/* ** Assuming that mid = (N-1)/2 for even sized array ** and mid = N/2 for odd size linked list */ #include<stdio.h> #include<stdlib.h> struct Node { int data; struct Node *next; }; void printList(struct Node *node) { while (node != NULL) { printf("%d ",node->data); ...
C
#include <stdio.h> int main(){ double x,y; printf("请输入x的值:"); scanf("%lf",&x); if (x<1) y=x; else if(x>=1&&x<10) y=2*x-1; else y=3*x-11; printf("y的值是:%6.0lf",y); return 0; }
C
#pragma once #include <GLKit/GLKMath.h> static const GLKVector2 GLKVector2Invalid = { .x = NAN, .y = NAN }; static inline bool GLKVector2IsInvalid(GLKVector2 vector); /// Just GLKVector2Length() with the sqrt() operation removed. static inline float GLKVector2LengthSqr(GLKVector2 vector); /// Just GLKVector2Dist...
C
#include <linux/module.h> #include <linux/kernel.h> #include "../asm_util.h" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Your name"); MODULE_DESCRIPTION("PMUON"); void cache_performance_test_with_setup(void){ printk("\n\nNow use event counters to read data cache performance.\n\n"); unsigned int event_counters[] ...
C
#include<stdio.h> int a[2000002]; int n; int main() { int i,m=0; scanf("%d",&n); for(i=0;i<n*2+1;i++) { scanf("%d",&a[i]); m=m ^ a[i]; } printf("%d\n",m); return 0; }
C
#include <stdio.h> #include <stdlib.h> #include "../common/linkedlist.h" void push(Node **head, int data) { Node *current = (*head); Node *new_node = (Node *) malloc(sizeof(Node)); new_node->data = data; new_node->next = NULL; if (*head == NULL) { *head = new_node; return; ...
C
// import java.io.*; // import java.lang.*; // import java.util.*; // #!/usr/bin/python -O #include <stdio.h> #include <stdlib.h> #include <string.h> #include<stdbool.h> #include<limits.h> // #include<iostream> // #include<algorithm> // #include<string> // #include<map> // #include<vector> // using namespace std; ...
C
/* * File: PotholeFillingKarel.c * ------------------------------ * The PotholeFillingKarel program puts a beeper into a pothole * on 2nd Avenue. This version of the program uses no * decomposition other than turnRight and turnAround, * which are implemented in this program. */ #include "karel.h" void setup() ...
C
#include <stdio.h> int sum(void); int main(void) { int total; printf("Please Enter Your Integers => \n"); total = sum(); printf("Your result is %d", total); return 0; } int sum(void) { int i, num, sum=0; for(i=0; i<10; i++) { scanf("%d", &num); sum = sum+num; ...
C
/* RenderPreBoot Created by Peter Pearson in 2018. Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to ...
C
#include<stdio.h> #include<string.h> int main(void) { int i ; for(i = 0; i< 256; i++){ fprintf(stderr,"errno %d : %s\n",i,strerror(i)); } return 0; }
C
// program to illustrate the use of postfix/prefix increment/decrement operators. #include<stdio.h> int main() { int a,b,c,d,x,y,z,t; printf("enter a,b,c,d values: "); scanf("%d%d%d%d", &a,&b,&c,&d); x = a++; y = ++b; z = c--; t = --d; printf("\nvalue of x = %d\n", x); printf("\nv...
C
#include <stdlib.h> #include <string.h> #include <limits.h> #include "registers.h" #include "intermediate_code.h" #include "symbol_table.h" #include "address.h" #include "location.h" #include "assembly.h" static REGISTER_DESCRIPTORS* _reg; LINKED_LIST** get_register_descriptor(REG r) { if(!_reg) { _reg = ...
C
#include "bsp_int.h" /* 中断嵌套计数器 */ static unsigned int irqNesting; /* 中断处理函数表 */ static sys_irq_handle_t irqTable[NUMBER_OF_INT_VECTORS]; /** * default_irqhandler() - 默认的中断服务处理函数 * * @giccIar: 中断号 * @userParam: 中断服务处理函数参数 * * @return: 无 */ void default_irqhandler(unsigned int giccIar, void *...
C
#include "Triangle.h" #include <math.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h> struct triangle_impl_struct { int circumference; bool rotate; }; static triangle_vtable global_vtable; static bool vtable_init = false; static void init_global_vtable(); /* * * * * * * */ static void draw(T...
C
#include <stdio.h> int main(){ int len; char origen[]="Origen"; char destino[7]; strcpy(destino, origen); printf("destino: %s ", destino); system("Pause"); return 0; }
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> int main (int argc, char * argv[]){ int fd, cont = 0, indice = 0, cont_linea = 1, linea; char caracter; ssize_t cant; /*cantidad de argumentos que usaremos*/ if(argc <3)...
C
#include <stdio.h> #include <stdlib.h> enum {NORTH, SOUTH, EAST, WEST} direction; int main() { int x = 10, y = 20; direction = NORTH; switch(direction) { case NORTH: y-= 1;break; case SOUTH: y+= 1;break; case EAST: x+= 1;break; case WEST: x-= 1;break; default: break...
C
// // Created by Cindy Lieu on 10/17/19. // /* * (a) sort.c will contain the main program, which essentially reads in the input, calls quicksort and prints the sorted output. The user is asked how many elements he wishes to sort. An array of the corresponding size is created dynamically. Then he is asked to ent...
C
#include <unistd.h> #include <stdlib.h> #include <stdio.h> #define A_MEGABYTE (1024 * 1024) int main() { char *some_memory; int megabyte = A_MEGABYTE; int exit_code = EXIT_FAILURE; some_memory = (char *)malloc(megabyte); if (some_memory != NULL) { sprintf(some_memory, "Hello World\n"); ...
C
#include "city.h" #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include "utils.h" #include <math.h> #include <string.h> void load_cities(city_t** list, size_t* n, FILE* file) { if (*list) { return; // Don't override the existing data in memory. } size_t size = 0; const size_t in...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* set_envar.c :+: :+: :+: ...
C
//#include <iostream> #include <stdio.h> #include <unistd.h> #include <stdlib.h> //using namespace std; int main(int argc, char *argv[]) { if(sizeof(void *) == 8) //cout << "Pointers are 8 bytes (64 bit mode)\n"; fprintf(stderr,"Pointers are 8 bytes (64 bit mode)\n"); else //cout << "Pointe...
C
/* ** test.c for my_put_nbr in /home/daniel_b/Piscine_C_J03 ** ** Made by Erwan DANIEL ** Login <daniel_b@epitech.net> ** ** Started on Thu Oct 2 01:37:20 2014 Erwan DANIEL ** Last update Sun Feb 1 19:39:37 2015 DANIEL Erwan */ int get_next(int number) { char c; c = (number % 10) + 0x30; if (number < 10)...
C
#ifndef EXERC1_REC #define EXERC1_REC #include <stdio.h> #include <stdlib.h> // estrutura de no para lista encadeada typedef struct no Lista; //cria uma nova lista //Entrada: nenhuma //Retorno: Nova Lista //Pre-condicao:Nenhuma //Pos-condicão:Lista criada Lista* criarLista(); // Testa se uma lista eh ...
C
#include <stdlib.h> #include <stdint.h> int calcola_minimo(int *v, size_t n) { int min = v[0]; for (size_t i = 1; i < n; i++) { if (v[i] < min) min = v[i]; } return min; } int main() { int v[5] = { 3,1,6,8,56 }; int min, size = 5; min = calcola_minimo(v, size); return 0; }
C
/* Copyright (c) 2020 Victorien Elvinger Licensed under the zlib license (https://opensource.org/licenses/zlib). */ #include <signal.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #define TIME_BEFORE_SLEEPING 12 /* * \r cursor at the begining of the line * \x1b[K erase the lin...
C
#include <stdio.h> int main(){ long long int t; scanf("%lld", &t); while(t--) { long long int n, n0 = 0, n1 = 0; scanf("%lld", &n); char b[n+1]; scanf("%s", b); for (int i = 0; i < n; i++){ b[i] == '1'? n1++: n0++; } if (n&1) { ...
C
#include <stdio.h> #include <stdlib.h> int main() { long long p = 600851475143, it, high = 0; for (it = 3; it <= p; it += 2) if (p % it == 0) { p /= it; high = it; } printf("%llu\n", high); }
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* token_utils.c :+: :+: :+: ...
C
/* Disciplina: Computacao Concorrente */ /* Prof.: Silvana Rossetto */ /* Laboratório: 2 */ /* Codigo: Multiplica uma matriz por um vetor */ #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include "timer.h" #include <unistd.h> //variaveis globais float *matA; //matriz de entrada float *matB; //matriz de ...
C
#include<stdio.h> int main () { int b[10][10],n, i, j, k, a[10][10]; printf ("\nEnter the number of nodes: "); scanf ("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { printf ("\nEnter the distance between the host %d%d:", i + 1, j + 1); scanf ("%d", &a[i][j]); } } for (...
C
#include <stdio.h> #include <unistd.h> int main(int argc, char* argv[]) { char buf[16]; char digits[8] = {'0', '1', '2', '3', '4', '5', '6', '7'}; int index; int option; printf("640k is enough for anyone!\n"); while (1) { printf("Give option: \n"); printf("1. Read digit.\n"); printf("2. Write a message.\n...
C
#include "../hdr/control.h" void run(node_Arvore **raiz) { int op; do { system("cls"); menu(); scanf("%d", &op); system("cls"); switch(op) { case 1: { listar_Arvore(*raiz); system("pause"); ...
C
#include <stdio.h> #include <stdlib.h> /** * main - the main fuction of the program * @argc: the array index for each command flag * @argv: the array of commands flags * ---------------------------- * Return: void */ int main(int argc, char **argv) { if (argc < 3 || argc > 3) { printf("Error\n"); return (1); } ...
C
#include <stdio.h> /** * main - prints name of file followed by a new line * @argv: argument vector * @argc: argument counter * Return: 0 if successful, non-zero otherwise */ int main(int argc, char *argv[]) { (void)argc; printf("%s\n", argv[0]); return (0); }
C
#include "client.h" void main(int argc, char *argv[]) { ClientSetup(argv); char *name = argv[4]; hThread[0] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)SendDataThread, name, 0, NULL); hThread[1] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)RecvDataThread, NULL, 0, NULL); hThread[2] = CreateThread(NULL, 0...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define TRUE 1 #define FALSE 0 typedef int bool; char matChess[8][8][10] = { "bR1", "bN1", "bB1", "bQ1", "bK", "bB2", "bN2", "bR2", "bP1", "bP2", "bP3", "bP4", "bP5", "bP6", "bP7", "bP8", " ...
C
#include <stdio.h> int x=5; int* p=&x; int main() { printf("My pointer: %d\n", *p); *p = 10; printf("My pointer: %d\n", *p); int y = 3 + 5 * (*p); int* anotherPointer=0; anotherPointer=&y; printf("My other pointer: %d\n", *anotherPointer); }
C
#include "libmx.h" unsigned long mx_hex_to_nbr(const char *hex) { if (hex == NULL) return 0; unsigned long res = 0; while (*hex != 0) { if ('0' <= *hex && *hex <= '9') res += *hex - '0'; if ('a' <= *hex && *hex <= 'z') res += *hex - 'a' + 10; if ('A' <= *hex && *hex <= 'Z') res ...
C
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <dirent.h> #define PATH1 "/proc" #define PATH2 "/task" #define MAXLEN 1024 typedef struct procInfo { pid_t pid; char comm[MAXLEN]; struct proInfo *parent; struct proInfo *...
C
#include <stdlib.h> #include <stdio.h> /* project euler problem 3 : The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? */ int main() { unsigned long long int n = 600851475143; long int div=2, ans = 0, maxFact; while(n!=0) { if(n %...
C
#include "utils.h" #include <stdarg.h> #include <stdio.h> #include <time.h> #include <sys/time.h> static enum log_level set_level = LOG_ALL; static FILE* log_file = NULL; void log_init(){ log_file = fopen("Controleur.log","w"); } void _log(enum log_level level, const char *fmt, ...) { va_list arg; /* Ch...
C
/* -*-C-*- * * $Header: /ax/networking:Internet/build/svcprint.c:networking 1.2 $ * $Source: /ax/networking:Internet/build/svcprint.c: $ * * Copyright(c) 1994 Acorn Computers Ltd., Cambridge, England * * svcprint.c * * print debugging information down the TML tube link. * * provides: * %s - string *...
C
/* ============================================================================ Name : ai.c Author : Siyang Qiu Description : AI solver for peg solitaire game ============================================================================ */ #include <time.h> #include <stdlib.h> #include <limits.h> #inc...
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include "queue.h" #include "image.h" #include "colorimage.h" #include "growcut.h" #include "show_image.h" #include "point.h" #include "morphology.h" #include "filtersAndGrads.h" #include "LBP.h" #define NEIGHBOURS 4 /********************getSeedI...
C
#include "stdio.h" #include "stdlib.h" #include "math.h" #include "r_mqr.c" /* QRֽĺ*/ /*====================================================== // bmqr // õⲡ̬ // a ϵb xصĽ // n δ֪ // eps Ҫiter // ֵ͡гɹ򷵻ص,ʧ򷵻0 =========================================================*/ int bmqr...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strnstr.c :+: :+: :+: ...
C
/** * @\file global.c * @\author Sorabh Gandhi / Sanju Prakash Kannioth * @\brief This file contains the definition of character to long, character to integer and pseudo random number generation functionality of memory utils * @\date 09/25/2018 * */ /*system headers*/ #include <stdio.h> #include <stdlib.h> #incl...
C
#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> //1 //int main() //{ // int a[5] = { 1, 2, 3, 4, 5 };//׾ͿƵɣʱԼ // int *ptr = (int *)(&a + 1);//&a+1ָ룬ҪǿתΪָ // printf("%d,%d", *(a + 1), *(ptr - 1)); // return 0; //} //2 //ڻûѧϰṹ壬֪ṹĴС20ֽ //ĿͦѵģûŪףԺٿ struct Test { int Num; char *pcName; short sDate; char cha[...
C
#include<stdio.h> #include"Team.h" #include<malloc.h> #include<string.h> #include<stdlib.h> void shuffle(int *array, int n) { srand(time(0)); if (n > 1) { int i; for (i = 0; i < n - 1; i++) { int j = i + rand() / (RAND_MAX / (n - i) + 1); int t = array[j]; array[j] = array[i]; array[i] = t; } ...
C
#include <unistd.h> #include <stdio.h> #include <stdlib.h> void print(const char *text) { int i; for (i=0;i<20;i++){ printf("hello from %s\n",text); usleep(1000000); } } int main() { //create child pid_t pid =fork(); if ( pid == 0){ //we are in child ...
C
/************************************************************************* > File Name: test6.c > Author: zhongwenjie > Mail: zwj5582@gmail.com > Created Time: Thu 11 Aug 2016 10:38:32 PM PDT ************************************************************************/ #include<stdio.h> #include<stdlib.h> #include<i...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* check_ifdir.c :+: :+: :+: ...
C
#include <stdio.h> #include <math.h> struct point_float { float x1; float x2; }; struct point_double { double x1; double x2; }; struct point_float solve_in_floats(float delta_float) { struct point_float answer_float; answer_float.x2 = (2.0001f + delta_float - 2.0f) / 0.0001f; answer_floa...
C
#include <stdio.h> /* printf */ #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <libocean.h> void os_store(void *chunk, unsigned short int size) { char *hash; unsigned short int fd, len; hash = os_sha1(chunk, size); fd = open(hash, O_WRONLY|O_CREA...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putstr_fp.c :+: :+: :+: ...
C
#include <stdio.h> #define MAXN 100000000 FILE *fin,*fout; int sum[100][100]; int main(void) { fin=fopen("input.txt","r"); fout=fopen("output.txt","w"); int n,m,i,j,k,a,ans,min,f; fscanf(fin,"%d,%d,",&n,&m); for(i=1;i<=n;i++) for(j=1;j<=m;j++) { fscanf(fin,"%d,",&a); sum[i][j]=sum[i-1][j]+sum[i][j-1]-su...
C
// Created by Nicolas Emery on 11/14/14. // COP 3223 - 0002 // Assignment 4 - (Assign4.c) // Copyright (c) 2014 Nicolas Emery. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> #define BUFFER_SIZE 70 #define TRUE 1 #define FALSE ...
C
#include <stdio.h> int main() { double f = 16; // please square root f's value printf("sqrt of f is %.0f", sqrt(f)); return 0; }