language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #define NDEBUG
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "common.h"
/********************************************************************************************/
#define i_val unsigned int
#define i_tag uint
#include <stc/cvec.h>
static void test_array(size_t n)
{
cvec_uint a1 = cvec_... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*
hallamos el valor de pi mediante el metodo de montecarlo
*/
main()
{
int p, circle, square, toss, rm, i;
float pi, x, y, r;
char resp;
rm = RAND_MAX;
do{
circle = 0;
do{
printf("Ingresa el numero de tosses (2<= n <=5000): ");
scanf("%d", &t... |
C | /*
Leyendo solamente un Conjunto de caracteres excluyentes con scanf()
El conjunto de escaneo tambin se puede utilizar para explorar caracteres que no estn contenidos
en el conjunto de exploracin utilizando un conjunto de exploracin invertido.
Para crear un conjunto de escaneo invertido, coloque un signo de intercal... |
C | id(str) { return str == "mermaid" || str == "statue"; }
short() { return "A statue of a mermaid"; }
long() { write("This is a statue of a beautiful mermaid, graceful even in\n"+
"suspension... and just pleasant to look at... yet sad.. She is looking\n"+
"upwards wistfully, and her hand seems to be poking out of the s... |
C | #include "LRU.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int initLRU(Swapper*);
void referenceLRU(Swapper*,unsigned int frame);
unsigned int chooseLRU(Swapper*);
void finalizeLRU(Swapper*);
typedef struct {
unsigned int clock;
unsigned int * age;
} InfoLRU;
InfoLRU *LRUref;
int initLRUSwapper(... |
C | /*
@autor: Malbolge;
@data: 23/09/2018;
@nome: Soma de Propina;
*/
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
void cpfPropinaSrc(char *, char *, char *);
void secondSrc(char *, char *, char *);
unsigned short somaNum(short *, unsigned short);
unsigned short somaNumStr(char *vet);... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node
{
int info;
struct node *llink;
struct node *rlink;
};
typedef struct node *NODE;
NODE Insert(NODE);
void Disp(NODE);
// NODE Search(NODE, int);//, *NODE, *NODE);
NODE Search(NODE, int, NODE*);
void Inorder(NODE);
void Preorder(NODE)... |
C | #include <stdio.h>
#include <GL/glut.h>
#include <math.h>
GLfloat tri[3][3] = {{50.0,150.0,100.0},{25.0,25.0,100.0},{1.0,1.0,1.0}};
GLfloat rot_mat[3][3] = {{0},{0},{0}};
GLfloat res[3][3] = {{0},{0},{0}};
GLfloat h = 50.0;
GLfloat k = 25.0;
GLfloat th;
void drawTriangle(){
glColor3f(0.0,0.0,1.0);
glBegin(... |
C | void dfs(vector<vector<int>>& image,int sr,int sc,int newcolor)
{
int nowcolor=image[sr][sc];
image[sr][sc]=newcolor;
int nowrow=image.size();
//cout<<nowrow <<endl;
if(nowrow<1)
return;
int nowcol=image[0].size();
//printf("sr=%d,sc=%d,nowcolor=%d\n",sr,sc,nowcolor);
if((sr-1>... |
C | /*write a program to check whether a given number is a prime number or not*/
#include<stdio.h>
int main (void)
{
int x, i;
printf("Enter any number:\n");
scanf("%d", &x);
if(x==1)
{
printf("1 is a unique number.\n");
}
else if(x==2)
{
printf("The number is a ... |
C | #include "global.h"
extern char admin_details[MAX][6];
int main(void)
{
initList(&list);
while (1)
{
// read a number form user to Login to System
int choose = 1000000;
printf("Welcome ..!\nChoose your account type to login (0 to terminate) :\n1) Student\t2)Admin : ");
... |
C | // ***
// *** You MUST modify this file, only the ssort function
// ***
#include "sort.h"
#include <stdio.h>
// DO NOT MODIFY THIS FUNCTION
bool checkOrder(int * arr, int size)
// This function returns true if the array elements are
// in the ascending order.
// false, otherwise
{
int ind;
for (ind = 0; ind < (si... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct fish {
double size;
} fish;
/* A school of fish is has an `int` for the number of fish followed
by an array of fish. */
#define SCHOOL_COUNT(p) *(int *)p
#define FISH_START(p) (char *)p + sizeof(int)
#define NTH_FISH_SIZE(p, n) ((fish *) (FISH_STAR... |
C | #ifndef MEDIAN_FILTER_H
#define MEDIAN_FILTER_H
//#define FILTER_TIME
void bubbleSort(double *data[], int arraySize);
void swap(double *a, double *b);
void printArray(double data[], int arraySize);
double medianFilter(double rawDataArray[], int arraySize);
void shiftBuffer(double data[], int arraySize);
... |
C | #include <stdio.h>
#include <assert.h>
#include "Cbuf16_margin.h"
#define MEM_DEPTH 100 // Total samples collected
#define TRIGGER 50 // When to start collecting for the right margin
int main(){
Cbuf16 buf;
Cbuf16Init(&buf, MEM_DEPTH / 2 , 500);
int i = 0;
uint16_t data_arr[MEM_DEPTH] = {0};
uint16_t ref_a... |
C | #include "rns_matrix.h"
#include <assert.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "iml.h"
#include "residue.h"
#include "reconstruct.h"
/** \brief Allocate a new rnsMatrix_t.
*
* The new rnsMatrix_t has each element of each constituent matrix set to zero. The
* ... |
C | #include "monty.h"
/**
* pchar - Prints ascii of the top of stack
* @stack : stack to be printed
* @lineno : line no of the instruction
*/
void pchar(stack_t **stack, unsigned int lineno)
{
stack_t *node;
node = *stack;
if (node != NULL)
{
if (node->n >= 0 && node->n <= 127)
printf("%c\n", node->n);
el... |
C | //创建一个整形数组,完成对数组的操作
//1、实现对init()函数的初始化数组全为0
//2、实现print()打印每一个元素
//3、实现resver()对数组元素的逆置
#include<stdio.h>
void init(int arr[], int sz)
{
int i = 0;
for (i = 0; i < sz; i++)
{
arr[i] = 0;
}
}
void print(int arr[], int sz)
{
int i = 0;
for (i = 0; i < sz; i++)
{
printf("%d ", arr[i]);
... |
C |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "files.h"
#include "errors.h"
typedef struct file_t {
char *name;
FILE *fp;
int line_no;
char unget_buffer[50];
int unget_index;
struct file_t *next;
} file_t;
static file_t *fstack;
static int lines_read... |
C | #include <stdint.h>
#include <stdio.h>
int main() {
char* astring = "I am somewhere in memory.";
intptr_t location = (intptr_t)astring;
printf("%s\n", (char*)location);
}
|
C | #include <pebble.h>
#include "window.h"
#include "bitmap.h"
#include "vibeOnDisconnect.h"
//Window item, time and date text layer and bitmap image pointers
static Window* s_window;
static TextLayer *s_time_layer, *s_date_layer;
static BitmapLayer *s_background_layer;
static GBitmap *s_background_bitmap;
static GFon... |
C | // ȣ ˰ ˻
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX_STACK_SIZE 100
typedef char element;
// ========= ڵ ========
typedef struct {
element data[MAX_STACK_SIZE];
int top;
}StackType;
// ʱȭ Լ
void init(StackType *s){
s->top=-1;
}
// Լ
int is_empty(StackType *s){
return (s->to... |
C | #include "controller.h"
#include "mthread.h"
#include "config_handler.h"
#include "mthread_list.h"
#include "iinterface.h"
#include "scheduler.h"
#include "iinterface.h"
#include "mheap.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <s... |
C | #include <stdio.h>
#include <stdint.h>
uint32_t htonf(float f)
{
uint32_t p;
uint32_t sign = 0;
if (f < 0) {
sign++;
f = -f;
}
p = ((((uint32_t)f) & 0x7fff) << 16) | (sign << 31);
p |= (uint32_t)(((f - (int)f) * 65536.0f)) & 0xffff;
return p;
}
float ntohf... |
C | #ifndef _HASH_H_
#define _HASH_H_
/* Forward declarations of structures. */
typedef struct Hash Hash;
typedef struct HashElem HashElem;
/* A complete hash table is an instance of the following structure.
** The internals of this structure are intended to be opaque -- client
** code should not attempt to access or mod... |
C | /**
* @file str.c
* @brief Implements various character array functions, such as removing
* a specified character, finding the length, concatenating, copying, reversing
* and swaping.
* @details File contains redudent functions whose only difference is array
* implementation versus pointer implementation.
*
* @... |
C | /** @file
This file contains operations on @c String, such as comparing, getting characters, converting to lower case, etc. Several of these functions dynamically create new strings. The documentation of each function tells whether its result is dynamically allocated. Such strings need to be freed with @ref s_free when... |
C | #include "monty.h"
/**
* _pop - removes the top element of the stack
*
* @head: head of the stack_t
* @line_number: line number of the opcode in the file
*
* Return: void
*/
void _pop(stack_t **head, unsigned int line_number)
{
stack_t *current;
stack_t *tmp;
current = *head;
if (current == NULL)
{
fpr... |
C | #include <stdio.h>
#include <stdlib.h>
#include "ui.h"
/**
* Imprime o cabecalho da area do admin
*/
void cabecalhoAreaAdmin() {
LIMPA_TELA;
printf(LINHAS);
printf(" AREA ADMIN\n");
printf(LINHAS);
}
/**
* Imprime o cabecalho da area do funcionario
*/
void cabecalhoAreaFuncionario() {
LIMPA_T... |
C | #include "Memoria.h"
#include "MSP.h"
#include "mspCPU.h"
#include "mspPrograma.h"
#include "commons/log.h"
#include "commons/socketInBigBang.h"
#include "commons/protocolStructInBigBang.h"
#include <stdlib.h>
#include <unistd.h>
extern t_MSP *self;
t_sockets *socketsKernel;
void *mspLanzarHiloCPU(t_socket* socketCli... |
C | /* timer */
#include "config.h"
#include "cpu.h"
#include "string.h"
#include "kmemory.h"
#include "console.h"
#include "task.h"
#include "queue.h"
#include "timer.h"
#include "alarm.h"
#include "errno.h"
#include "mutex.h"
#define ALARM_TBLSZ 16
#define ALARM_STAT_NOTUSE 0
#define ALARM_STAT_DMY 1
#define ALARM_... |
C | //#include <stdio.h>
//
//int main(void) {
// int opt;
// double num1, num2;
// double result;
//
// printf("1. 2. 3. 4.\n");
// printf("? ");
// scanf_s("%d", &opt);
// printf(" Ǽ Է: ");
// scanf_s("%lf %lf", &num1, &num2);
//
// if (opt == 1)
// result = num1 + num2;
// else if(opt == 2)
// result = num1 - num2;
/... |
C | #pragma once
// Component Types
enum class ComponentType : long int
{
// No Component
NO_COMPONENT = 0,
// Hierarchy Component - Only Required Component Type.
HIERARCHY_COMPONENT = 2,
// Transform Component.
TRANSFORM_COMPONENT = 4,
// Geometry Component.
GEOMETRY_COMPONENT = 8,
// Rendering Component.
R... |
C | #include <stdio.h>
int fun1()
{
printf("fun1\n");
return 0;
}
int fun2()
{
printf("fun2\n");
return 0;
}
int fun3(int a, int b, int c)
{
printf("%p\n", &a);
printf("%p\n", &b);
printf("%p\n", &c);
return 0;
}
void main()
{
int a = 1;
printf("%p\n", &a);
fun3(0, 0, 0);
... |
C | // Test that fork fails gracefully.
// Tiny executable so that the limit can be filling the proc table.
#include "types.h"
#include "stat.h"
#include "user.h"
#define N 10
void
schedtest()
{
int pid;
int start;
int i;
for (i=0; i<N; ++i) {
pid = fork();
if (pid == 0) { //child
printf(1, "start... |
C | #include "main.h"
#include "thinker/thinker.h"
#include "config.h"
#include "logger/logger.h"
#include "shm/shmManager.h"
#include "connector/connector.h"
/* parseArgs schaut ob die übergeben Parameter in der Kommandozeile valide sind
* ansonsten terminiert das Programm
*
* -i ist die Game-ID und muss genau 11... |
C | /*
*
* sttyl (stty-lite)
*
* Purpose:
* This is a unix commandline utility used to view and modify the terminal control settings
* for your console. In other words, stty allows you to determine how your
* current login session (for example) processes input and output, and to
* control these param... |
C | // define some dummy variables to make code more readable
int im_ready_tag = 0;
int workpile_tag = 1;
int special_tag = 42;
int finish_message = -1;
int root = 0;
if(myid == 0){
int line = 1;
int worker;
... |
C | #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
int listenfd = 0, connfd = 0;
struct sockaddr_in serv_addr;
int n;
char sendBuff[1024];
char recvBuff[1024];
... |
C | #include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
size_t ft_strlen(const char *str);
char *ft_strcpy(char *dst, char *src);
int ft_strcmp(const char *s1, const char *s2);
size_t ft_read(int fd, void *buf, size_t nbyte);
size_t ft_write(int f... |
C | /* Mini-projet ROB3 Algorithmique 2012-13 */
/* pour compiler : gcc projet.c -o projet */
/* pour lancer le programme après compilation : ./projet nom_du_fichier_tsp_sans_extension */
/* exemple : ./projet berlin52 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#... |
C | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.c
* Author: HP
*
* Created on 3 de noviembre de 2020, 02:04 PM
*/
#include <stdio.h>
#include <... |
C | #include <stdio.h>
int main()
{
double xn,
xnm1,
xnm2;
int i;
xnm2 = 0;
printf("%.0lf\n", xnm2);
xnm1 = 1;
printf("%.0lf\n", xnm1);
for(i = 3; i <= 50; i++)
{
xn = xnm1 + xnm2;
printf("%.0lf\n", xn);
xnm2 = xnm1;
xnm1 = xn;
}
return 0;
}
|
C | #ifndef _HEADERNAME_H
#define _HEADERNAME_H
#include <stdio.h>
#include <math.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
struct node {
int isTerminal; //是否为终结符号
int line; //第一次出现的行号
char *type; //类型(ID,INT,Program....)
char *value; //属性值
struct node *child;
... |
C | #include <stdio.h>
#include "headers.h"
void get_strings_from_user(char *string_a, char *string_b)
{
printf("\n Enter the first string : ");
getline(string_a);
printf("\n Enter the second string : ");
getline(string_b);
}
int get_copy_limit(int *n)
{
printf("\n Enter the limit upto which you'd like to compare :... |
C | #include <stdio.h>
/**
*main - entry point
*Return: 0
*/
int main(void)
{
unsigned int o;
for (o = 0; o <= 9; ++o)
{
printf("%i", o);
}
putchar('\n');
return (0);
}
|
C | #ifndef STABLE_H_
#define STABLE_H_
/*********************************************************************************/
/*Includes*/
/*********************************************************************************/
#pragma warning(push)
#pragma warning(disable : 4001)
#include <stdio.h> /* standard input/output */
#... |
C | #include <unistd.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <sys/types.h>
#include <poll.h>
#include <signal.h>
#include <sys/wait.h>
//var used to keep track of single child
pid_t child_pid = -1;
// var used to remember original terminal attributes.
struct termios sav... |
C | #include "shell.h"
/**
*parsing_cmd - select option exit or display env or return command
*@cmd: user typed command
*Return: command line
*/
char *parsing_cmd(char **cmd)
{
int i;
if (!_strcmp(cmd[0], "exit"))
{
clear_memory(cmd);
exit(EXIT_SUCCESS);
}
else if (!_strcmp(cmd[0], "env"))
{
for (i = 0 ; e... |
C | #ifndef TABLEDESSYMBOLESFN_H
#define TABLEDESSYMBOLESFN_H
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "symbole.h"
/* Contient les fonctions de la table des symboles */
/**
* @brief initialise la table des symboles
* @return Pointeur sur la table des symboles initialisée
*... |
C | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
int number;
printf("пJ@ӼƦr\n");
scanf_s("%d", &number);
if (number % 2 == 0)
{
printf("even\n");
}
else
{
printf("odd\n");
}
} |
C | #include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
int pipefd[2];
char *myChar = (char *) malloc(sizeof(char) * 10);
unsigned int numb;
char buf;
pid_t fils1, fils2;
if (pipe(pipefd) == -1) {
perror("pipe");
exit(EXIT_FA... |
C | #include "quilt.h"
int yylex();
void yyerror(char *s);
Colcha *crea(int n, int m){
char **p;
int i;
Colcha *c;
c=(Colcha* )malloc(sizeof(Colcha));
c->alto=n;
c->ancho=m;
c->mat=(char **)malloc(n*sizeof(char *));
for(i=0;i<n;i++){
c->mat[i]=(char *)malloc(m*sizeof(char));
}
return c;
}
Colcha *B(){... |
C | #define _FILE_OFFSET_BITS 64
#include "db.h"
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _WIN32
#define fseeko _fseeki64
#define ftello _ftelli64
#endif
#define INSECUREDB_HEADER_SIZE ((sizeof(uint64_t) * 3) + 4)
/* djb2 hash function */
static uint64_t INSECUREDB_hash(const void *b,unsigned... |
C | #ifndef ROCKET_H_
#define ROCKET_H_
#include "../c-vector-lib/vector.h"
#include "DNA.h"
#include <math.h>
typedef struct Rocket {
Vector position;
Vector velocity;
Vector acceleration;
DNA *dna;
double fitness;
bool completed;
bool crashed;
} Rocket;
Rocket *CreateRocket(Vector p, Vector v, Vector a, DNA *dna... |
C | //Write a program to add two user input numbers using one function.
#include<stdio.h>
int main()
{
int sum,number1,number2;
printf("enter number1");
scanf("%d",&number1);
printf("enter number2");
scanf("%d",&number2);
sum=number1+number2;
printf("sum of %d and %d is %d",number1,number2,sum);
}
|
C | //%cflags:-lpthread -lm
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <pthread.h>
#define NUM_HILOS 16
#define MAXITER 1e09
struct datos{
int a;
char b;
};
float y;
int * funcion(void *datos)
{
double x = 0.0;
int i;
struct datos *datosH;
datosH = datos;
printf(... |
C | #include <stdio.h>
#include <stdlib.h>
#define LARGE 100
void Bottom_up_heapify(int heap[] , int i){
int p = (i-1)/2;
while(p>=0 && heap[p]<heap[i]){
int tmp = heap[i];
heap[i] = heap[p];
heap[p] = tmp;
i = p;
p = (i-1)/2;
}
}
void Top_Down_heapify(int heap[], int ... |
C | #include <stdlib.h>
#include <stdio.h>
typedef struct {
void *base;
int typeSize;
int length;
} arrayUtil;
typedef int (MatchFunc)(void *, void*);
typedef void (ConvertFunc)(void *, void *, void*);
typedef void (OperationFunc)(void* , void*);
typedef void* (ReducerFunc)(void* , void* , void* );
arrayUtil create(i... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// contrabarra cero corte de muestra para cadena (\0)
int main()
{
char nombre[6];
char otroNombre[50]="Jose Perez";
int largo;
int compara;
//strncpy(nombre,otroNombre,5);
printf("su nombre es: %s", nombre);
//pr... |
C | /* FIT3143 - Parallel Computing
* Lab Time Tuesday 18:00-20:00
* Lab ID 6
* Pair Number 4
* Group Members Philip Chen 27833725
* Ethan Nardella 29723299
* --------------------------------------------------
* Lab 10 - Task 3
* mpicc task3.c -o task3_out -lm
* mpirun... |
C | #include "shared.h"
#include <stdlib.h>
#include <signal.h>
#include <ctype.h>
#include <arpa/inet.h>
/**
* Reads a section of a sinister file.
* Once a line is deemed valid (not blank or a comment), control is passed to
* the given processLine function.
* Returns non-zero on EOF or empty line. Returns proc... |
C | #include <stdio.h>
int main()
{
int i, f = 2;
double rst = 2.5;
printf("n e\n");
printf("- -----------\n0 1\n1 2\n2 2.5\n");
for(i = 3; i < 10; ++i) {
f *= i;
printf("%d %.9lf\n", i, rst += (double) 1 / f);
}
return 0;
} |
C | /*
towerofhanoi
============
Solve the Tower of Hanoi problem by recursion.
The program prompts the user to enter the number of disks in the tower.
This must be in the range 1-64.
This program prints a sequence of move instructions identifying the disks to be moved.
There is a flag prin... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct Aluno{
char nome[50];
char matricula[13];
} Aluno;
#define TAM_ALUNO sizeof(Aluno)
#define DIR "arq2.dat"
int quantRegistros(FILE *pf,int tr){
fseek(pf,0,SEEK_END);
int iteracoes = ftell(pf)/tr;
fseek(pf,0,SEEK_SET);
... |
C | #include <stdio.h>/////指针练习
#define N 20
int main(int argc, const char *argv[])
{
char str[N]="abcdefghijklmn";
char *ptr;
ptr=str;
/*for (i = 0; i < N; i++,ptr++)
{
*ptr='a'+i;
}
*ptr='\0';//
printf("str=%s\n",str);//
for (i = 0; i < N; i++)
{
printf("%c",st... |
C | #include <stdio.h>
int main() {
// n = Numarul de numere ce vor fi citite din numere_intregi.txt
int n, x;
// Deschid fisierul numere_intregi.txt in modul citire text.
FILE *fin = fopen("numere_intregi.txt", "rt");
// Deschid fisierele 'numere_pozitive.bin' si 'numere_negative.bin'
// in modul de scrier... |
C | struct node_t {
int * data; // pointer to an integer
int test;
node_t * next; // pointer to another node_t
};
int sum(node_t *node) {
if (node == NULL) {
return 0;
}
return node->data + sum(node->next);
}
struct temp_t {
int a;
int t[4];
};
int f(temp_t *v, int *xs) {
ret... |
C | /******************** (C) COPYRIGHT 2015 Silicone shell electronic studio **************************
* ļ Lcd1602.c
* : 1602Һʾ⺯
* Ӳӣ EN:P2.5
* RW:P2.6
* RS:P2.7
* D0~D7:P0
*
* ʵƽ̨SHELL1.0
*
* е
**********************************************************************************/... |
C | //
// main.c
// Day09
//
// Created by tarena on 15/7/9.
// Copyright (c) 2015年 tarena. All rights reserved.
//
#include <stdio.h>
void fa(int x)//形参是局部变量
{
x++;
printf("in fa x=%d\n", x);
int y = 20;//定义在函数体内的变量是局部变量
y++;
for (int i = 0; i < 10; i++)
{
printf("%d ", i);
... |
C | #include <stdio.h>
#include <stdlib.h>
#include "Stack.h"
void display(StackEntry e) {
printf("e is : %d \n", e);
}
int main()
{
Stack s;
InitializeStack(&s);
Push(5,&s);
Push(6,&s);
Push(8,&s);
TraverseStack(&s,&display);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
float num1, num2, num3, num4, media;
num1 = num2 = num3 = num4 = media = 0;
printf("=========Media Escola 1.0==========\n\n");
printf("Digite sua primeira nota bimestra:");
scanf("%f", &num1);
printf("Digite sua segunda nota bimestra:");
... |
C | #include <NumberObject.h>
#include "MemoryManager.h"
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
DLLEXPORT_TEST_FUNCTION struct NumberObject *NumberObject_Create(struct StreamWriter *streamWriter, double value)
{
struct NumberObject *x;
x = (struct NumberObject *)MemoryManager_Alloc(sizeof(struct Number... |
C | #include <stdio.h>
#include "grafo_matrizadj.h"
bool inicializaGrafo(TipoGrafo* grafo, int nv){
int i, j;
if(nv > MAXNUMVERTICES){
imprimeErroIniciar();
return false;
}
if(nv <= 0){
imprimeErroIniciar();
return false;
}
grafo->numVertices = nv;
grafo->numArestas = 0;
for(i=1; i <= grafo-... |
C | #include<stdio.h>
#include<conio.h>
float force(float);
int main(){
float m;
printf("\nEnter mass of body in Kgs ");
scanf("%f",&m);
printf("\nMass of body in Kgs %.3f",m);
printf("\nForce of attraction on body is Newton %.3f N",force(m));
return 0;
}
float force(float a){
re... |
C | //André Quintiliano Filho 0030481523006
//Matheus Luiz da Silva 0030481523028
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (void)
{
int Poltrona[50];
int i,c,Assento;
int a=1;
for (i=0;i<46;i++)
{
Poltrona[i]=0;
}
printf("\n");
for (i=0;i<=1;i++)
{
printf("[%i]", a++);
fo... |
C | #include "joystick.h"
#include "bitmanip.h"
#include "adc.h"
#include <util/delay.h>
JOY_position_t neutral_pos;
void JOY_init( void ){
ADC_init();
calibrate();
// initialize PORT B, pin 0, 1 and 2 as input
clear_bit(DDRB, PINB0);
clear_bit(DDRB, PINB1);
clear_bit(DDRB, PINB2);
// activate pull-up resis... |
C | #include<stdio.h>
int main ()
{
int a;
printf("a= !\n");
scanf("%d",&a);
printf("a=%d\n",a);
return 0;
}
|
C |
/* */
/* Program Name: pow10.c */
/* */
#include <stdio.h>
#include <math.h>
#include <stdlib.h> /* errno is defined here */
void main(void)
{
char *convert_string;
int p;
double pow10_val;
printf("Enter two number that you want to evaluate"
" its 10^p\n")... |
C | #include <stdio.h>
unsigned long long int fibonacci(unsigned int n);
int main(void){
unsigned int number;
printf("%s", "immetti un intero: ");
scanf("%u", &number);
unsigned long long int result = fibonacci(number);
printf("Fibonacci(%u) = %llu\n", number, result);
}
unsigned long long int fibonacci(... |
C | /*
栈、作用域和全局
*/
#include <stdio.h>
#include "ex22.h"
#include "bdg.h"
// 该变量是被定义于头文件中的extern变量,意味着在ex22_main.c中也可以访问它
int THE_SIZE = 1000;
// 定义于文件中的static变量只能在本文件中使用
static int THE_AGE = 37;
// 在其他文件里你不能直接访问THE_AGE,但可以通过此函数来访问THE_AGE
int get_age()
{
return THE_AGE;
}
// 在其他文件里你不能直接访问THE_AGE,但可以通过此函数来设置THE_AGE
... |
C | /*Your grandparents gave you a fantastic cooking
recipe but you can never remember how much of each
ingredient you have to use! There are 10 ingredients
in the recipe and the quantities needed for each of
them are given as input (in grams). Your program must
read 10 integers (the quantities needed for each of
the... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncmp.c :+: :+: :+: ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <string.h>
int ispal_1(char *);
int ispal_2(char *);
int ispal_3(char *);
void strrev(char *);
void main()
{
char s[] = "abcbad";
char t[] = "jkj";
// int s_1 = ispal_1(s);
// int s_2 = ispal_2(s);
int s_3 = ispal_3(s);
// int t_1 = ispal_1(t);
// int t_2 = ispal_2(t);
// int t_3 = i... |
C | #include <pcap.h>
#include <string.h>
#include <stdlib.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#define MAXBYTES2CAPTURE 65536
void processPacket(u_char *arg, const struct pcap_... |
C | //@ author David Kanda (dkanda)
//@ date 3/1/2013
//@ description MPI test program hello world
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[])
{
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
int rank, size;
MPI_Init(&argc, &argv); //initialize
MPI_Comm_rank(MPI_COM... |
C | /*
** EPITECH PROJECT, 2017
** test
** File description:
** test
*/
#include "get_next_line.h"
#include <criterion/criterion.h>
#include <criterion/redirect.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int fd = -1;
void open_file(void)
{
fd = open("data.txt", O_RDONLY);
cr... |
C | #include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[])
{
float new_guess;
float last_guess;
float number;
printf("please enter the number\n");
scanf("%f", &number);
if (number<0) {
printf... |
C | #include "binary_trees.h"
/**
* height - measures the height of a binary tree
* @tree: pointer to the root node of the tree to measure the height.
*
* Return: Height of the tree, or 0 on failure
*/
size_t height(const binary_tree_t *tree)
{
size_t count1, count2;
if (tree == NULL)
return (0);
if (tree->left... |
C | /* Library.ascのカードをHCPに変換 */
int atohcp(int a)
{
switch (a) {
case 'A':
return 4;
case 'K':
return 3;
case 'Q':
return 2;
case 'J':
return 1;
default:
return 0;
}
}
|
C | /*
* mm-naive.c - The fastest, least memory-efficient malloc package.
*
* In this naive approach, a block is allocated by simply incrementing
* the brk pointer. A block is pure payload. There are no headers or
* footers. Blocks are never coalesced or reused. Realloc is
* implemented directly using mm_malloc and... |
C | #include <stdio.h>
#include <stdint.h>
uint8_t and_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) & ((b >> 0) & 0x01);
}
uint8_t xor_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) ^ ((b >> 0) & 0x01);
}
uint8_t or_gate(uint8_t a, uint8_t b){
return ((a >> 0) & 0x01) | ((b >> 0) & 0x01);
}
uint8_t ... |
C | #include <stdio.h>
#include <stdlib.h>
int checkLine(char *line) {
int min;
int max;
char letter;
char password[40];
sscanf(line, "%i-%i %c: %s", &min, &max, &letter, password);
int count = 0;
for (int i=0; password[i]!='\0'; i++) {
if (password[i] == letter) {
if (++co... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
double sum=0;
int x;
for(x=0;x<1000;x++)
{
if(x%3==0)
{
sum = sum+x;
}
else if(x%5==0)
{
sum=sum+x;
}
else if(x%15==0)
{
sum=sum-x;
}
}
printf("%.2f",sum);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct StackNode{
int data;
struct StackNode* next;
}StackNode;
void push(StackNode** root, int new_data){
StackNode* new_node = (StackNode*)malloc(sizeof(StackNode));
new_node->data = new_data;
new_node->next = *root;
*root =... |
C | #ifndef WAIT_H_INCLUDED
# define WAIT_H_INCLUDED
#include <stdint.h>
typedef enum wait_flag
{
WAIT_FLAG_TRAJ = 0,
WAIT_FLAG_SONAR,
WAIT_FLAG_GAMEOVER,
WAIT_FLAG_TIME,
WAIT_FLAG_INVALID
} wait_flag_t;
typedef uint32_t wait_mask_t;
#define WAIT_MASK(__f) ((uint32_t)1 << WAIT_FLAG_ ## __f)
#define WAIT_MA... |
C | /* 包含找到数组中所有不重复数的方法
* 正确题解看这里https://www.liuchuo.net/archives/2480
*/
#include <stdio.h>
#include <stdlib.h>
#define MAX(x, y) ((x > y) ? (x) : (y))
int cmp(const void *a, const void *b);
int nextRight(int right, int a[], int N);
int main(void)
{
int N, *a;
scanf("%d", &N);
a = (int *)malloc(N * s... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct node
{
int data;
struct node *next;
} ST;
void add_mid(ST **);
void print(ST *);
int main()
{
ST *hptr = NULL;
char ch;
do
{
add_mid(&hptr);
printf ("Do you want to continue Y/N \n");
scanf (" %c",&ch);
}
while( ch == 'Y' || ch == 'y');
print(hptr);
}
void add_m... |
C | #include "monty.h"
glob_var global_var = {NULL, NULL};
/**
* main - main function of the monty processing.
* @argc: integer with the amount of arguments.
* @argv: array with pointers to each argument.
*
* Return: EXIT_SUCCESS if success, EXIT_FAILURE instead.
*/
int main(int argc, char *argv[])
{
ssize_t is_EO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.