language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /** Validation functions
*
* Validation functions validate a null-terminated string or the start of one,
* and they all have similar signatures and work in the same way.
*
* The functions are passed a pointer `cur` (in)to a string to validate by
* reference. They are also passed a pointer to a pointer `next` to o... |
C | #include <stdlib.h>
#include <sys/unistd.h>
#include <stdio.h>
int main(int argc, char * argv[]) {
int fd;
char template[] = "/tmp/somestringXXXXXX";
fd = mktemp(template);
if (fd == -1) {
printf("error to open file!");
exit(1);
}
printf("open file is: %s\n", template);
unlink(template);
if ... |
C | /*
* File: pageframe.c
* *****************************************************************************
* Copyright 2020-2021 Scott Maday
* Check the LICENSE file that came with this program for licensing terms
*/
#include "bootloader.h"
#include "bitmap.h"
#include "x86_64/atomic.h"
#include "memory.h"
#include ... |
C | #include <stdio.h>
void sort2 (int *n1, int *n2) {
if (*n1 > *n2) {
int tmp = *n1;
*n1 = *n2;
*n2 = tmp;
}
}
int main () {
int x, y;
printf("x = "); scanf("%d", &x);
printf("y = "); scanf("%d", &y);
printf("x = %d, y = %d\n||\n|| swapping... \n\\/\n", x, y);
sort2(&x, &y);
printf("x = %d,... |
C | void sr(char** b, int r, int c, int x, int y)
{
if (b[x][y] == 'O')
{
b[x][y] = 'o';
if (x)
sr(b, r, c, x - 1, y);
if (x != r - 1)
sr(b, r, c, x + 1, y);
if (y)
sr(b, r, c, x, y - 1);
if (y != c - 1)
sr(b, r, c, x, y + 1... |
C | #ifndef __SLINKLIST_
#define __SLINKLIST_
#include "dsheader.h"
/*
* Static Linked List
* Use a header
* */
#define MAXSIZE 12 //only for test
typedef char ElemType;
typedef int Position;
typedef struct
{
ElemType data;
Position cur;
}component, SLinkList[MAXSIZE];
void InitList_SL(SLinkList space);
void C... |
C | #include <stdlib.h>
#include <string.h>
#include "Pract6_aan.h"
int prueba_predeterminada(float *e){
char *imagenes[]={"clara1.bmp","oscura1.bmp","oscura2.bmp","oscura3.bmp",
"pla1.bmp","porto7.bmp","pp1.bmp","roja1.bmp","roja2.bmp"};
int i;
printf("\n\n\nPruebas Predeterminadas:\n\n");
for (... |
C | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
long long factorial(long long n)
{
long long r = 1;
for(long long i = 1; i <= n; i++)
{
printf("r: %lld i = %lld\n", r, i);
r = r * i;
}
return r;
}
int main(int argc, char **argv)
{
long long cnt = 0; long long thing1... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
//OR IS USED WHEN WE NEED ONLY ONE CONDITION OUT OF ALL
char word;
printf("which is best place to live, inside earth or outside of earth? (i/o)\n");
scanf(" %c", &word);
if((word=='i')||(word=='o'))
{
printf("wow you are a genius!!"... |
C | /*
Non-Volatile Memory (NVM) is a reprogrammable Flash memory that retains program and data storage
even with power off. The NVM Controller (NVMCTRL) connects to the AHB and APB bus interfaces for system
access to the NVM block. The AHB interface is used for reads and writes to the NVM block, while the APB
inte... |
C | #include <stdio.h>
#include <stdlib.h>
#include "epblas/epblas.h"
#define N 10000
Vector_t v2N = NULL;
Vector_t v1N_1 = NULL;
Vector_t v1N_2 = NULL;
float one=1.;
void testAppendOneByOne(){
newInitializedCPUVector(&v1N_1, "vector 100-1", N, matrixInitFixed, &one, NULL);
for(size_t i = 0; i < N; ++i)
... |
C | extern int printValueOfPin(int valueOfPin, int crcCalc) {
if (valueOfPin >= 10) {
Serial.print("A");
crcCalc += 65;
valueOfPin -= 10;
int thousands = valueOfPin / 1000;
valueOfPin %= 1000;
int hundreds = valueOfPin / 100;
valueOfPin %= 100;
int tens = valueOfPin / 10;
valueOfPi... |
C | #ifndef WVMCC_STACK_DEF
#define WVMCC_STACK_DEF
#include <stdlib.h>
typedef struct StackNode_ {
void* data;
struct StackNode_* next;
} StackNode;
typedef struct {
StackNode* head;
unsigned int size;
} Stack;
Stack* stackNew();
void stackPush(Stack* thisStack, void* data);
// If success return 0, or return -... |
C | //Lukasavicus 1132
#include <stdio.h>
main(){
int n1, n2, i, sum = 0;
scanf ("%d %d", &n1, &n2);
int aux;
if(n2 < n1){
aux = n1;
n1 = n2;
n2 = aux;
}
for(i = n1; i <= n2; i++){
//printf("%d ", i );
if(i % 13 != 0)
sum+= i;
}
printf("%d\n", sum);
} |
C | #include <config.h>
#include <stdlib.h>
#include <string.h>
#include "backend.h"
#include "sdl.h"
backend_t *create_backend (void) {
/* allocate memory for the instance and zero it */
backend_t *backend = (backend_t *) malloc (sizeof (backend_t));
memset (backend, 0, sizeof (backend_t));
/* initiali... |
C | #include <stdio.h>
int main() {
int distance = 100;
float power = 2.345f;
double super_power = 56789.4532;
char initial = 'L';
char first_name[] = "Sergei"; //here we go string
char last_name[] = "Miroshnikov";
printf("You are %d miles away .\n", distance);
printf("You have %f levels o... |
C | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "fileUtils.h" // for my written functions
/***********************************************************************
@author Brendon Murthum
@version Fall 2017
This program reads a text file and then outputs
anouther text file with all of the text re... |
C | #include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <err.h>
typedef struct cs_item_s {
char data;
int depth;
struct cs_item_s *child;
struct cs_item_s *sibling;
} CSItem;
CSItem * csitem_new (char data)
{
CSItem * it = calloc (1, sizeof (*it));
if (NULL == it)
err (EXIT_FAILURE, "csit... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct Node Node;
struct Node
{
int page;
Node *next;
};
Node *head = NULL;
Node *last = NULL;
int hits = 0;
int faluts = 0;
int size;
int read = 0;
int write = 0;
int access = 0;
void hit(int page)
{
int isExist = 0;
Node *cur = head;
... |
C | /* Copyright (c) 2020 SoulHarsh007 (Harsh Peshwani)
* Contact: maintainter@theniabot.ml or harshtheking@hotmail.com
* GitHub: https://github.com/SoulHarsh007/
*/
#include <stdio.h>
#include <string.h>
int main() {
char str[50];
printf("Enter the string: ");
fgets(str, 50, stdin);
for (int i = 0; i <= (strl... |
C | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <mpi.h>
int main(void)
{
int i, num, temp, *arr, *input;
int psum = 0;
MPI_Comm comm;
int comm_sz, my_rank;
comm = MPI_COMM_WORLD;
MPI_Init(NULL, NULL);
MPI_Comm_rank(comm, &my_rank);
MPI_Comm_size(comm, &comm_sz);... |
C | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
struct entry_node {
struct entry_node *next;
char entry_name[256];
};
int main(int argc, char **argv) {
c... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mmalloc.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
/*
* Problem 12. Randomize the Numbers 1...N
*
* Write a program that enters an integer n and prints the numbers
* 1, 2, ..., n in random order.
*/
int main() {
int i;
int n;
int index;
int tempElement;
printf("Input n = ");
scanf("%d", &n);
... |
C | /*
** main.c for my_ls in /home/boulat_m/rendu/my_ls
**
** Made by Mickael BOULAT
** Login <boulat_m@epitech.net>
**
** Started on Tue Oct 28 10:06:14 2014 Mickael BOULAT
** Last update Sun Nov 2 21:41:51 2014 Mickael BOULAT
*/
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
#include "list.h"
#inc... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* maxSW.c :+: :+: :+: ... |
C | int access(char* pathname, char mode) // mode ='r', 'w', 'x'
{
int ino;
MINODE* mip;
// if running is SUPERuser process : return OK;
if (running->uid == 0)
return 1;
// get INODE of pathname into memory;
ino = getino(pathname);
mip = iget(dev, ino);
// if owner : return OK if rwx --- --- mode bit is o... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <omp.h>
const long long num_steps = 1000000000;
double step;
int main(int argc, char* argv[])
{
printf ("Nazwa programu: %s\n", __FILE__);
if (argc>1){
omp_set_num_threads(atoi(argv[1]));
printf("Zadana liczba wątków: %s\n", a... |
C | #include<stdio.h>
void translate(int translate_time)
{
int copy = translate_time;
int day = 0;
int hour = 0;
int minute = 0;
int second = 0;
day = copy / 86400; //day
hour = (copy % 86400)/3600; // hour .
minute = ((copy % 86400) % 3600) / 60;
second = ((copy % 86400) % 3600) % 60;
printf("Է¹ %dʴ %d %dð... |
C | /*Alunos: Ccero Cavalcante de Arajo
Murilo Lima de Holanda */
// FILA DINMICA
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int c=0; //Varivel que indica se a fila j foi criada ou no
typedef int TipoT; //Definindo o tipo de contedo da fila dinmica
typedef struct cel //Def... |
C | #include <stdio.h>
int main(){
//ask your age
int age;
printf("What is your age? ");
scanf("%d", &age);
//compute allowed to date girls age
int girlAge = age/2+7;
printf("\nYou are allowed to date %d year old girls or older\n\n", girlAge);
//randomly compute the remainder
printf("The float result ... |
C | void mostrarArray(int array[], int tam)
{
int i;
for(i=0; i<tam;i++)
{
printf("%d\n",&array[i]);
}
}
void cargarArray(int array[], int tam)
{
int i;
for (i= 0; i <tam;i++)
{
printf("INGRESE UN NUMERO: ");
scanf("%d",array[i]);
}
}
int buscarValo... |
C | /*
Nama file : list_double.h
Dibuat oleh : Ali Qornan Jaisyurrahman
Tanggal : 22 januari 2018 18:42 WIB
Fungsi :
Lisensi : https://github.com/qornanali/PendopoTonyAgung-OpenGL-C/blob/master/LICENSE
*/
#ifndef __LISTDouble_H__
#define __LISTDouble_H__
typedef struct Double * P_Double;
typedef struct Double{
char ... |
C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if 0
typedef int bool;
#define true 1;
#define false 0;
typedef struct {
int *arr;
int size;
int capacity;
int head;
int rear;
} MyCircularQueue;
/** Initialize your data structure here. Set the size of the queue to be k... |
C | #include "stdlib.h"
#include "stdio.h"
// Creates space for a 9x9 sudoku board
unsigned int** CreateBoard() {
unsigned int** board = (unsigned int**)malloc(sizeof(unsigned int*) * 9);
unsigned int i;
for (i = 0; i < 9; i++)
board[i] = (unsigned int*)malloc(sizeof(unsigned int) * 9);
return... |
C | #include <stdio.h>
int
main() {
int n = 13;
int cnt=0;
for (cnt=0; n; cnt++)
n &= n-1;
printf("%d\n", cnt);
}
|
C | #include<stdio.h>
int main(){
int day = 1;
while(day > 0){
printf("请输入天数:");
scanf("%d",&day);
printf("%d days are %d weeks,%d days\n",day,day/7,day%7);
}
return 0;
}
|
C | #include <stdio.h>
#include <math.h>
int main(int argc, char **argv)
{
double a,b,c,average,stddev;
printf("enter three numbers \n");
scanf("%lf %lf %lf",&a,&b,&c);
average=(a+b+c)/3;
stddev=(pow((a-average),2)+pow((b-average),2)+pow((c-average),2)/(2));
stddev=(pow(stddev,0.5));
printf("\n This is your averag... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* draw.c :+: :+: :+: ... |
C | #include "MyDriver.h"
/*++
ʵ麯17ļIJѯļ
--*/
/*++
ȡļ
ȡļԣȡļСȡļָ
λáȡļȡԣֻԡԣ
ȡļڵȡDDKṩں˺ZwSetInformationFile
ZwQueryInformationлȡļԡ
NTSTATUS ZwSetInformationFile (
IN HANDLE FileHandle,
OUT PIO_STATUS_BLOCK IoStatusBlock,
IN PVOID FileInformation,
IN ULONG Length,
IN FILE_INFORMATION_CLASS FileInformationClass
)... |
C | #include <stdio.h>
#include <stdlib.h>
void ex ()
{
float I;
while(I != 999){
printf("digite a sua ideade\n");
scanf("%f", &I);
if(I<16){
printf("nao eleitor\n");}
else if(I>=18 && I<65){
printf("eleitor obrigatorio\n");}
else {
printf... |
C | #include<stdio.h>
#include<string.h>
#include <stddef.h>
long long numA[200];
long long numB[200];
long long labA[200];
long long labB[200];
void *new_memcpy(void *destination, const void *source, size_t num);
long long max(long long a, long long b)
{
int first_iteration;
if (a > b)
return a;
return b;
}
... |
C | #include<stdio.h>
#define TRUE 1
#define FALSE 0
#define SIZE 10
void main()
{
static int lista[SIZE];
int i;
int *p, *p2;
for(p = &lista[0]; p < lista + SIZE; p++)
{
printf("Número: ");
scanf("%i", p);
}
for (p = &lista[0]; p < lista + SIZE - 1; p++)
{
for (p2 = &lista[0]; p2 < lista +... |
C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
// #include <sndfile.h> /* libsndfile */
#include "wav_reverb.h"
#include "convolve.h" /* FFT-based convolution */
#define MODE 2
void process_audio(Buf *ibuf, int iframes, int channels, Buf *rbuf, int rframes, Buf *obuf)
{
#if (MODE == 1)
/* just copy input t... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int *p;
int a = 10;
p = &a;
printf("%p\n", p); // 0x7ffff1c233f4
p++; // incrementa...
printf("%d %d\n", a, *p); // 10 sabe-se-la-o-que
printf("%p\n", p); // 0x7ffff1c233f8
return 0;
} |
C | /**
* syscall.c
*
* This file holds the implementations of the files declared in syscall.h.
*/
#include "pcb.h"
#include "../fsys/fs.h"
#include "../bootinit/paging.h"
#include "../keyboard.h"
#include "../rtc.h"
#include "../x86_desc.h"
#include "syscall.h"
#include "../terminal.h"
#define EIGHT_MB 0x00800000... |
C | #include <stdio.h>
#include <stdlib.h>
struct std
{
char name[100];
int roll;
float sub1,sub2,sub3;
};
int main()
{
int i;float sum,avg=0.0;
struct std s[50];
for(i=0;i<2;i++)
{
printf("Enter No %d Student Name\n",i);
scanf("%s",s[i].name);
printf("Ent... |
C | #define _GNU_SOURCE
#include<stdio.h>
#include<stdlib.h>
#include<dirent.h>
#include<sys/stat.h>
void my_readdir(char *pathname) {
DIR *pdir;
struct dirent *dent;
struct stat st;
char *tmpstr;
fprintf(stdout, "Directory : %s\n", pathname);
pdir = opendir(pathname);
while((dent = readdir(pdir)) != NULL) {
i... |
C | #ifndef _F_TYPE_
#define _F_TYPE_
#include "err.h"
#include "f_ast.h"
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
typedef enum type_primitive
{
TYPE_NONE,
/* character types */
TYPE_SCHAR,
TYPE_UCHAR,
TYPE_CHAR,
/* integer types */
TYPE_SHORT_SINT,
TYPE_SHORT_UINT,
... |
C | #include "holberton.h"
/**
*array_range - creates an array of integers.
*@min: minimum value.
*@max: maximum value.
*Return: pointer to array, NULL otherwise.
*/
int *array_range(int min, int max)
{
int i, size;
int *point;
if (min > max)
{
return (NULL);
}
size = max - min + 1;
point = malloc(sizeof(int... |
C | #include <stdio.h>
int main() {
float cp,sp,profit;
printf("Enter cost price: ");
scanf("%f",&cp);
printf("Enter selling price: ");
scanf("%f",&sp);
profit=sp-cp;
if (profit>=0)
printf("There was a profit of %0.2f",profit);
else
printf("There was a loss of %0.2f",-profit);
} |
C | /*
Glidix Shell Utilities
Copyright (c) 2014-2017, Madd Games.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
l... |
C | // Write a program that calls `fork()`. Before calling `fork()`, have the main process access a variable
// (e.g., x) and set its value to something (e.g., 100). What value is the variable in the child process?
// What happens to the variable when both the child and parent change the value of x?
/*
> What value is the... |
C | #include<stdio.h>
#include<string.h>
int main()
{
int n,m,ans=0;
scanf("%d%d",&n,&m);
int f[n],i,a,b,c;
memset(f,0,sizeof(f));
for(i=0;i<m;i++)
{
scanf("%d%d%d",&a,&b,&c);
f[a-1]+=(-1*c);
f[b-1]+=c;
}
for(i=0;i<n;i++)
{
if(f[i]>0)
ans+=f[i];
}
printf("%d\n",ans);
return 0;
}
|
C | /*e are pushing the operands or the numbers into the stack here.
In infix to postfix conversion we pushed the operators into the stack.
So here data type of stk will be int whereas in the previous case it was char
When an operator is encountered pop 2 numbers,find their result using the operator and push the
result... |
C | #include <stdio.h>
#include "PNMwriterCPP.h"
using namespace std;
void
PNMwriter::Write(char *filename){
ofstream outfile (filename);
outfile << imagein1->GetMagicNum() << endl;
outfile << imagein1->GetWidth() << ' ' << imagein1->GetHeight() << endl;
outfile << imagein1->GetMaxVal() << endl;
int size = imagein1->G... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#ifdef _OPENMP
#include <omp.h>
#endif // _OPENMP
#ifndef VAL_N
#define VAL_N 20
#endif
int main()
{
// Problem variables
int n = VAL_N , i , k = 2 , me = 0;
double a[n];
// Initializing a array
for(i=... |
C | #include<unistd.h>
#include<stdio.h>
#include "funcs.h"
int main(void)
{
//Test 1.2+2.3 == 3.5
printf("%f\n", adder(1.2,2.3));
//Test 5.3-2.1 == 3.2
printf("%f\n", minus(5.3,2.1));
return 0;
} |
C | /** @file R_z.c
* @brief Rotation about z axis utilities code driver.
*
* This driver contains the code for the rotation about z axis.
*
* @author Miguel Alonso Angulo.
* @bug No know bugs.
*/
#include "../includes/m_utils.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double... |
C | #include<stdio.h>
#include<stdlib.h>
long ctoi(char *c) {
return (*c - '0');
}
long productof(char *p, int n) {
long product = 1;
for (int i=0; i<n; i++) {
product *= ctoi(p);
p--;
}
return product;
}
int main(int argc, char **argv) {
if (argc < 2) {
fprintf(stderr, "M... |
C | #include "stdio.h"
#include "ft_printf.h"
va_list ap;
long long int numberLength(long long int a)
{
long long int i = 10;
long long int len = 0;
if ((unsigned long long)a == -9223372036854775808ULL)
{
return 20;
}
if (a < 0)
{
a *= -1;
len++;
}
while (a / i > 0)
{
len++;
i ... |
C | /*
============================================================================
Name : Test_Const.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <stdio.... |
C | /*Faa um algoritmo que leia um vetor U[15].
Crie, a seguir, um vetor Primo[15] que conter todos os valores primos do vetor U. Mostre o vetor Primo[15] no final.*/
#include<stdio.h>
int main(){
int u[15], primo[15], i, y, div, pos = 0;
for(i=0;i<5;i++){
//Armazena os valores no vetor u.
printf("... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
{
char titulo[50];
char genero[50];
int duracion;
char descripcion[2000];
int puntaje;
char linkImagen[500];
int estado;
} eMovie;
/** \brief Crea un puntero a estructura.
*
* \return Puntero a eMo... |
C | /*
============================================================================
Name : CS533_Client.c
Author : Karthik Uthaman
Version : 1.0
Copyright : Published under GNU License.
Description : This is the main entry point for the client. It takes user input
and starts the requested client ... |
C | #include <stdio.h>
void tree ();
int bound = 100000000;
int arry[100000000];
int main () {
tree();
}
void tree () {
int i;
arry[0] = 1;
for (i=0; i < bound; i++){
if (2*i+1 < 100000000){
arry[2*i+1] = arry[i];
}
if (2*i+2 < 100000000){
arry[2*i+2] = arry[i] + arry[i+1];
}
if ... |
C | #include "AppController.h"
#include "AppIO.h"
#include "Ban.h"
#define MAX_NUMBER_OF_STUDENTS 100
struct AppController{
Ban* _ban;
};
AppController* AppController_new(void) { //AppConter ü
AppController* _this = NewObject(AppController);
_this->_ban = Ban_newWithCapacity(MAX_NUMBER_OF_STUDENTS);
return _this;
}
vo... |
C | /******************************************************* INCLUDES *******************************************************/
#include "stats.h"
/******************************************************* VARIABES & TYPES ********************************************/
int emailAlertCallCount = 0;
int ledAlertCallCount = 0;
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_unsigned_nb.c :+: :+: :+: ... |
C | /*
** my_strdup.c for emacs in /home/jules.spender/CPool_Day08/task01
**
** Made by Jules Spender
** Login <jules.spender@epitech.net>
**
** Started on Wed Oct 12 08:36:44 2016 Jules Spender
** Last update Wed Mar 15 17:59:31 2017 Jules Spender
*/
#include <stdlib.h>
char *my_strdup(char *src)
{
int a;
char ... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define REP(i, n) for (int (i) = 0; (i) < (n); ++(i))
#define INF 0x3f3f3f3f
#define MAXN (15)
char input[MAXN];
int get_num() {
int a = 0;
int flg = 0;
char *pch = strtok(input, ",");
while (pch) {
a *= 1000;
a += atoi(pch);
... |
C | /* ASSUMPTION - INPUT SIZE GREATER THAN 2 - answer becomes after n=92*/
#include<stdio.h>
#include<omp.h>
#include<stdlib.h>
void printFib(long long int *arr,long long int size){
long int i;
for(i=0;i<size;i++)
printf("%lld ",arr[i]);
printf("\n");
}
long long int *getFib(long long int n){
long long int *arr=(... |
C | #include <stdio.h>
int main(void)
{
int n=0;
printf("정수 입력: ");
scanf("%d", &n);
switch(n/10)
{
case 0:
printf("0이상 10미만");
break;
case 1:
printf("10이상 20미만");
break;
case 2:
printf("20이상 30미만");
... |
C | #include "patterns.h"
#include "color_pattern.h"
#define DEFAULT_BACKGROUND CACA_TRANSPARENT
color_pattern green_pattern[] = {
{ .ch='W' , .fcolor=CACA_WHITE, .bcolor=DEFAULT_BACKGROUND },
{ .ch='G' , .fcolor=CACA_LIGHTGREEN, .bcolor=DEFAULT_BACKGROUND },
{ .ch='D' , .fcolor=CACA_GREEN, .bcolor=DEFAULT_BA... |
C | #include "index.h"
#include "queue.h"
#include "stack.h"
#include "ConnectedComponents.h"
#include "SCC.h"
typedef struct graph {
Buffer *buffer_inc; //buffer for incoming edges
NodeIndex *index_inc; //index for incoming edges
Buffer *buffer_out; /... |
C | #include "boolean.h"
#include "mesinkataload.h"
#include "mesinkarload.h"
#include <stdio.h>
LKata CKata;
boolean EndKata;
boolean EndData;
void IgnoreBlank()
{
/* Mengabaikan BLANK dan newline */
while((CC == BLANK || CC == '\n') && CC != MARK) ADV();
}
void STARTKATA()
{
/* Inisialisasi mesin kata dan salin kat... |
C | #include <stdio.h>//ATM simulator using C program
int ATM_Transaction();//Prototype of the functions
int anotherTransaction,amountToWidthdraw,amountToDeposit,pin;//Global variable
double balance = 1000; // Global variable, Initial balance to be 1000 for everyone
int main()
{
printf("******** Welcome to El Banco ... |
C | #include <stdio.h>
#define SIZE 30
int upper_to_lower(char arr[]);
int main(){
char ip_arr[SIZE];
printf("Please enter array: ");
scanf("%s", &ip_arr);
upper_to_lower(ip_arr);
return 0;
}
int upper_to_lower(char arr[]){
int i=0, x;
x = 'a' - 'A';
while (arr[i] != 0){
if ((arr[i]>='A') &(arr[i]<='Z'... |
C | /*
Nombre: Juan Carlos Ruiz García
Grupo: C2
Año: 2016
NOTA: Compilar con la opcion -w para evitar todos los incomodos warnings
gcc -w ejer4.c -o ejer4
*/
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#incl... |
C | #ifndef TREE_H
#define TREE_H
// Structures
struct s_node;
struct s_list_of_nodes;
// typedefying
typedef struct s_node* tree;
typedef struct s_list_of_nodes* list;
// Structure of the doubly linked list of nodes
struct s_list_of_nodes
{
tree node;
list next;
list prev;
};
// Structure of the node, link... |
C | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define MAXN 100
int n;
double x[MAXN], y[MAXN];
double e[MAXN * MAXN];
int i, j, k;
int mark[MAXN * MAXN];
int plan[MAXN];
int vis[MAXN];
double bestLen;
int bestPlan[MAXN];
int totCut;
int compare(const void* a, const void* b) {
retur... |
C | #define NMAX 10 //macro per pile
/*Questa libreria contiene gli abstact data type visti a lezione.
Le definizioni sono commentate poiché si ripetono nella gandolib.h*/
/////////////////////////////////////////////////////////////
/* LISTE */
//////////////////////////... |
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 <time.h>
#include <stdlib.h>
#include "array_print.h"
#include "move_array.h"
#include "init_array.h"
void random_create_2(int array_2048[4][4]) {
int count = 0, r1, l1, r2 = -1, l2 = -1;
srand(time(0));
while (1) {
r1 = rand() % 4;
l1 = rand() % 4;
if (2 == count)... |
C | #include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "bitmap.h"
#include "util.h"
bitmap_t *bitmap_new(int width, int height)
{
size_t bytes = sizeof(bitmap_t) + DIV_ROUND_UP(width, 8) * height;
bitmap_t *bitmap = calloc(1, bytes);
assert(bitmap != ... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv){
FILE *file;
file = fopen(argv[1], "r");
char arr[100][50];
int i = 0;
while (1){
char r = (char)fgetc(file);
int k = 0;
while(!feof(file)){
arr[i][k++] = r;
r = (char)fgetc(file)
}
arr[i][k]=0;
if(feof(file))... |
C | #ifndef COMMON_H
#define COMMON_H
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdio.h>
#include <limits.h>
#define NUMBER_OF_CHAR 256
#define SEPARATOR -2
#define EMPTY_CHAR -3
//The buffer size is the amount of characters that will be held in memory.
#define BUFFER_SIZE... |
C | /*Filename: Saddle.c
Author: Jithu Sunny
Blog: http://jithusunnyk.blogspot.com/
Date: 06-03-11
Description: This program finds out the saddle points and their positions in a matrix of any order.*/
/*Change these macros to change the order*/
#define ROWS 3
#define COLUMNS 3
#include <stdio.h>
struct saddle
{
int num... |
C | // ads1115 example wiringPi
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdbool.h>
#include <wiringPi.h>
#include <wiringPiI2C.h>
#include <ads1115.h>
#define PINBASE 120 // choose PINBASE value arbitrarily
#define ADS_ADDR 0x48
int ma... |
C | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct node
{
int info;
struct node *link;
};
struct node *newnode,*top,*ptr;
void push();
int pop();
void disple();
FILE *fp;
int main()
{
top=NULL;
int i,n;
char ch;
fp=fopen("input.txt","r");
if(fp==NULL)
printf("file does not exit:\n");
fscanf(fp,"%d",&n);... |
C | /*************************************************************************
> File Name: union.c
> Author: huang yang
> Mail: huangyangwork@sina.com
> Created Time: 2016年12月02日 星期五 11时11分01秒
************************************************************************/
#include<stdio.h>
typedef union
{
c... |
C | //write a program to find out area of two different circle and findout and print smallest circle (in terms of area)
#include<stdio.h>
#include<conio.h>
void main()
{
int radius1,radius2;
float area1,area2;
printf("Enter first circle radius");
scanf("%d",&radius1);
printf("Enter second circle radius"... |
C | #pragma once
#include <float.h>
/*****************************************************************************/
/* */
/* - Splitter : (DBL_MANT_DIG + 1) >> 1 right bit shift by 1bit */
/* i.e. the number (54) is divided by 2... |
C | #include <stdio.h>
#include <cs50.h>
int validate_input(int input)
{
if(input<0 || input>23){
return false;
}
else{
return true;
}
}
int pyramid(int input)
{
int height = input-1;
for(int i = -1; i<height; i++){
printf("%.*s", height-(i+1), " ");... |
C | #include <stdio.h>
void fun(int a, int b, long *c)
{
/**********Program**********/
*c=1000*(b%10)+100*(a%10)+10*(b/10)+(a/10);
/********** End **********/
}
void main()
{
int a,b; long c;
printf("Input a, b:");
scanf("%d %d", &a, &b);
fun(a, b, &c);
printf("The result is: %ld\n", c);
}
|
C | #include "holberton.h"
/**
* _strcpy - Copies string pointed to by src, including terminating null byte
* @dest: A buffer to copy the string to.
* @src: The source string to copy.
*
* Return: A pointer to the destination string @dest.
*/
char *_strcpy(char *dest, char *src)
{
int i = 0;
while (src[i] != '\0'... |
C | //
// Created by new on 9/1/19.
//
#include "../include/DATABASE_message.h"
void freeMsgList(MessageList messageList) {
for (int i = 0; i < messageList.msgNum; i++) {
free((messageList.msgs + i)->msgContent);
(messageList.msgs + i)->msgContent = NULL;
free((messageList.msgs + i)->msgDateTim... |
C | /***************************************************************************************************
*FileName:
*Description:
*Author:xsx
*Data:
***************************************************************************************************/
/***********************************************************************... |
C | #include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include <math.h>
#include "f.h"
void main(int argc, char** argv)
{
int rank, size;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
double t1,t2;
int n = 1000, m, i_start, i_end;... |
C | #include <stdio.h>
#include <stdlib.h>
#include "nn_data_io.h"
#ifdef __MSDOS__
#include "dos_fileio.h"
#endif
typedef unsigned char uchar;
int read_mnist_bmp(const char *file_path, uchar **img, IMG_INFO **img_info){
FILE * fp = NULL;
BITMAPFILEHEADER pFH;
BITMAPINFOHEADER pIH;
*img_info =(IMG_INFO*)malloc(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.