language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | //prog to find sum of 5 digit numbers
#include <stdio.h>
int rsum(int n);
int main ()
{
long m;
printf("type a five digit number ");
scanf("%li ", &m);
int p=rsum(m);
printf("%d", p);
return 0;
}
int rsum(int n)
{
int s, remainder;
if (n!=0)
{
remainder= n%10;
s= r... |
C | /*****************************************************************************
Copyright: 2020, Mud.Ren
File name: look.c
Description: 游戏基本的look指令
Author: xuefeng
Version: v1.0
*****************************************************************************/
#include <ansi.h>
inherit CORE_CLEAN_UP;
int look_room(object m... |
C | #include <stdio.h>
#include <limits.h>
#include <stdlib.h>
struct process{
int arrivalTime;
int burstTime;
int numberOfProcess;
int completionTime;
int waitingTime;
int turnAroundTime;
};
// A structure to represent a queue
struct Queue {
int front, rear, size;
unsigned capacity;
in... |
C | #include<stdio.h>
#include<string.h>
void main(){
float d=0;
int a,b,c,i;
while(scanf("%d:%d",&a,&b) !=EOF){
if(a>7){
printf("Atraso maximo: %d\n",(a+1-8)*60+b);
}
if(a<7 || a==7 && b==0){
printf("Atraso maximo: 0\n");
}
if(a==7 && b>0){
printf("Atraso maximo: %d\n",b);
}
}
... |
C |
#include "vsfs.h"
int createDisk()
{
FILE* ptr_to_file = fopen(DISK_NAME, "w");
if(ptr_to_file == NULL)
return DISK_OPEN_ERROR;
char char_buffer[] = { 0x00u };
short short_buffer[5];
for(int i = 0; i < BLOCK_SIZE * BLOCKS_AMOUNT; i++)
fwrite(char_buffer, sizeof(char), 1, ptr_to_... |
C |
#include "memory.h"
#include "main.h"
#include <stdlib.h>
#include <stdio.h>
#define MEMORY_ATARI_FILE_SIGNATURE 0xffff
#define MEMORY_ATARI_FILE_NB_SHOWED 8
byte memory[MEMORY_SIZE];
bool memBreaks[MEMORY_SIZE];
byte memType[MEMORY_SIZE];
void (*memOutputs[MEMORY_SIZE])(byte value);
byte (*memInputs[MEMORY_SIZE])(v... |
C | #include <stdio.h>
int Sum_Of_Digit(int);
int Reverse_Digit(int);
void main()
{
int no, ans, reverse;
printf("Enter The Number:");
scanf("%d", &no);
ans = Sum_Of_Digit(no);
reverse = Reverse_Digit(no);
printf("Sum Of Digit Is: %d\n", ans);
printf("Reverse No Is: %d", reverse);
}
int Sum_Of_... |
C | /* Kilobot Edge following demo
*
* Ivica Slavkov, Fredrik Jansson 2015
*/
#include <math.h>
#include <kilombo.h>
#include "edge.h"
#include <kilolib.h>
enum {STOP,LEFT,RIGHT,STRAIGHT};
typedef struct
{
Neighbor_t neighbors[MAXN];
int N_Neighbors;
uint8_t bot_type;
uint8_t bot_state;
uint8_t mov... |
C | /*
* ----------------------------------------------------
* Linear Search (Iterative Version)
* Comparisons
* Worst Case: O(n)
* Best Case: O(1)
* Average Case: O(n)
* ----------------------------------------------------
*/
int linear_search(Data *array, const int size, Data item) {
assert(array);
assert... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsplit.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <string.h>
int main(){
int range;
printf("Enter the length of an array - ");
scanf("%d", &range);
printf("%d", range);
int arr[range];
for (int i = 0; i < range; i++) {
int elem;
printf("enter the element number - %d >", i+1);
scanf("%d", &elem);
arr[i] = elem;... |
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 |
/*****************************************************************************
*作者:evilbinary on 2017-09-17 13:52:31.
*邮箱:rootdebug@163.com
******************************************************************************/
#include "c.h"
// //long a64l(const char* )
// long c_a64l (const char* arg0){
// return a64l(arg... |
C | #include <stdio.h>
#include <string.h>
struct Objet{
char nomObjet[100];
int prix;
char caracteristique[100];
};
typedef struct Objet objet;
objet epee = {"Epee de feu", 100, "Une epee flamboyante"};
objet bouclier = {"Bouclier des Abysses",130, "Un bouclier rapporte des enfers"};
objet potion = {"Potion des hor... |
C | #include<stdio.h>
int main()
{
int array[5][5] =
{
{0,1,2,3,4},
{5,6,7,8,9},
{10,11,12,13,14},
{15,16,17,18,19},
{20,21,22,23,24}
};
int sum = 0, i, j;
int n = 0;
for (i = 4; i > 0; i--,n++)
{
for ( j=0; j<5-n;j++)
{
sum = array[i][j] + sum;
}
}
printf("%d",sum);
return 0;
} |
C | /*
* Copyright(c) 2014,Ͼʢ
* All rights reserved
* ļƣcs99xx_result.c
* ժ Ҫ ϵͳʱ
* ǰ汾V0.0дߣ
* ʷ汾
* ļ¼
*
*/
#include "stm32f10x.h"
#include "keyboard.h"
#include "RTC_Config.h"
#include "app.h"
#include "serve_test.h"
#include "SysTemConfig.h"
/*
* serve_timekey
* ʱģ һ sys_settime
* uint16_t keyv... |
C | #include<stdio.h>
#include<Windows.h>
#include<time.h>
#include<math.h>
//地图长度L,包括迷宫主体40,外侧的包围的墙体2,最外侧包围路径2(之后会解释)
#define L 44
//墙和路径的标识
#define WALL 0
#define ROUTE 1
//控制迷宫的复杂度,数值越大复杂度越低,最小值为0
static int Rank = 0;
//生成迷宫
void CreateMaze(int **maze, int x, int y);
int main(void) {
srand((unsigned)time(NUL... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_padding_nbr.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
void get_primes(int prm[], long long sqr_rt){
int i,j;
int *primes = (int *)malloc(sizeof(int) *1000001);
for(i=0;i<=sqr_rt;i++){
primes[i] = 0;
prm[i] = 0;
}
primes[0] = primes[1] = 1;
for(i=2;i*i<=sqr_rt;i++){
for(j=2*i;j<=sqr_rt;j+=i){
pri... |
C | //C Program Swap Numbers in Cyclic Order
int main() {
int a=2;
int b=4;
int c=6;
int temp;
prints("Enter a, b and c respectively: ");
prints("Value before swapping:\n");
printi(a);
printi(b);
printi(c);
temp=b;
b=a;
a=c;
c=temp;
prints("Value after swapping... |
C | // common_def.h
// Toni Barella
// Jose Maria Martinez
// Algoritmos & Inteligencia Artificial
// ESAT 2017/2018
//Implementation of common utilities of our API like the error codes
#ifndef __COMMON_DEF_H__
#define __COMMON_DEF_H__
#define VERBOSE_
/** Error code enum.
* Enum with the different error co... |
C | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#ifndef SCNu8
#define SCNu8 "hhu"
#endif
struct node {
int val;
struct node *next;
};
struct node* initialize_list(struct node **HEAD, int val)
{
struct node *head = *HEAD;
struct node *ptr = (struct node*) malloc(sizeof(struct node));
ptr->val = val;
... |
C | //Name: Deepkumar Patel, NetID: dgp52
//Name: Viraj Patel, NetID: vjp60
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/file.h>
#include <pthread.h>
//Used for timetest purposes
//#include <time.h>
//Structure for threads
struct tInfo {
//Name of the file ... |
C | #include <stdio.h>
//Calculo Salario
main(){
float ht, vh, pd, sb, td, sl;
printf("Informe o total de horas trabalhadas: ");
scanf("%f", &ht);
printf("Informe o valor da hora trabalhada: ");
scanf("%f", &vh);
printf("Informe o percentual total de descontos: ");
scanf("%f", &pd);
s... |
C | /** CS 2506 fall 2014
* Assignment 3: String Parsing and Translation
* Student: Zhenshu Zhao
* PID: zzhens7
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <limits.h>
#define MAXLEN 400
#defin... |
C | /*
* libifupdown/dict.c
* Purpose: wrapping linked lists to provide a naive dictionary
*
* Copyright (c) 2020 Ariadne Conill <ariadne@dereferenced.org>
* Copyright (c) 2020 Maximilian Wilhelm <max@sdn.clinic>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without ... |
C | #include "libft.h"
#include <stdio.h>
void *ft_memcpy(void *dst, const void *src, size_t n)
{
size_t i;
char *d;
char *s;
d = (char *)dst;
s = (char *)src;
i = 0;
if ((char *)src != (char *)dst)
{
while (i < n)
{
d[i] = s[i];
i++;
}
}
return (dst);
}
/*
#include <stdio.h>
int main ()
{
char str ... |
C | #include <stdio.h>
#include <string.h>
#include "data.h"
#pragma warning(disable:4996)
/* returns zero on success */
int writeString(char *str, int maxsize)
{
int len = 0;
if(fgets(str, maxsize, stdout) == NULL) {
return -1;
}
len = strlen(str);
if(str[len - 1] == '\n') str[len - 1] = '\0';
retur... |
C | /*
** string.c for my_ftp in /home/vencat_a/rendu/PSU/PSU_2015_myftp/src
**
** Made by Axel Vencatareddy
** Login <vencat_a@epitech.net>
**
** Started on Sat May 14 14:09:04 2016 Axel Vencatareddy
** Last update Sat May 14 14:09:05 2016 Axel Vencatareddy
*/
#include "my_string.h"
void my_free_tab(char **tab)
{
... |
C | #include <stdio.h>
/*
TODO:
Write a recursive function that returns the nth fibonacci number
*/
unsigned long long int fib(unsigned int n);
int main(void){
unsigned long long int result;
unsigned int n;
printf("%s", "Enter an integer: ");
scanf("%u", &n);
result = fib(n);
printf... |
C | /* Authors: Xin Li <xli96@csd.uwo.ca>, Marc Moreno Maza <moreno@csd.uwo.ca> */
/* Copyright (c) 2009 by Marc Moreno Maza. All rights reserved */
#include "HashTable.h"
extern int Interrupted;
/**
* list_create:
* @opnd: A node value.
*
* Creat a new node has value of 'opnd'.
* Return value: The ne... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_convert_o.c :+: :+: :+: ... |
C | #include "stdio.h"
#include "stdlib.h"
#include "time.h"
int main(int argc, char const *argv[])
{
int i, outType, numElements, maxValue;
FILE *genFile;
char fileName[100];
if(argc!=1){
return 1;
}
else{
printf("1. Array\n2. Two dimension pair\n");
printf("------------------------------\n");
printf("Ente... |
C | /**
* @file mrna-client.c
* @author Koray Koska <e1528624@student.tuwien.ac.at>
* @date 2018-01-07
*
* @brief Client for OSUE exercise 3 'mrna'.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#inc... |
C | #define F_CPU 16000000L
#include "codes.h"
#include <avr/io.h>
#include <avr/sleep.h>
#include <util/delay.h>
#include <avr/avr_mcu_section.h>
AVR_MCU(F_CPU, "atmega328");
const struct avr_mmcu_vcd_trace_t _mytrace[] _MMCU_ = {
{ AVR_MCU_VCD_SYMBOL("PB5"), .mask = (1 << PB5), .what = (void*)&PORTB, },
};
void m... |
C | /*Copyright (c), 2016, Mahnyov Aleksander. All rights reserved*/
#include <stdlib.h>
#include <string.h>
#include "twinLinkList.h"
#include "twinLinkNode.h"
charList *charListConstructor();
void charListDestructor(charList *listToBeDeleted);
void printCharList(const charList *inputList);
charNode *findMaxNode(const c... |
C | #include <stdio.h>
#include <ctype.h>
int main(void)
{
int size = 0; char ch, message[100] = {'0'};
printf("Enter message: "); scanf("%c", &ch);
while (ch != '\n') {
message[size] = ch; size += 1; scanf("%c", &ch);
}
printf("In B1FF-speak: ");
for (int i = 0; i < size; i++) {
ch = message[i];
... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct POLY{
int power;
int coeff;
struct POLY * next;
}poly;
/* Function to create nodes for the polynomial and link it to create a linked list */
void create_poly_node(poly ** head, int power, int coeff){
poly * new = (poly *) malloc(sizeof(poly));
... |
C | #define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
//
//дж꣨1000-2000
//꣺ܱ4ܱ1000ܱ400
int is_leap_year(int n)
{
if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0))
{
return 1;
}
}
int main()
{
int i = 0;
for (i = 1000; i <= 2000; i++)
{
//귵1귵0
if (is_leap_year(i) == 1)
{
printf("%d ... |
C | #ifndef FUNCIONES_H_INCLUDED
#define FUNCIONES_H_INCLUDED
typedef struct {
char nombre[21];
int edad;
int dni;
int estado;
}ePersona;
/**
* Obtiene el primer indice libre del array.
* @param lista el array se pasa como parametro.
* @param la cantidad de la matriz necesaria para el for.... |
C | /**
Given an array with n objects colored red, white or blue,
sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
Note: Using library sort function is not allow... |
C | #include "head.c"
int celsius_to_farenheit(int C){
int c;
c=((C*9)/5)+32;
printf("%d",c);
return c;
//return ((C*9)/5)+32;
}
int farenheit_to_celsius(int F){
int f;
f=((F-32)*5)/9;
printf("%d",f);
return f;
//return (F-32)*(5/9);
}
|
C | // Программа-пример No2 из главы 20
// Руководства по С для новичков, 3-е издание
// Файл Chapter20ex2.c
/* Эта программа демонстрирует математические функции
из библиотеки файла math.h, таким образом, вы можете
сделать домашнюю работу без единой ошибки благодаря
быстрым и легким программам */
#include <stdio.h>
#inclu... |
C | #define _CRT_SECURE_NO_WARNINGS // scanf
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <windows.h>
//---------------------------------------------------------------------------//
/*
12
61391
..
: 28.10.2018
: ,
: n. , .
_________
| ... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define LINE_LENGTH 13
/* return a formatted table using f(x) for each x in a range */
char *buildTable(int from, int to, int step, double (*f)(int x));
/* return the celsius equivalent to a fahrenheit temperature */
double fahrToC(int fahr);
int main() {
... |
C | // Implementation of the graphics subsystem using the SDL2 library
#include "gfx.h"
#include "utils.h"
#include <SDL2/SDL.h>
SDL_Window *window = NULL;
SDL_Renderer *renderer = NULL;
const unsigned int SCREEN_WIDTH = 800;
const unsigned int SCREEN_HEIGHT = 600;
int gfx_init()
{
if (SDL_Init(SDL_INIT_VIDEO) < 0) {... |
C | #include<stdio.h>
#include<stdlib.h>
void PrintArray(int*a, int n)
{
for (size_t i = 0; i<n; i++)
{
printf("%d ", a[i]);
}
printf("\n");
}
void CountSort(int* a,int n)
{
int max = a[0], min = a[0];
for (int i = 0; i < n; i++)
{
if (a[i]>max)
{
max = a[i];
}
if (a[i] < min)
{
min = a[i];
}
}
... |
C | // BIBLIOTECA SIMPLES PARA UTILIZAÇÃO DO SENSOR PIR DYP-ME003 NA JETSON TK1
#include <stdio.h>
#include <unistd.h>
#include "jetsonGPIO.h"
// [EDITAR]
jetsonGPIO pirsensor = gpio166; // pino utilizado pelo sensor
// define o valor para a calibração do sensor
#define calibracao 45
unsigned int pirvalue = low;
// in... |
C | #include<stdio.h>
#include<conio.h>
int main()
{
printf("Enter the number to perform the corresponding function:\n1 for addition\n2 for subtraction\n3 for multiplication\n4 for division\n");
int choice;
scanf("%d",&choice);
int a,b,c;
printf("\nEnter the numbers:\n");
scanf("%d %d",&a... |
C | /* Enter the numbers from 1 to 16(in any order)
and then displays the numbers in a 4 by 4 arrangement,
followed by the sums of the rows, columns, and diagonals */
#include <stdio.h>
int main(void) {
int n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15;
printf("Enter the numbers fro... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 50
#define maxlenth 200
typedef struct makmap{
int ft[20][200];
int l[20];
}findt;
void print(char s[], char t[])
{
int k,m,i,j;
char listl[] = "abcdefghij";
int a[127]={0};
findt mapl;
int max,max_n,temp;
int d[ma... |
C | #include <stdio.h>
int ft_iterative_factorial(int nb)
{
int i;
i = nb - 1;
while (i > 0)
{
nb *= i;
i--;
}
return (nb);
}
int main(void)
{
printf("%d\n", ft_iterative_factorial(8));
return (0);
}
|
C | #include "binary_trees.h"
/**
* bst_insert - a function that inserts a value in a Binary Search Tree
* @tree : a double pointer to the root node of the BST to insert the value in
* @value: the value to store in the node to be inserted
* Return: a pointer to the created node, or NULL on failure
*/
bst_t *bst_ins... |
C | /** File which contains methods for interacting with Windows Processes
*/
#include <windows.h>
#include <stdbool.h>
#include <stdio.h>
#include "file_strings.h"
FILE * logs;
/**Description: Plays a sound file from the given path
*
*Parameters:
*sound_path - a string which contains the path
* to the so... |
C | #include<stdio.h>
int main(){
int x;
scanf("%d",&x);
printf("%s",(x%2==1)? "odd":"even");
}
|
C | #include <stdio.h>
static char *daytab[] = {
"\0\x1f\x1c\x1f\x1e\x1f\x1e\x1f\x1f\x1e\x1f\x1e\x1f",
"\0\x1f\x1d\x1f\x1e\x1f\x1e\x1f\x1f\x1e\x1f\x1e\x1f"
};
int day_of_year(int year, int month, int day)
{
int i, leap;
leap = (year%4 == 0 && year%100 != 0) || year%400 == 0;
for (i = 1; i < month; i+... |
C | //clear && cc tree.c -o tree -Wall -Werror && ./tree
#include <stdio.h>
struct binary_tree {
int data;
struct binary_tree* left;
struct binary_tree* right;
};
typedef struct binary_tree node;
int main(int argc, char* argv[]){
printf("hello, gushi ...\n");
printf("bye, gushi!\n");
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
typedef enum boolean{False=0, True=1} Boolean;
typedef int Tipo;
typedef struct{
Tipo* vetor;
int tam;
int qtde;
}Pilha;
//PROTÓTIPOS
Pilha* pilha_criar(int tam);
Boolean pilha_push(Pilha* p, Tipo elemento);
Tipo* pilha_pop1(Pilha* p);
Boolean pilha_pop2(Pilha* p, T... |
C | /* xstage3t1c.c - source file for function to calculate
* sample size for three stage study conclude H1.
* Copyright (C) 2002-2003 James L. Kepner, Ph.D.
* james.kepner@roswellpark.org
*
* This file is part of the Sample Size Calculator.
*
* This file is copyright James L. Kepner, Ph.D.
* All rights reserved.
... |
C | /*
* File: main.c
* Author: Nicolle
*
* Created on October 10, 2015, 2:48 PM
*/
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
typedef struct state
{
int lengthOfState;
char* name;
long int population;
long int populationOver18;
} State;
void readStates(State**, char*);
void printStateInfo... |
C | #include<stdio.h>
#include<string.h>
int main()
{
int a = 121;
char t[20];
sprintf(t,"%d",a);
printf("size : %d\n", strlen(t));
printf("%s",t);
return 0;
}
|
C | #ifndef COMMON_H
#define COMMON_H
#include "DataTypes.h"
/** 이차원을 계산을 위해 일차원으로 변환해주는 함수 **/
int two2one(t_square Square);
/** 일차원으로 변환된 값을 다시 이차원으로 변환해주는 함수 **/
/** 일차원 : 함수 내부 계산을 위해, 이차원 : 체스피스의 프린트를 위해 **/
t_square one2two(int oneDindex);
/** 기물 이동 함수, 캐슬링용 로그 변경 함수 **/
void MovePiece(t_board Board, t_move Move,... |
C | /** \brief Verifica si el valor ingresado es numerico o no.
*
* \param Array con la cadena que sera analizada.
* \return 1 si es num y 0 si no lo es .
*/
int isNumeric (char*);
/** \brief Verifica si el valor ingresado contiene solo letras.
*
* \param Array con la cadena que sera analizada.
* \return 1 si conti... |
C | #include <stdlib.h>
#include <stdio.h>
int main(){
char res = 'o';
do{
int a = 0;
int b = 0;
char nb;
printf("Entrez la première valeur :");
scanf("%d", &a);
printf("Entrez la deuxième valeur :");
scanf("%d", &b);
printf("Entrez l'opérateur (+ - * /) :");
scanf(" %c", &nb);
switch(nb){
... |
C | #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Table/Row Specific
#define size_of_attribute(Struct, Attribute) sizeof(((Struct*)0)->Attribute)
const uint32_t COLUMN_USERNAME_SIZE = 32;
const uint32_t COLUMN_EMAIL_SIZE = 255;
typedef struct Row_t {
uint32_t id;
char usernam... |
C | #include <stdio.h>
#include <string.h>
#include <strings.h>
int main(void) {
int n,i,j,k;
printf("Enter the number of names\n");
scanf("%d",&n);
char names[n][20];
printf("Enter names starting with Capital first letter\n");
for(i=0;i<n;i++)
{
scanf("%s",names[i]);
}
for(i=0;i<n;i++)
{
for(... |
C | #include <stdio.h>
int main()
{
float base;
float height;
printf("\nInput value of base : ");
scanf("%f", &base);
printf("Input value of height : ");
scanf("%f", &height);
printf("\nArea of a Triangle is %.2f \n\n", 0.5 * base * height);
return 0;
} |
C | // ------NOTE: MANAGE THE HEAP MEMORY IN OBJECTS.C FOR GENERATING OPJECTS
#include "context.h"
#include "shader.h"
char* vecSrc="../src/defaultVertexShader.glsl";
char* fragSrc="../src/defaultFragShader.glsl";
struct MandelbrotData{
float _x, _y, _scale;
int _maxIterations;
};
int
main(int argc, char **argv){
... |
C | #include "conversion_operation.h"
int main(){
long int binary,octal,hexadecimal,decimal;
int choice = 1,option=6;
srand(time(0));
printf("\n !!Number System Converter!!\n" );
for (int i = 0; i < 1; i++) {
option = (rand() % (6)) +1;//SINCE WE CANNOT USE SCANF() I AM GENERATING RANDOM VALID INPUT TO SHOW T... |
C | #pragma once
typedef int DataType;
typedef struct SeqList
{
DataType *arr;
int size;//ЧԪظ
int Capacity;//
}SeqList,*PSeqList;
void SeqListInit(PSeqList ps);
void SeqListDestroy(PSeqList ps);
void SeqListPushBack(PSeqList ps, DataType data);//β
void SeqListPopBack(PSeqList ps);//βɾ
void PrintSeqList(PSeqList ps);//... |
C | #include "activation.h"
float sigmoid(float X)
{
return 1 / (1 + expf(-X));
}
float relu(float X)
{
if (X < 0) return 0;
else return X / 10.0;
}
float sigmoid_der(float X)
{
return sigmoid(X) * (1.0 - sigmoid(X));
}
float relu_der(float X)
{
if (X < 0) return 0;
else return 1;
}
float tanh_af(float X)
{
ret... |
C | #include <stdlib.h>
#include <stdio.h>
int *mx_copy_int_arr(const int *src, int size) {
if (src == NULL) {
return NULL;
}
else{
int *arr = malloc(sizeof(int)*size);
for (int i = 0; i < size; i++) {
arr[i] = src[i];
}
return arr;}
}
// int main... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pgcd.c :+: :+: :+: ... |
C | #include <stdio.h>
int main()
{
int n,m,i;
while (~scanf("%d%d",&n,&m))
{
for (i=0;i<n/m;i++)
printf(i?" %d":"%d",m+1+2*m*i);
if (n/m!=(double)n/m)
printf(" %d",2*(n/m)*m+(n-n/m*m+1));
puts("");
}
}
|
C |
/*
[11034번]
캥거루 세 마리가 사막에서 놀고 있다. 사막에는 수직선이 하나 있고, 캥거루는 서로 다른 한 좌표 위에 있다.
한 번 움직일 때, 바깥쪽의 두 캥거루 중 한 마리가 다른 두 캥거루 사이의 정수 좌표로 점프한다.
한 좌표 위에 있는 캥거루가 두 마리 이상일 수는 없다.
캥거루는 최대 몇 번 움직일 수 있을까?
*/
#include <stdio.h>
#include <stdlib.h>
int main(void){
int a,b,c,min,mid,max;
while(scanf("%d %d %d",&a,&b,&c) != EOF){... |
C | /*
* getInput.c
*
* Created on: 21 sep. 2019
* Author: femavana
*/
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include "getInput.h"
int getFloat(float *input,
char* message,
char* msgError,
int minSize,
int maxSize,
int retries)
{
int ret = -1;... |
C | #include <stdio.h>
int main()
{
int i=1;
double s=0;
while(1)
{
s+=1/i;
if(s>3)
break;
}
printf("%lf",s);
return 0;
}
|
C | //how many times will hello world be printed and why?
#include <stdio.h>
// int i;
int main()
{
for(int i = 1; i <= 3; i++){
printf("step1\n");
// if(i == 1)break;
for(int j = 1; j<=3; j++){
printf("step2\n");
for(int k = 1; k <= 3; k++){
... |
C | #ifndef MYSORT_H
#define MYSORT_H
#include "SqListImplement.h"
#define StackSize 100
int partition_random(SqList *L, int low, int high);
//ջ
typedef struct
{
LElemType_Sq *data;
int top;
}Stack;
void InitStack(Stack *s)
{
(*s).data = (LElemType_Sq *)malloc(StackSize * sizeof(LElemType_Sq));
if (!(*s).data)
retu... |
C | #include "holberton.h"
/**
* binary_to_uint - prints a unsigned int number in binary notation.
* @b: number to print.
* Return: number of digits printed.
*/
unsigned int binary_to_uint(const char *b)
{
unsigned int l, c = 0, t = 0, bin = 1;
if (b == NULL)
return (0);
while (b[c] != '\0')
{
if (b[c] != '0'... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* sh_expansions_tilde_tools.c :+: :+: :+: ... |
C | #include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<unistd.h>
#include<pthread.h>
void *ServerEcho(void *args)
{
int clientFileDescriptor=(int)args;
printf("%d\n", clientFileDescriptor);
close(clientFileDescriptor);
}
int main()
... |
C | #include<stdio.h>
int main()
{
int a,b,c,d;
while(scanf("%d",&a)!=EOF){
b=a/6;
if(b*6==a || a==0){
printf("Y\n");
}
else{
printf("N\n");
}
}
return 0;
}
|
C | #include "json-test.h"
#include "json-format.h"
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#define MSG_INFO "[==========] "
#define MSG_DEBUG "[----------] "
#define TEST_HEADER() printf(MSG_INFO "Output of: %s\n", __FUNCTION__)
#define TEST_NEXT() printf("\n" MSG_DEBUG "Additional line of ou... |
C | #include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <pthread.h>
int parseData(char *, int *, int *);
int fibonacci(int );
int randomgen(int , int );
void heapify(int *, i... |
C | #include "helpers.h"
#include <math.h>
// Convert image to grayscale
void grayscale(int height, int width, RGBTRIPLE image[height][width])
{
// to loop over every pixel
for(int i=0; i< height; i++){
for(int j=0; j< width; j++){
int av= round((image[i][j].rgbtRed + image[i][j].rgbtBlue +... |
C | #include<stdio.h>
#include<stdlib.h>
int main()
{
char c;
char ceaser1[25];
//To open a file you need to use the fopen function, which returns a FILE pointer.
FILE *fp;
int character[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int key;
char calc[9999];
int index = 0;
... |
C | #include "bst.h"
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int opcao;
no * arvore=NULL;
while(1==1) {
printf("Digite O Numero Relativo a Opcao:\n1 - Inserir elemento;\n2 - Percurso em pre-order;\n3 - Percurso em in-order;\n4 - Percurso em pos... |
C |
// Cprogram to find avg raimfall from 5 years rainfall data
/*
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug onlin... |
C | #include <stdio.h>
int main()
{
char a[20];
int b=0,c=0,i;
printf("enter the word and number:");
for(i=0;i<=20;i++)
{
scanf("%s" ,&a[i]);
}
for(i=0;i<=20;i++)
{
if(a[i]>='a'||a[i]>='A'&&a[i]<='z'&&a[i]<='Z')
{
c++;
}
if(a[i]>='0'&&a[i]<='9')
{
b++;
}
}
if(b>0&&c>0)
{
printf(" \t yes contain word with ... |
C | //*** exp1004A.c --- Fast PWM ̿***
// --- interrupt ʰ, register . !
#include <avr/io.h>
#include <avr/interrupt.h>
const unsigned int ocr1_table[]={5999,19999}; // 6000,20000
const unsigned int ocr3_table[]={7999, 6999,19999}; // 8000,7000,20000
#define PF_7_HIGH 0x80
#define PF_7_L... |
C | #include<stdio.h>
#include "header.h"
void store_marks()
{
FILE *pp;
pp=fopen("mark.txt","r");
int i,j;
printf("%c %c %c %c\n",data[2].roll[4],data[2].roll[5],data[2].roll[6],data[2].roll[7]);
for(i=0;i<32;i++)
{
if(data[i].roll[4]=='1' && data[i].roll[5]=='1')
for... |
C | #include<stdio.h>
#include<conio.h>
void main()
{
int i,number,pow=1,flag=0;
clrscr();
scanf("%d",&number);
for(;;number++)
{
pow*=2;
if(number==pow)
{
printf("%d",number);
break;
}
}
getch();
} |
C | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
int i;
int y=3;
int count = 0;
for (i = 101; i < 200; i+=2)
{
for (y = 3; y < sqrt(i);y+=2)
{
if (i%y==0)
{
break;
}
}
if (y >= sqrt(i))
printf("%d ", i);
count++;
}
printf("\n%d", count);
return 0;
... |
C | /*************************************************************************
> File Name: defunct.c
> Author: liyisheng
> Mail: liyishengchn@gmail.com
> Created Time: Thu 16 Apr 2015 01:02:37 AM PDT
************************************************************************/
#include<stdio.h>
#include<std... |
C | #include<stdio.h>
#include<stdlib.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a>b){
a=a+b;
b=a-b;
a=a-b;
}
int *can_make=(int *)malloc(sizeof(int)),size=1;
can_make[0]=0;
for(int i=a-1,count=0;count<a;i++){
int p=-1;
while(++p<size)
... |
C | #include <stdio.h>
int my_strcmp(const char *s1, const char *s2)//ַܱı
{
assert(s1&&s2);//ָ벻Ϊ
while (*s1 == *s2)
{
if (*s1 == '\0')
return 0;
s1++;//ȼȽ
s2++;
}
return *s1 - *s2;//زֵ
}
int my_strcmp(const char *s1, const char *s2)//ַܱı
{
assert(s1&&s2);//ָ벻Ϊ
while (*s1 == *s2)
{
if (*s1 == '\0')
... |
C | /* ************************************************************************** */
/* LE - / */
/* / */
/* check.c .:: .:/ . .:: ... |
C | #include "holberton.h"
/**
* exit_fn - a function that exit the shell
* @h: a argument
* @d: currently an unused atribute
* Return: exit with 0 on success
*/
char *exit_fn(char *d, list_t *h)
{
int n, status;
status = WEXITSTATUS(status);
n = (d == NULL) ? (status) : (_atoi(d));
free_list(h);
exit(n);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.