blob_id large_stringlengths 40 40 | language large_stringclasses 1
value | repo_name large_stringlengths 4 124 | path large_stringlengths 2 969 | src_encoding large_stringclasses 35
values | length_bytes int64 6 2.95M | score float64 2.52 5.44 | int_score int64 3 5 | detected_licenses large listlengths 0 58 | license_type large_stringclasses 2
values | text stringlengths 9 2.95M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
7bad9ef59f5e8911707e5a55d1cb7685fe3f5bb9 | C | nhtranngoc/KnR-C99 | /Ch3/Ex1/main.c | UTF-8 | 1,279 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
#include <time.h>
int binsearch(int x, int v[], int n);
int binsearch_better(int x, int v[], int n);
int main() {
int sorted_array[] = {0,1,2,3,4,5,6,7,8,9};
clock_t start, end;
start = clock();
int bin1res = binsearch(4,sorted_array,10);
end = clock();
double time_taken = (double)(start - e... | true |
2eca922800ca7ea31b43b88c3aedefbd76caec7a | C | lazyparser/poj | /1067/1067.c | UTF-8 | 356 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int main(){
int a,b,tmp,k,a_lose;
while(2==scanf("%d%d",&a,&b)){
if(a>b){tmp=a;a=b;b=tmp;}
k = b-a;
/* 2012-9-11
* Found the mysterious formula here
* http://blog.csdn.net/manio/article/details/589172
*/
if(a==(int)(k*(1.0+sqrt(5))/2.0)){
printf("%d\n",0);
}e... | true |
ce175136f05a215dfec024866781cb19827b4afb | C | BeeMargarida/RCOM | /Projeto 1/llread.c | UTF-8 | 3,315 | 2.546875 | 3 | [] | no_license | #include "data_link_layer.h"
char* lastData;
int serial_fd;
int turnPacket = 0;
void createErrors(unsigned char* buffer, int size);
unsigned char generateBCC(unsigned char* buf, int size);
int destuffing(unsigned char* tram, unsigned char* buf, int size);
void processTram(unsigned char* tram, unsigned char* buf, int ... | true |
239c09d56838529ae21bcbc58a5f0f94c0d55127 | C | Dennis-Johnson/cn-lab | /socket-programming/udpMatrix/server.c | UTF-8 | 1,590 | 3.40625 | 3 | [] | no_license | #include "common.h"
// Echoes back whatever client sends to this UDP server
int mat_ind = -1;
int *matrix[MAX_ROWS];
void displayMatrix()
{
printf("\nDisplay Matrix\n");
if (mat_ind == -1)
{
printf("Empty Matrix\n");
return;
}
for (int i = 0; i <= mat_ind; i++)
{
for ... | true |
e80472a4f5af72bf619cf96dc6e41643f2a6bad0 | C | onapoli/3D-simulation-raycasting | /get_next_line.c | UTF-8 | 2,622 | 3.03125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... | true |
7b3634903577338588ff9be436c0984b3741fbf8 | C | waleed-adel/C_Exercises | /Basics_Implementations/BASIC_MENU_IMPLEMENTATION.C | UTF-8 | 1,377 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
#include<conio.h>
#define column 1
#define row 1
#define ENTER 13
#define ESC 27
#define UP 72
#define DOWN 80
void main (void)
{
int i, counter=0, flag=0;
char c, n[20];
clrscr();
while (flag==0)
{
gotoxy(column,row);
printf("Name:");
gotoxy(column,row+1);
printf("Number... | true |
40238f16bb1ca5a1d4e7c71e3780c981350f15d2 | C | burn73/SO_Trabz | /biblioteca.c | UTF-8 | 4,215 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <fcntl.h>
struct Node{
int id;
int connections[10];
char* comp;
struct Node *prox;
};
typedef struct Node node;
char **split(char *buf){
int i = 0, n = 0;
c... | true |
c10d245c63ae83fd99732d9a69de54eb3ddf44db | C | SkillUp-programs/C-Programing | /3.c | UTF-8 | 99 | 2.5625 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int a=10;
a<5?printf("Hai"):printf("Bye");
return 0;
}
| true |
4a3779fe8f215a4d5b588b42e5b795c67a665392 | C | psenzee/senzee5 | /iOS/Utilities/strs_c.h | UTF-8 | 4,153 | 2.65625 | 3 | [] | no_license | // Pure C String and Parsing Utilities, Paul D. Senzee (c) 2000-2011
#ifndef _STRS_C_H
#define _STRS_C_H
#include <string.h>
#define _bool int
#define _true 1
#define _false 0
#ifdef __cplusplus
extern "C" {
#endif
#ifndef WIN32
#define stricmp strcasecmp
#define strnicmp strncasecmp
int memic... | true |
797a3c3932a7d1f3c90114ceed2cdb3fe44c30a0 | C | breber/school | /CprE288/FinalProject/Impl/irobotsensors.c | UTF-8 | 2,184 | 2.75 | 3 | [] | no_license | #include "irobotsensors.h"
/// Checks all of the sensors on the iRobot body (Cliff, Bump, Wheel drop, Virtual Wall) and stops
/// the robot if it detects any of these sensors.
/**
* Checks the sensor son the iRobot and stops movement if it detects a condition where it
* needs to stop. If it detects such an event, it... | true |
8824685b5d4c08d86f99b5c2a208443d6bf3d148 | C | Monicaofak/study-C | /express sentence/circulation/while.c | UTF-8 | 2,432 | 3.71875 | 4 | [] | no_license | /*循环三要素:循环变量的初值、循环变量的判断、循环变量的更新
while循环的特点:先判断,再执行
*/
#include <stdio.h>
int main()
{
int i=0;
while(i<10)
{
i++; //通过控制i的值来控制循环的次数
printf("第%d遍\n",i);
}
return 0;
}
//计算1-100累加和
#include <stdio.h>
int main()
{
int i=0;
int sum=0;
while(i<100)
{
i++;
sum=sum+i;
}
printf("sum=%d",sum);
return ... | true |
e04414002f0a44a47ca647c0f350299ea506b6d1 | C | El-Messiry/IoT_platform | /src/Service_Layer/System_Diagnostic/diagnostic.c | UTF-8 | 1,085 | 3.28125 | 3 | [] | no_license | /*
* diagnostic.c
*
* Created on: Apr 17, 2019
* Author: messi
*/
#include "diagnostic.h"
// Display Queue
xQueueHandle Q_Display ;
void Init_DisplayDiagnostic(void){
/*
* Description:
* Initialize Empty Queue for Messages to be sent on
* Usage:
* 1-create variable of type "DisplayStruct_t"
... | true |
194808ad6a5620047d295ec506eecf83744c9af2 | C | Sanskar13/Hackerrank-IMP-Q-s | /stringtoken.c | UTF-8 | 529 | 3.40625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
char *s;
s = malloc(1024 * sizeof(char));
scanf("%[^\n]", s);
s = realloc(s, strlen(s) + 1);
//Write your logic to print the tokens of the sentence here.
//Extract first token
char * toke... | true |
801b13f43401717fe30de71adb10c35bc8cd0dbe | C | bobbae/free | /app/shell.c | UTF-8 | 3,323 | 2.53125 | 3 | [] | no_license | /* $Revision: 1.2 $ */
#include "common.h"
#include "cpu.h"
#include "kern.h"
#include "sem.h"
#include "shell.h"
#include "string.h"
#define SHELL_PRI 1000 /* pretty high */
char shell_stack[1024];
tcb_t shell_tcb;
extern char *optarg;
extern int optind;
extern int ... | true |
d673f4eb03632a60d694ac4b59c31bbdb3538fcf | C | Bernbian/bianjiangchen | /演示多个字符从字符串两端移动,向中间汇聚/演示多个字符从字符串两端移动,向中间汇聚/打印Welcome to my room!!!.c | GB18030 | 493 | 3.5 | 4 | [] | no_license | //ʾַַƶм
#include<stdio.h>
#include<windows.h>
#include<stdlib.h>
int main()
{
char arr1[] = "Welcome to my room!!!";
char arr2[] = "######################";
int left = 0;
int right= (sizeof(arr1) / sizeof(arr1[0])) - 2;
while (left <= right)
{
arr2[left] = arr1[left];
arr2[right] = arr1[right];
printf("%... | true |
2db9cb94ae009a243e7109133bb715983bf594e7 | C | jlassi1/binary_trees | /17-binary_tree_sibling.c | UTF-8 | 463 | 3.609375 | 4 | [] | no_license | #include "binary_trees.h"
/**
*binary_tree_sibling-finds the sibling of a node
*@node:a pointer to the node to find the sibling
*
*Return: a pointer to the sibling node or NULL if faileur
*/
binary_tree_t *binary_tree_sibling(binary_tree_t *node)
{
if (!node || !node->parent)
return (NULL);
if (!node->parent->lef... | true |
76e837917f5926a430982618d16f6b7bcd891a6d | C | WojciechMula/toys | /conv_to_hex/expand_nibble.c | UTF-8 | 3,268 | 2.90625 | 3 | [
"BSD-2-Clause"
] | permissive |
/*
Operations:
- 6 shifts
- 4 bit-and
- 3 bit-or
*/
uint32_t nibble_expand_naive(uint32_t x) {
assert(x <= 0xffff);
const uint32_t n0 = x & 0x0f;
const uint32_t n1 = (x >> 4) & 0x0f;
const uint32_t n2 = (x >> 8) & 0x0f;
const uint32_t n3 = (x >> 12) & 0x0f;
return n3 | (n2 <... | true |
5ffb0863aab1cb338bac9d56193123154ed5ae2e | C | koverg70/HomeMesh3 | /Components/daylight.h | UTF-8 | 1,956 | 3.71875 | 4 | [] | no_license | #ifndef __DAYLIGHT_H__
#define __DAYLIGHT_H__
/*--------------------------------------------------------------------------
FUNC: 6/11/11 - Returns day of week for any given date
PARAMS: year, month, date
RETURNS: day of week (0-7 is Sun-Sat)
NOTES: Sakamoto's Algorithm
http://en.wikipedia.org/wiki/Calculat... | true |
94b039a9a9af33102f143b5cc89e68f44429c3fd | C | pvvm/Proj-PC | /projeto.c | UTF-8 | 7,219 | 3.203125 | 3 | [] | no_license | // autor: Pedro Vitor Valença Mizuno
// arquivo: projeto.c
// atividade extraclasse
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <time.h>
#include <semaphore.h>
int pratos = 0, est_forno = 0, tamanho, cont = 0;
int num_pratos[5] = {0,0,0,0,0};
int* sorteio = 0;
struct fila ... | true |
9ec148feff338544587186440f140550ee178bd2 | C | Arain-yu/rtos_simulation | /main.c | UTF-8 | 3,709 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
*****************************************************************************************
*
* @name main.c
* @author yuzrain
*
*****************************************************************************************
*/
#include "stdio.h"
#include "ARMCM3.h"
#define TASK_1_STK_SIZE 1024
#define ... | true |
c1705d2c92708f03a17d067a22a330e579680fe9 | C | mustafaisikk/C-Programming | /2018.03/23.03.2018/1/main.c | UTF-8 | 556 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct node{
int data;
struct node *sonraki;
};
int main() {
int a,b;
struct node *ilkdugum=malloc(sizeof(struct node));
struct node *ikincidugum=malloc(sizeof(struct node));
printf("ilk elemani giriniz: ");
scanf("%d",&a);
printf("ikinci elemani ... | true |
6a36375723aef8ae42292f59c1d1e0c0bf461945 | C | usernamegemaoa/CC3D-CableCam-Controller | /example/ub_lib/stm32_uart.c | UTF-8 | 3,002 | 2.78125 | 3 | [] | no_license |
#include "stm32_uart.h"
#include "stdio.h"
#include "math.h"
#include "errno.h"
#include "main.h"
#include "stm32f1xx_hal_gpio.h"
#include "stm32f1xx_hal_tim.h"
#include "string.h"
UART_HandleTypeDef Uart3Handle;
/* Buffer used for transmission */
uint8_t aTxBuffer[80];
uint8_t aRxBuffer[80];
uint8_t aLastLine[80];
... | true |
051948eb74f2421d944809bb60feb78196746a95 | C | bhagavansprasad/students | /salma/structures/sizeofstruct.c | UTF-8 | 149 | 2.9375 | 3 | [] | no_license | #include<stdio.h>
struct node
{
//int a;
int b;
char c[20];
};
struct node *p=0;
main()
{
p++;
printf("size of struct :%d \n",p);
}
| true |
8e963d848738b65677b636ddc1fe6bdca7861b63 | C | qeedquan/challenges | /codegolf/are-all-three-integers-distinct.c | UTF-8 | 617 | 3.921875 | 4 | [
"MIT"
] | permissive | /*
You will be given 3 integers as input.
The inputs may or may not be different from each other.
You have to output 1 if all three inputs are different from each other, and 0 if any input is repeated more than once.
This is code-golf, so make your code as short as possible!
*/
#include <assert.h>
int
distinct(int... | true |
aad0b0d076d7af27f018f704dbc0b526b8ce41e9 | C | Photosounder/rouziclib | /rouziclib/general/hashing.c | UTF-8 | 539 | 2.625 | 3 | [
"MIT"
] | permissive | #include "../libraries/xxh64.c"
uint64_t get_pointer_hash(const void *ptr)
{
return XXH64(&ptr, sizeof(void *), 0);
}
uint64_t get_buffer_hash(const void *ptr, size_t size)
{
return XXH64(ptr, size, 0);
}
uint64_t get_string_hash(const char *string)
{
return get_buffer_hash(string, strlen(string));
}
uint64_t ge... | true |
693bc9ae50c995aba56b36da675540d83ce70982 | C | kostmetallist/leetcode-sources | /min-stack/solution.c | UTF-8 | 1,928 | 4.15625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct StackElem {
int value;
struct StackElem *older;
struct StackElem *greater;
};
typedef struct {
int size;
struct StackElem *head;
struct StackElem *min;
} MinStack;
MinStack *minStackCreate() {
MinStack *stack = (MinStack *) malloc(siz... | true |
7b1092e979fe76d228e9cf44a869f30f5f47e39b | C | sechchr22/holbertonschool-low_level_programming | /0x13-more_singly_linked_lists/8-sum_listint.c | UTF-8 | 386 | 3.75 | 4 | [] | no_license | #include <stdio.h>
#include "lists.h"
/**
* sum_listint - function that returns the sum
* of all the data (n)
* @head: reference (pointer to pointer) to the head
* of a list
* Return: sum of all the data
*/
int sum_listint(listint_t *head)
{
int count = 0;
if (head == NULL)
return (0);
while (head)
{
cou... | true |
954a6ffd3595f006ac362056424cde54b34fda7b | C | guilledk/interpreter | /src/utils.c | UTF-8 | 127 | 2.984375 | 3 | [] | no_license | #include <assert.h>
#include "utils.h"
unsigned char char_to_byte(char c) {
assert(c >= '0' && c <= '9');
return c - '0';
} | true |
21b2dcc3eed9355deb4fe166d106836179525238 | C | ljx791863565/homework | /Calendar/Calendar.c | UTF-8 | 3,310 | 3.859375 | 4 | [] | no_license | #include "Calendar.h"
int isYear(int year)
{
if (year < 0 || year > 9999){
return -1;
}
return 1;
}
int isLeapYear(int year)
{
if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)){
return 1;
}
return -1;
}
int isMonth(int month)
{
if (month < 0 || month > 12){
return -1;
}
return 1;
}
int g... | true |
128e1d3c60b2eecd99e959f54834384dcb8c4d4b | C | Flash1ee/cprog-labs-3-4-sem-bmstu-iu7 | /lab_52_02/main.c | UTF-8 | 1,969 | 2.75 | 3 | [] | no_license | #define __USE_MINGW_ANSI_STDIO 1
#include "utils.h"
int main(int argc, char *argv[])
{
setbuf(stdout, NULL);
if (argc != 3 && argc != 4)
return ARG_ERR;
char mode[3];
strncpy(mode, argv[1], 2);
mode[2] = '\0';
size_t size = 0;
int rc = OUT_ERR;
if (argc == 4)
... | true |
d24e63dd80ac3808652b6fc4ad6738f8660f2d3c | C | ffelipegupe/holbertonschool-low_level_programming | /0x07-pointers_arrays_strings/0-memset.c | UTF-8 | 458 | 3.96875 | 4 | [] | no_license | #include "holberton.h"
/**
* _memset - function that fills the memory
* @s: pointer to the block of memory to fill
* @b: character to fill s with
* @n: the first bytes of the memory area pointed to by s
*
* Description: function that fills memory with a constant byte
* Return: a pointer to the memory area s
*/... | true |
ec7ac1e3d652615763d4f1df30e7719ba68db92d | C | RAdrianoDev/42SP-Basecamp | /c_02/ex09/main.c | UTF-8 | 371 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
char *ft_strcapitalize(char *str);
int main(void)
{
char src[15];
src[0] = 'o';
src[1] = 'i';
src[2] = ',';
src[3] = ' ';
src[4] = 't';
src[5] = 'd';
src[6] = '?';
src[7] = '4';
src[8] = 'P';
src[9] = ';';
src[10] = ' ';
src[11] = 'c';
src[12] = '+';
src[13] = 'u';
src[14] = '\0';
... | true |
da0138236c18f66ce833a2a3e6a91497f35f068b | C | yyq123/learn-vim | /samples/weight.c | UTF-8 | 1,178 | 4.21875 | 4 | [] | no_license | /* Using qsort() and bsearch() with values.*/
#include <stdio.h>
#include <stdlib.h>
#define MAX 20
int intcmp(const void *v1, const void *v2);
main()
{
int arr[MAX], count, key, *ptr;
/* Enter some integers from the user. */
printf("Enter %d integer values; press Enter after each.\n", MAX);
... | true |
e42f55e2be15425bc432ff43bbb452ddea99c16e | C | cooee/c_sourcecode | /encrypt/encrypt_realize/sha256.h | UTF-8 | 1,039 | 2.609375 | 3 | [] | no_license | #ifndef __HMAC_SHA256_H__
#define __HMAC_SHA256_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
//sha256.h
type... | true |
5fdced50550eb5325beba27fc04253111bb5aaee | C | leonardostefan/ICC_trab2 | /calculaInversa.h | UTF-8 | 2,150 | 2.78125 | 3 | [] | no_license |
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "utils.h"
#ifndef __FAT_LU_H__
#define __FAT_LU_H__
typedef double * MatRow;
// Estrutura para armazenar uma matriz A, decompola em LU a fim de calcular a matriz inversa
typedef struct
{
unsigned int n; // Ordem da matriz
double **A; ... | true |
62d0f842012b0e502fb4c814a251779719775426 | C | larioj/languages | /c/knr/squeeze.c | UTF-8 | 336 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void squeeze(char *str, char *pat);
int main(int argc, char **argv) {
return 0;
}
/* Removes any substring matching pat
* from str. */
void squeeze(char str[], char pat[]) {
int i, j;
for (i = 0; str[i]; i++) {
for (j = 0; pat[j]; j++) {
if (pat[j] != str[i + j])
b... | true |
76fad22c3b274a50c7fd97a70a2d861fdc677c9e | C | dd-harp/delay | /src/discretize.c | UTF-8 | 958 | 2.765625 | 3 | [] | no_license | /* --------------------------------------------------------------------------------
#
# Discretize continuous time output
# Sean Wu (slwu89@berkeley.edu)
# March 2020
#
-------------------------------------------------------------------------------- */
#include "discretize.h"
SEXP discretize_C(SEXP out, SEXP dt... | true |
65d4fd3ad9e60d5a21f3ed57fd3650703d3b0295 | C | somratcste/lab-assignment-C | /lab assignment 03/GCD.c | UTF-8 | 212 | 3.40625 | 3 | [] | no_license | #include<stdio.h>
void main()
{
int n,m,a,b,gcd;
printf("\n enter two numbers ");
scanf("%d %d",&a,&b);
n=a;
m=b;
while(n!=m)
{
if(n>m)
n=n-m;
else
m=m-n;
}
gcd=n;
printf("\n GCD of %d and %d is=%d",a,b,gcd);
}
| true |
b9ca971ff1f332d32fbbda036b697ac414a46ab4 | C | atztao/sos_flow | /examples/synthetic_1/worker.h | UTF-8 | 2,717 | 2.609375 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | #pragma once
#include "mpi.h"
#include "adios.h"
#include "util.h"
/* Global variables */
extern int commsize;
extern int myrank;
/* The main entry point for the worker */
int worker(int argc, char* argv[]);
/* The main computation for the worker */
int compute (int iteration);
/* make sure only rank 0 prints outp... | true |
04b8cf69afc117d4da3514fd5edcb00ab59f9338 | C | seagull1089/umn-assignments-code | /PC/Assignment2/data/generate.c | UTF-8 | 1,618 | 3.8125 | 4 | [] | no_license | /* Generate.c - Generates a given number of random values and stores them
* in the files small_test.txt, medium_test.txt, and large_test.txt
* DO NOT MODIFY THIS FILE. When I test your program I will use the same
* files generated by this program.
*
* Format of *_test.txt files are:
* N
* #1 #2 ... #N
*
* C... | true |
621953dec7f33d2f0aec381406490f3b5040f286 | C | RAMYAMURUGESH/ASSIGNMENT_C-PROGRAM | /largest_particular.c | UTF-8 | 500 | 4.25 | 4 | [] | no_license | //to find the largest among 'm' elements.
#include<stdio.h>
void main()
{
int a[20],n,m,i,j,t,b;
printf("ENTER THE TOTAL NO.OF.ARRAY ELEMENTS:\n");
scanf("%d",&n);
printf("ENTER THE ARRAY ELEMENTS:\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("ENTER THE m VALUE:\n");
scanf("%d",&m);
for(i=0;i<m;i++)... | true |
3edc8a63915a06c73b86fc49570cb32ac01e650f | C | Hazel-K/C_Basic | /04_Conditional/Practice02.c | UHC | 1,146 | 4.125 | 4 | [] | no_license | /*
Ȧ ¦ Ǻ
2 0̸ ¦, 1̸ Ȧ̴.
0 0 ͼ ¦ Ǻ, ¦ ָϴ!!
0 Է ߰ "0 ָؿ~!" !
[°]
Էּ : 0
ԷϽ 0() ¦Դϴ.
0 ָؿ~!
Էּ : 1
ԷϽ 1() ȦԴϴ.
*/
#include <stdio.h>
void main() {
/*int iV = 0;
printf(" Էּ : ");
scanf("%d", &iV);
if (iV == 0) {
printf("0 ָؿ~!\n");
} else {
switch (iV % 2)
{
case 0:
printf("ԷϽ 0() ¦Դϴ.\... | true |
c80a2bcc7fda3c299668b1abd19cb61a256943d8 | C | milk9111/tcss422hw1 | /priorityqueue.h | UTF-8 | 959 | 3.078125 | 3 | [] | no_license | /*
10/2/2017
Authors: Connor Lundberg, Gardner Gomes
In this assignment we are creating a PCB (Process Control Block), ReadyQueue, and
PriorityQueue. Each is made in sequence and then used to make the next one. The PCB
is being held within the ReadyQueue, and the PriorityQueue holds 16 ReadyQueues.
This is go... | true |
937a7a51c1c6d0013d0d82b6f93b7a1c72cfe404 | C | neoaggelos/sdl-test | /sdl_blit.c | UTF-8 | 536 | 2.625 | 3 | [] | no_license | #include <SDL/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main() {
SDL_Surface* screen;
SDL_Surface* image;
SDL_Rect src,dest;
assert (SDL_Init(SDL_INIT_VIDEO) == 0);
atexit(SDL_Quit);
screen=SDL_SetVideoMode(320,240,16,0);
image = SDL_LoadBMP("image.bmp");
assert(image!=NULL);
s... | true |
a0767737e60218ca4c7479879738686880538fda | C | 09o/PT_A | /exercise3-3/e3-3.c | UTF-8 | 305 | 3.328125 | 3 | [] | no_license | #include <stdio.h>
int main(void)
{
double mileage;
int time, cost;
scanf("%lf %d", &mileage, &time);
if ( mileage<=3 ) cost = 10;
else if ( mileage <= 10 ) cost = 10 + (mileage-3) * 2.0 + 0.5;
else cost = 10 + (10-3) * 2 + ( mileage-10) * 3.0 + 0.5;
printf("%d\n", cost+time/5*2);
return 0;
}
| true |
9430d888f7ae35daedd58ab825125b7b5b8aaad4 | C | liyisheng/MaNong | /20150112/count_word.c | UTF-8 | 465 | 3.625 | 4 | [] | no_license | #include<stdio.h>
#define N 100
#define IN 1
#define OUT 0
int main()
{
char a[N];
while(gets(a))
{
printf("%d\n",count_word(a));
}
return 0;
}
int count_word(const char a[])
{
int i,state,count = 0;
state = OUT;
for(i = 0; a[i] != '\0'; i++)
if(a[i] == ' ' || a[i] == '\t')
... | true |
b545ce45aec497400c6329b3cf9e81ea408e360b | C | UndefinedMamun/ProblemSolving | /URI/uri1131.c | ISO-8859-1 | 654 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int ig,gg,t,m=0,iv=0,gv=0;
while(1)
{
scanf("%d %d",&ig,&gg);
m++;
if(ig>gg)
iv++;
else if(ig<gg)
gv++;
printf("Novo grenal (1-sim 2-nao)\n");
scanf("%d",&t);
if(t!=1)
... | true |
39f35fcf64d883c3473688d9d8ac07fa54576c63 | C | camubg/tp-2016-1c-Chamba | /elestac/ProcesoCpu/src/PrimitivasAnSISOP.c | UTF-8 | 16,333 | 2.640625 | 3 | [] | no_license | /*
* PrimitivasAnSISOP.c
*
* Created on: 17/5/2016
* Author: utnso
*/
#include "PrimitivasAnSISOP.h"
#include <sockets/EscrituraLectura.h>
#include <sockets/OpsUtiles.h>
#include "ProcesoCpu.h"
#define TAMANIO_VARIABLE 4
extern t_log* ptrLog;
t_pcb* pcb;
void setPCB(t_pcb * pcbDeCPU) {
pcb = pcbDeCPU;
}
... | true |
295ac3f7246bf6f0c3a0b9fcaca89ecbe7e361b5 | C | xtreh/FitLabs | /lab5/sources/libs/arc/1print.h | UTF-8 | 1,618 | 3.28125 | 3 | [
"MIT"
] | permissive | #include "1hardest.h"
void printBin(FILE *fout, unsigned char *buff, char *cnt, unsigned char a) // Вывод бита
{
*cnt = (*cnt + 1) % 8;
*buff = *buff * 2 + a;
if (*cnt == 0) {
fwrite(buff, 1, 1, fout);
*buff = 0;
}
}
void printChar(FILE *fout, unsigned char *buff, char *cnt, unsigned char a) // Вывод стандар... | true |
38e4471faf5891f791251d6999ba44bc1c23bc1e | C | wmfgrey/Earth | /src/autoregressive.c | UTF-8 | 3,537 | 3.046875 | 3 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | /*
NAME: autoregressive.c
DESCRIPTION: Calculates AR coefficients for
a sequence of images in a time series.
AUTHOR: Will Grey
VERSION: 2015-11-22
LICENSE: This is free and unencumbered software
released into the public domain.
*/
#include "earth.h"
int autoregressive(int argc, ... | true |
38761a59fc7089e12c7273e4af4461b3ac0da269 | C | DrSiddharthaChoubey/cprograms | /shristi/loop/s6.c | UTF-8 | 807 | 3.59375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int main()
{
int i,p,j,sum,diff,n;
float div;
while(1)
{
printf("\t\t MENU");
printf("\n\t ADDITION");
printf("\n\t SUBSTRACTION");
printf("\n\t MULTIPLICATION");
printf("\n\t DIVISION");
printf("\n\t EXIT");
printf("\n enter any number");
scanf("%d",&n);
switch(n)
{
case 1:
printf... | true |
1c6f614f02c9daf9c9cc0a754d25ffa803ef25ab | C | pto/compiler | /ch01/retval.c | UTF-8 | 1,775 | 3.28125 | 3 | [] | no_license | // (c) 1992 Allen I. Holub
#include <stdio.h>
#include <ctype.h>
#include "lex.h"
#include "name.h"
#include "retval.h"
char *expression(void);
char *term(void);
char *factor(void);
void statements(void) {
// statements -> expression SEMICOLON | expression SEMICOLON statements
char *tempvar;
while (!m... | true |
b705344074e0563665a4c4650d9de37559fc2b92 | C | Ruben-van-Breda/C_LABS | /Lab 3/S3Q1.c | UTF-8 | 1,290 | 4.03125 | 4 | [] | no_license | #include <stdio.h>
/*
Write a C program which is used to keep track of the number of cars in the local multistory carpark.
The program should have four functions, one which is called when a car enters the carpark and one which is called when a car leaves the carpark.
It costs €5 to enter the carpark and a... | true |
7a9a37a595768191b0843b543d055263a95d295f | C | ruanpienaar/exercism | /teams/superbet/c/acronym/src/acronym.c | UTF-8 | 1,351 | 3.828125 | 4 | [
"MIT"
] | permissive | #include "acronym.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdbool.h>
char *concat(char *s1, const char *letter){
int size = strlen(s1)+1+1; //+1=letter, +1=null-terminator
char *result = strncat(s1, letter, size);
return result;
}
char *chartoupper(char l... | true |
98a532824c6b32bafb8d084d3054345bea0fee6c | C | abhishekori/USPlab | /USP/8.doc.c | UTF-8 | 507 | 2.609375 | 3 | [] | no_license | // VTUCS
/* Write a C/C++ program to avoid zombie process by forking twice. */
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<sys/wait.h>
int main(void)
{
pid_t pid;
if((pid=fork())<0)
{
printf("\n fork error");
}
else if(pid==0)
{
if((pid=fork())<0)
printf("fork error... | true |
31f2d82988ad55023657b9a45dc26fdab7a25a66 | C | MiguelVuori/INF1608-AnaliseNumerica | /simpson/main.c | UTF-8 | 1,137 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include "simpson.h"
#define Pi 3.141592653589793238462643383279502884197169399375105820974944592307816406286
double f1(double x)
{
return x/(sqrt(x * x + 9));
}
double f2(double x)
{
return exp((-(x*x))/2);
}
double f3(double x)
{
return exp(-(x*x));
}
int main ()
{... | true |
4f7195e7e28e53bff03158772ee406c9d2d431c0 | C | marvinborner/Melvix | /libs/libc/alloc.c | UTF-8 | 8,547 | 2.53125 | 3 | [
"MIT",
"Zlib",
"Unlicense"
] | permissive | // MIT License, Copyright (c) 2021 Marvin Borner
// Mostly by Durand Miller, released into public domain
#include <assert.h>
#include <mem.h>
#ifdef KERNEL
#include <mm.h>
static void *liballoc_alloc(u32 p)
{
return memory_alloc(virtual_kernel_dir(), p, MEMORY_CLEAR);
}
static int liballoc_free(void *ptr, u32 p)
... | true |
37c440ebf6e32f88e07be116548e820a67d43de0 | C | wizleysw/STORY_TELLER | /STORY_0x00/encode.c | UTF-8 | 329 | 2.875 | 3 | [] | no_license | #include<stdio.h>
int main()
{
FILE *fp = fopen("./Nymph\'s_fault", "r");
FILE *fp2 = fopen("./Nymph\'s_fault_encrypt", "w");
char ch, ch1, ch2;
fread(&ch, 1, 1, fp);
printf("%c",ch);
while(0 < fread(&ch1, 1, 1, fp))
{
printf("%c",ch1);
fputc(ch ^ ch1, fp2);
ch = ch1;
}
fclose(fp);
fclose(fp2);
ret... | true |
435dbb1015a7d92bef83971043abedc69110303c | C | tsegacmd/alx-low_level_programming-2 | /0x14-bit_manipulation/4-clear_bit.c | UTF-8 | 292 | 3.71875 | 4 | [] | no_license | /**
*clear_bit - sets the value of a bit to 0 at an index
*@n:pointer to no.
*@index:index
*Return:0(success), (-1),otherwise
*/
int clear_bit(unsigned long int *n, unsigned int index)
{
if (index > sizeof(unsigned long int) * 8)
return (-1);
*n = *n & ~(1 << index);
return (1);
}
| true |
d73c64674880800a2afd09026214cae7a903a48b | C | cnev/42printf | /src/ft_strrev.c | UTF-8 | 269 | 2.875 | 3 | [] | no_license | #include "../include/ft_printf.h"
#include "../libft/includes/libft.h"
char *ft_strrev(char *str)
{
int i;
int len;
char tmp;
i = -1;
len = strlen(str);
while (++i < --len)
{
tmp = str[i];
str[i] = str[len];
str[len] = tmp;
}
return (str);
}
| true |
dfbe4ba79a72fd392bebd7fec83441cd1914bcbb | C | HamzaTanjiCherkaoui/42-piscine | /d12/ex00/ft_display_file.c | UTF-8 | 1,566 | 3.140625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_display_file.c :+: :+: :+: ... | true |
b5da03bcd0d3e9757e1ee394b10c488861fce614 | C | tadryanom/nelsoncole_sirius | /user/xlib/gx/create_window.c | UTF-8 | 1,476 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | #include <gx.h>
#include <string.h>
#include <stdlib.h>
#include <sys/sys.h>
#define null 0
gx_hand_t *create_window (int x, int y, int w, int h, unsigned int style)
{
gx_hand_t *g = (gx_hand_t *)malloc(sizeof(gx_hand_t));
memset(g, 0, sizeof(gx_hand_t));
g->x = x;
g->y = y;
g->w = w;
g->h = h;
g->flag = ... | true |
b96a83300476e102f70ad06a13209fa52441f28d | C | amih90/azure-sdk-for-c | /sdk/core/core/test/cmocka/test_span.c | UTF-8 | 8,190 | 2.6875 | 3 | [
"LGPL-2.1-or-later",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LicenseRef-scancode-generic-cla"
] | permissive | // Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "az_test_definitions.h"
#include <az_result.h>
#include <az_span.h>
#include <az_span_private.h>
#include <limits.h>
#include <setjmp.h>
#include <stdarg.h>
#include <cmocka.h>
#include <_az_cfg.h>
/* void az_span... | true |
9af46b61adec6a58febd7fae5749f76cf4ddeed7 | C | bws7033/BradS | /input.c | UTF-8 | 245 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
int main(){
//standard input
//use 'scanf' to read an integer value (number)
printf("Enter a number: ");
int number;
scanf("%d", &number); //stdin --> number
printf("You have entered %d\n", number);
} | true |
7a81b01eaa5ce2bc454c5f1e16ffe1cb35e12dbc | C | shrey121/PracticeCode | /programs/lzw_decom.c | UTF-8 | 2,160 | 3.140625 | 3 | [] | no_license | /*******************************************************************************
** C program for LZW Decompression **
** created by: Deepanshu Bhatia **
** Roll No. : 11-css-15 ... | true |
9d1ccf70f1429b98b28164d3e080ac2e738d1a83 | C | BoxHen/C_Cpp | /Ciphers/C/affine.c | UTF-8 | 981 | 3.890625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main(int argc, char *argv[]){
//affine cipher : (ax + b) mod26
int shift = 0, mult = 1, ch, letter; // take in ch as an int so we can do operations on it
if(argc>1) shift = atoi(argv[1]); // we put shift first since if we dont want to use affine then ... | true |
dcf047ae381ab3ec4504b42df86443ed8d41af9f | C | nerva-project/nodefinder | /External/c-syn-scan-network/syn-scan-network.c | UTF-8 | 12,999 | 2.640625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | /*
* Title: Syn Scan Network
* Description: Scan if some ports are open by sending SYN packets to all IP(s) in a network
* Date: 24-Apr-2018
* Author: William Chanrico
* Git: https://github.com/williamchanrico/c-syn-scan-network
*/
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#inc... | true |
44469a357a45fd655790dbad5ee704f64a24e357 | C | roboirc/lundftpd | /eyot/blowfish.c | UTF-8 | 5,851 | 2.578125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /**
** This source file is lifted directly from the FiSH project.
** I'm not happy having to use this, as not only are we linked
** against libcrypto, but lion has base64. But for some reason
** they went with non-standard functions for this.
**/
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include "blowfish.h... | true |
8da8fdd18406a454f3c3f6d62076c2dfc3ed4626 | C | MwansaSika/Homework-2 | /Homework/Homework2Q1.c | UTF-8 | 533 | 3.34375 | 3 | [] | no_license |
#include <stdio.h>//(Chp02: #4)
int main() {
//variables,calculation
float mealCost = 88.67;
float tax = mealCost * 0.0675; //calc. tax @ 6.75%
float subTotal = mealCost + tax; //calc meal incl.tax
float tip = subTotal * 0.20;//calc tip,giving subtotal
float finalTotal = subTotal + tip;//final cost... | true |
edb488bfa25703ebe63b868f4704d96b992ec9bc | C | jimmyyukio/Microsoft_visual_studio_files | /mis系统(图书管理系统)/mis.c | GB18030 | 365 | 2.53125 | 3 | [] | no_license | # include<stdio.h>
# include"head.h"
# include<stdlib.h>
Puser creatuser();
PStack creatstack();
void putmenu_one(Puser);
void putmenu_two(Puser , PStack);
int main(void)
{
Puser one = creatuser();//û
PStack two = creatstack();//
putmenu_one(one);//һ¼
putmenu_two(one,two);//ڶѡִв
return 0;
} | true |
039d7492ff32d7d99b21c10cd4692856e1973d23 | C | indaram/SO1 | /Lecture/02_DataTypes/04-03_Input_Circle/circle.c | UTF-8 | 550 | 3.765625 | 4 | [] | no_license | /*
Read floating point numbers from the keyboard.
Lecture: IE-B1-SO1 (Software construction 1)
Author: Marc Hensel
*/
#define _CRT_SECURE_NO_DEPRECATE // Else MSVC++ prevents using scanf() (concern: buffer overflow)
#include <stdio.h>
int main(void) {
float radius, pi = 3.141592;
printf("Please enter a radius: ");... | true |
c1b1226036b31554e5ec2488a66787f678af2e73 | C | Rukopet/minishell | /parser/check_char.c | UTF-8 | 1,966 | 2.8125 | 3 | [] | no_license | #include "header.h"
int check_back_slash(char *cur_arg, t_pars *pa, int i)
{
if (cur_arg[1 + i] == 0)
return (write_error(MULTI_LINE_COMMAND, pa->s));
if (pa->quot_flag == 0)
cur_arg[i] = EMPTY_BACK_SLASH;
if (pa->quot_flag == 1)
{
if (cur_arg[i + 1] == '$')
cur_arg[i] = EMPTY_BACK_SLASH;
}
if (cur_arg[... | true |
b6c0116d9308b67b2b2b5ad3fd36307fb5339e29 | C | xThaid/mimiker | /sys/tests/taskqueue.c | UTF-8 | 763 | 2.71875 | 3 | [] | permissive | #include <sys/klog.h>
#include <sys/libkern.h>
#include <sys/ktest.h>
#include <sys/malloc.h>
#include <sys/taskqueue.h>
static unsigned counter;
static void func(void *arg) {
int n = *(int *)arg;
/* Access to counter is intentionally not synchronized. */
counter += n;
}
static int test_taskqueue(void) {
tas... | true |
b6db5fce509a5342f194167d85ee997b6b86c754 | C | rjbaw/picoctf | /binary_exploitation/c/pointer2var.c | UTF-8 | 2,969 | 4.15625 | 4 | [] | no_license | #include <stdio.h>
// a bit of revision
int main() {
char c = 'S';
char *p; //pointer to char
p = &c;
printf("\n char c = 'S' \n char *p \n p = &c");
printf("\n {c} value of char c: %c ", c);
printf("\n {&c} address of char c: %d ", &c);
printf("\n {p} address which pointer p is pointing at -> address of ... | true |
a718d1d6181e346c1c4501afdc475a29d8a18eb2 | C | ahmedhamdy0/C | /Assignment_3/5/main.c | UTF-8 | 712 | 4.375 | 4 | [] | no_license | /*
(5) Write a C function to return the index of FIRST occurrence of a number in a given array.
Array index start from 0.
If the item is not in the list return -1.
(Linear Search Algorithm)
Example:
Array = {1,2,3,4,4,4}
The required number is 4 it should return 3
*/
#define SIZE 6
#incl... | true |
a342f6db93dacbfac9d54544ed4c801c6eb0d68f | C | grypesc/C-database | /zapis_odczyt.c | UTF-8 | 3,608 | 2.875 | 3 | [
"MIT"
] | permissive | #include "zapis_odczyt.h"
#include "main.h"
#include "edycja.h"
#include "sortowanie.h"
int wczytaj_baze(char nazwa_pliku[])
{
FILE *f=fopen(nazwa_pliku,"r");
if (f==NULL) return -1;
char pom;
int i=0, poziom=1;
liczba_wierszy_bazy=1;
poczatek = malloc(sizeof(struct t_pole_listy));
struct t_pole... | true |
60c973381418deed93f94fbe5f674d420e22a90f | C | PDP-10/sri-nic | /files/fs/kcc-6/lib/math/modf.c | UTF-8 | 2,462 | 3.109375 | 3 | [] | no_license | /*
** MODF.C - split floating point number into int and fractional parts
**
** (c) Copyright Ken Harrenstien 1989
**
** This code does NOT conform to the description of the modf function
** as defined in Harbison and Steele's "C: A Reference Manual",
** section 11.3.18. H&S is wrong in saying that the
** 2nd arg to "m... | true |
3b87482e653f0abc73b1cefe9f6231abc8520044 | C | titetil/hp-bldc-code | /src/T_Link/DSFxp/TAN_09.c | UTF-8 | 1,806 | 2.734375 | 3 | [] | no_license | /**
* @file tan_09.c
* @brief tangent
*
* @since 2003-07-17
* @author D. Andoleit
*
* Copyright (c) 2003 by dSPACE GmbH, Paderborn, Germany
* All Rights Reserved
*
*/
/*
* $Workfile: TAN_09.c $
* $Revision: 4 $
* $Date: 28.10.03 14:34 $
*/
#include "dsfxp.h"
/**********************... | true |
be12a7b1ac241fdea8850bc5fff55b9d758bfc25 | C | Manteg-Singh/Let-Us-C-Practice | /Fibonacci.c | UTF-8 | 400 | 2.90625 | 3 | [] | no_license |
#include <stdio.h>
void fibo(int, int,int);
void fibo(int x, int y,int n)
{
int c;
//static int n = 3;
if (n <= 24)
{
if (x == 1 && y == 1)
{
printf("%d %d", x, y);
}
printf(" %d ", x + y);
n++;
fibo(y, x + y,n);
;
}
else
... | true |
8abc05c362bd496ebad8979996fe9e1cb71ee148 | C | bujocek/pdf-to-text | /pdfToText/mainpage.h | UTF-8 | 1,128 | 2.71875 | 3 | [] | no_license | /** @mainpage pdfToText documentation
*
* @author Jonas Bujok (bujon(at)centrum.cz)
*
* @section intro Introduction
* This is documentation for pdfToText program for extractin text information from pdf files.
* I hope this documentation will provide enough information to understand all classes and it's purpouse.
* <b... | true |
17784131dc599b3ccc76059b29d4b5888abe181f | C | alvinvin7/teaching | /week3/diagonal.c | UTF-8 | 540 | 3.4375 | 3 | [] | no_license |
// W3Q9
// Alvin Fujito
#include <stdio.h>
int main (void) {
int size;
printf("Enter size: ");
scanf("%d", &size);
int row = 1;
while (row <= size) {
int col = 1;
while (col <= size) {
if (col == row) {
pri... | true |
af0520431cc4abbfdc436f7ea12edd70c8590a8f | C | DarcyChang/ProgrammingExercise | /C/DataStructure_Tsai/Chap10/Sort_sl.c | BIG5 | 1,003 | 4.15625 | 4 | [] | no_license | /* ܱƧ */
#include <stdio.h>
void select_sort(int[], int);
void main()
{
int data[20];
int size = 0, i;
/* nDJƪJs */
printf("\nPlease enter number to sort ( enter 0 when end ):\n");
printf("Number : ");
do
{
scanf("%d", &data[size]);
} while(data[size++] != 0);
for(i = 0; i < 60; i++) printf("-... | true |
9d34ce273126b486843b9fd4e2c1c02948ddcb00 | C | isabella232/AnghaBench | /source/freebsd/sys/cam/extr_cam_queue.c_heap_down.c | UTF-8 | 1,079 | 2.6875 | 3 | [] | no_license | #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... | true |
6285f324f00587fffd00dc256d069b2cbcf5cf8c | C | liuziwendave/COMP1511-Lecture | /Lecture/Decision/number_letter1.c | UTF-8 | 1,949 | 3.875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void get_number(void);
void process_num(int x);
int main(int argc,char **argv){
get_number();
return EXIT_SUCCESS;
}
void get_number(void){
int num;
printf("Input a 2-digits number: ");
scanf("%d", &num);
process_num(num);
}
void process_num(int x){
int ten... | true |
b175898bd59c2abb10479d11e0c601b641ed74a5 | C | CristianaCostaPereira/C | /Modulo 3/prog0301.c | UTF-8 | 458 | 4.125 | 4 | [] | no_license | #include <stdio.h>
main()
{
int x, y;
printf("Introduza dois inteiros: ");
scanf("%d%d", &x, &y);
printf("O resultado de %d == %d : %d\n", x, y, x==y);
printf("O resultado de %d > %d : %d\n", x, y, x>y);
printf("O resultado de %d >= %d : %d\n", x, y, x>=y);
printf("O resultado de %d < %d ... | true |
1431086d87305bc05db2ad9cd462c36832695d5c | C | thearst3rd/chesslib | /src/tests.c | UTF-8 | 40,231 | 2.78125 | 3 | [
"MIT"
] | permissive | /*
* Testing for Chess implementation in C
* Created by thearst3rd on 8/6/2020
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tests.h"
#include "chesslib/squareset.h"
#include "chesslib/movelist.h"
#include "chesslib/board.h"
#include "chesslib/piecemoves.h"
#include "chesslib/boardlist.h"... | true |
0a4f4fb2ea75a4352e5b78b4b53c6361c272e0ed | C | SuperLazyDog/Learning-C | /Basic Review/Basic Review/Data struct and Algorithm/S3 連結リスト/S3_List.c | UTF-8 | 11,416 | 3.703125 | 4 | [] | no_license | //
// S3_List.c
// Basic Review
//
// Created by 徐伟达 on 2017/12/26.
// Copyright © 2017年 徐伟达. All rights reserved.
//
#include "S3_List.h"
//---------------------------------------------------------------------
// 3.6 单向链表 p40
//-------------------------------------------------------------... | true |
59817ed1e0989373ce9dc55ee70b7411ea937327 | C | pdespres/fillit | /input.c | UTF-8 | 2,631 | 2.671875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* input.c :+: :+: :+: ... | true |
02f49c0d859837647ddd66dec2bef1613b8848b8 | C | AugustinLopez/libft | /srcs/printf/ftoa/f_free_precision.c | UTF-8 | 1,928 | 2.734375 | 3 | [
"MIT"
] | permissive | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* f_free_precision.c :+: :+: :+: ... | true |
bd2760b84f278b2039385f6a4583da1e659155ed | C | deardeng/learning | /new/brk_sbrk.c | UTF-8 | 485 | 3 | 3 | [] | no_license | #include<stdio.h>
#include<unistd.h>
int brk(void *);
void* sbrk(int);
int isPrime(int a){
int i;
for(i=2;i<a;i++)
if(a%i==0)
return -1;
return 0;
}
int main(){
int i;
int *r;
int *p;
p=(int *)sbrk(0);
r=p;
for(i=2;i<1000;i++)
if(!isPrime(i)){
... | true |
e057484b0b41d6feb168d24f13a8104d07e0f5b4 | C | johnny-keker/system-programming-languages | /lab4/main.c | UTF-8 | 2,654 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <getopt.h>
#include <limits.h>
#include <stdbool.h>
#include <time.h>
#include "linked_list.h"
#define FLAG_FILE 1
int main(int argc, char *argv[]) {
// Checking flags section
int flags = 0, opt = 0;
char* file = NULL;
while ((opt = getopt(argc, argv, "f:")) != -1) {
switch (opt... | true |
7fc5625c85d5f3e05532fc56617571cae534004a | C | doughty-liam/Tic-Tac-Toe | /displayGameNew.c | UTF-8 | 582 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ROWS 3
#define COLUMNS 3
int displayGameNew( char boardNew[3][3] ) {
system( "clear" );
int i = 0;
int j = 0;
for( i = 0; i < ROWS; ++i ) {
for( j = 0; j < COLUMNS; ++j ) {
printf( " %c ", boardNe... | true |
cc57d168a92bd8a29b77df88ff57d061ba54b73e | C | GabrielJusto/T3_Lab_Sisop_Escalonamento | /setpriority.c | UTF-8 | 2,644 | 3.296875 | 3 | [] | no_license | #include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <linux/sched.h>
char* buffer = NULL;
int bufferIndex = 0;
int bufferSize = 0;
int nThreads = 0;
int running = 0;
pthread_mutex_t mutex;
void *run(void *data)
{
/*Garante que todas as threads comecem ao mes... | true |
e18f529269bb3fa35b6fd52d1cfe0e923dd4f6ee | C | bbenzikry/SafetyPin | /host/params.c | UTF-8 | 5,237 | 2.6875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <stdlib.h>
#include <string.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/sha.h>
#include <openssl/rand.h>
#include "common.h"
#include "params.h"
#include "datacenter.h"
/* Basic cryptographic parameters and wrappers around primitives. */
int min(int a, int b);
inline int min (in... | true |
43ce9501dfdc638e09c01aaac5e52afcc6c576f5 | C | soohunee/Multiplex-Reservation | /Reservation system.c | UHC | 30,454 | 3.4375 | 3 | [] | no_license | #pragma warning(disable: 4996)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define MAX 1000
int cnt = 0;
typedef enum { false, true } bool;
typedef struct Node { //node
int rsvNum;
int rsvDate;
int rsvTime;
int rsvMovie;
int rsvSeat;
char payCard;
char color... | true |
4df183e249f9c3464ad11cc95296219a3e56a7a0 | C | vongdarakia/ft_db | /src/free.c | UTF-8 | 1,790 | 2.6875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free.c :+: :+: :+: ... | true |
9cf7ae72e190d82df17f636b85da0c0ed0cfb7dd | C | woodrush/lambda-8cc | /examples/rot13.c | UTF-8 | 522 | 3.6875 | 4 | [
"MIT"
] | permissive | // rot13.c: Encodes/decodes standard input to/from the ROT13 cipher
#define EOF -1
int putchar(int c);
char getchar(void);
char c;
int offset;
int main (void) {
for (;;) {
c = getchar();
if (c == EOF) {
break;
}
offset = 0;
if (('a' <= c && c < 'n') || ('A' <... | true |
c5984c245e6cea0662fe62bbb51d77bc5886bfb1 | C | CyanogenMod/android_development | /simulator/wrapsim/SysPower.c | UTF-8 | 3,044 | 2.75 | 3 | [] | no_license | /*
* Copyright 2009 The Android Open Source Project
*
* Magic entries in /sys/power/.
*/
#include "Common.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/*
* Map filename to device index.
*
* [ not using DeviceIndex -- would be useful if we need to return something
* other than a static string ... | true |
926587a52487f637b3524166327d3e4b00b8d247 | C | Viditjn/Ds-Codes | /assg5/lexo4.c | UTF-8 | 2,138 | 3.453125 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct node {
int data;
struct node* link;
}node;
node* list[27];
int visited[27],ans=0,flag[27];
void push(node** head,int dat)
{
node* temp =(node*)malloc(sizeof(node));
temp->data=dat;
temp->link=*head;
*head=temp;
return;
}
void print(nod... | true |
4af6c16c380df90fc95a55a58847e73709f657b6 | C | jdao913/CS575 | /project3/grain_sim.c | UTF-8 | 6,858 | 2.859375 | 3 | [] | no_license | #include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <omp.h>
#include <string.h>
#include <sys/sysinfo.h>
unsigned int seed = 0;
int NowYear; // 2020 - 2025
int NowMonth; // 0 - 11
float NowPrecip; // inches of rain per month
float NowTemp; // temperature this month
float NowH... | true |