blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 4 124 | path stringlengths 2 969 | src_encoding stringclasses 35
values | length_bytes int64 6 2.95M | score float64 2.52 5.44 | int_score int64 3 5 | detected_licenses listlengths 0 58 | license_type stringclasses 2
values | text stringlengths 9 2.95M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
308f265976cbca94c4c869b0bd8b784b19d23475 | C | easyli/OpenJudgeC | /1w/4.c | UTF-8 | 136 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
int main(void)
{
char c;
int x;
scanf("%d",&x);
c=(char)x;
printf("%c",c);
return 0;
} | true |
90d1046420b7b6e4b89aa4c75933e740efeddb22 | C | CurlyWurly-1/STM8S103F3P6-development-board | /CODE/ZST_Workspace_FOLDER/main_adc_test.c | UTF-8 | 3,606 | 3 | 3 | [] | no_license | // reads value on ADC channel 2, which is AIN2 on Pin PC4 (pin 14)
// and send it via UART
#include "stm8s.h"
#include "stdafx.h"
#define WITH_UART_EXP 1
char count = 0;
char digit[5] = "";
int main( void ){
uint16_t i; // Always use standardized variable types...
uint16_t nCount = 0;... | true |
801c1a4669f1f3e81b1d6034b265247b97e8d634 | C | avue7/551 | /p2b/tmin_backup.c | UTF-8 | 7,938 | 3.390625 | 3 | [] | no_license | /**
* @file tmin.c
*
* @brief
* This program performs a numerical integration using the
* Trapezoidal Method. The upper and lower bound is accepted
* as the inputs and t to represent the minimum trapezoids
* need in order to be as accurate as we can to 14 significant
* figures of the true value of ... | true |
1f86ce04e4971db82373e3ea30dd71699f8047f4 | C | karinepcdc/search-algorithms | /includes/searching.h | UTF-8 | 1,185 | 2.765625 | 3 | [] | no_license | #ifndef SEARCHING_H
#define SEARCHING_H
//=== Alias
using value_type = long int ; //!< Simple alias to help code maintenance.
// iterative linear search
const value_type * lsearch( const value_type *, const value_type *, value_type);
// iterative binary search
const value_type * bsearch_it( const value_type *, const... | true |
c66f4c38a315bb59b84c3b8c016d6eae3fecdb31 | C | mgpsp/LCOM-FEUP | /lab2/lab2.c | UTF-8 | 2,169 | 3.015625 | 3 | [] | no_license | #include <minix/drivers.h>
#include "timer.h"
static int proc_args(int argc, char *argv[]);
static unsigned long parse_ulong(char *str, int base);
static void print_usage(char *argv[]);
int main(int argc, char **argv)
{
/* Initialize service */
sef_startup();
if (argc == 1)
{
print_usage(argv);
return 0;
... | true |
233c30b8a27a8cb92c7c0afe7a6c7c5c3eab6cac | C | angadgill/antenna_analyzer | /psoc/antenna_analyzer.cydsn/main.c | UTF-8 | 6,003 | 2.8125 | 3 | [
"MIT"
] | permissive | #include <project.h>
#define HIGH 1u
#define LOW 0u
#define FREQ_SCALE 4294967295/125000000
#include "stdio.h"
#define RX_LEN 20
#define ERR_MSG ": invalid input_str. Type 'help' to see available input_strs\r\n"
#define CMD_LEN 4
#define OPTION_LEN 4
#define NUM_LEN 15
const char help_message[] =
"\r\nHi! This is... | true |
bc49c450f97c151945bf3e2218b6943f501d9b39 | C | mritunjay7065/StartingWithDSA | /Assignment 1.c | UTF-8 | 2,052 | 3.78125 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct BST
{
int data;
struct BST *left;
struct BST *right;
};
typedef struct BST node;
node * insertintoBST(node *root,int key) ///OK
{
node *temp,*curr,*p;
temp=(node*)malloc(sizeof(node));
temp->data=key;
temp->left=temp->right=NULL;
if(root==NULL)
... | true |
e09340b5f35c5f1384ddbc49ac7902336292e326 | C | 0pankajkumar/LearningCCPP | /InfixToPostfix.c | UTF-8 | 612 | 3.34375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
int main()
{
char *p = "3+5/9";
char *cur = p;
char *cur2 = p;
while(*cur)
{
//printf("%c",*cur);
if((*cur) == '/' || (*cur) == '*')
{
}
else if(*cur == '+' || *cur == '-')
{
*cur = 's';... | true |
f92b915dd2838eb2009eec6f8427caab6f8c2c53 | C | handoso/C-Programming | /Fall Season/lab9-2.c | UTF-8 | 476 | 3.296875 | 3 | [] | no_license | #include<stdio.h>
#define pr printf
#define sc scanf
void read(int a[], int n){
int i;
for (i = 0; i < n; i++)
sc("%d", &a[i]);
}
void print(int a[], int n){
int i=0;
for(i; i<n; i++){
pr("%d ", a[i]);
}
}
main(){
int a[100],b[100],n,m;
pr("a array: "); sc("%d",&n);
pr... | true |
a7c2377f914f1952ba3d8eb1d9ddc7bb4fbd948d | C | robert-hrusecky/initrdtest | /main.c | UTF-8 | 649 | 2.53125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
/* Import user configuration: */
#include <uk/config.h>
#include <uk/plat/memory.h>
#include <uk/hexdump.h>
#include <uk/alloc.h>
#include <dirent.h>
int main()
{
DIR *dr = opendir("/");
struct dirent *de;
whi... | true |
3e2da9a1a475e1e70fe80e7134f64db4fd45821b | C | tantalu/onlinejudge | /hduoj/hdu1410.c | GB18030 | 640 | 2.890625 | 3 | [] | no_license | // P(w:lʤ) = P(w:0) + P(w:1) + ... + 1/2P(w:l)
// = P(w-1:0) + P(w-1:1) + ... + P(w-1:l)
// WA Ҳ
#include<math.h>
#include<stdio.h>
int main(void)
{
int hp1, hp2, ap1, ap2;
double res, lgcom;
int w, l, s;
int i;
while (scanf("%d%d%d%d", &hp1, &hp2, &ap1, &ap2) !=EOF)
{
w = (hp2-1) / ap1 + 1;
l =... | true |
5431259396bbc40737ac17fb8d2f5a408d1bf473 | C | kangyechan/OSS_Practice | /OSS_project/Occupation_Search_System/OSS.c | UTF-8 | 14,371 | 3.453125 | 3 | [] | no_license | #include "json.h"
void printCompanies(Company *companies, int count) {
char *sizeToStr;
printf("\n*********************** Companies *************************\n");
for (int i = 0; i < count; i++) {
if (companies[i].size == 1)
sizeToStr = "Large";
else if (companies[i].size == 2)
... | true |
d93189f15cad20781b06f562974a3c448543aa06 | C | driftluo/LearningC | /The_C_Programing_Language/Chapter_2/exercise_2.6.c | UTF-8 | 724 | 4 | 4 | [] | no_license | #include <stdio.h>
/*
Write a function setbits(x,p,n,y) that returns x with the n bits that begin at
position p set to the rightmost n bits of y , leaving the other bits unchanged.
*/
unsigned getbits(unsigned x, int p, int n);
unsigned setbits(unsigned x, int p, int n, unsigned y);
void main() {
unsigned... | true |
97b88b54328b996004c3cb0d406d26d94bd2ea84 | C | kate-levoshko/Kate-repos | /courses/prog_base_2/labs/lab1/test.c | UTF-8 | 2,865 | 2.859375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include "header.h"
static void createNewHeap_emptyHeap_zeroCount(void ** state){
heap_t * heap1 = heap_new(5);
assert_null(heap_amountOfObjects(he... | true |
fa500065c63db614f878e99e6380857caab7b8a5 | C | BHARATHIJOTHI/c-program | /bubblu/add.c | UTF-8 | 157 | 3.09375 | 3 | [] | no_license | #include<stdio.h>
void main()
{
int a;
printf("enter the num");
scanf("%d",&a);
if(a<0)
printf("the num is negative");
else
printf("the num is positive");
}
| true |
43adcb455d43cf0505e04d25e788826061404f6b | C | MentalBlood/twm | /workArea.c | UTF-8 | 669 | 2.53125 | 3 | [] | no_license | typedef struct {
int x, y;
int width, height;
} WorkAreaData;
WorkAreaData* getWorkAreaData() {
WorkAreaData **workAreaData = (WorkAreaData**)malloc(sizeof(WorkAreaData*));
*workAreaData = (WorkAreaData*)malloc(sizeof(WorkAreaData));
RECT workAreaSystemData;
SystemParametersInfo(SPI_... | true |
de914aa1f9608299c6f4ae83fec27716936ef7e3 | C | LihuaZhao/vx.vim | /templates/skeleton.c | UTF-8 | 2,789 | 2.59375 | 3 | [] | no_license | /** \file \brief fooLib.c - foo function library */
/**
* \internal \copyright
*
* Copyright (c) 2019 Wind River Systems, Inc.
*
* The right to copy, distribute, modify, or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/**
*
\inter... | true |
073683dae517da93935a227051efe91395cfa805 | C | IdarV/PG3400_C | /school/f06/lec5/exercise01.c | UTF-8 | 242 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
void increase_std(){
static int svalue = 1;
printf("svalue: %d\n", svalue++);
printf("HE");
}
int main(int argc, char *argv[]){
for(int i = 0; i < 5; i++){
increase_std();
}
return 0;
}
| true |
39d11045c00199afd13f51a0d240e44b986bcb55 | C | GGunnison/LED-Cube | /USART/firmware/main.c | UTF-8 | 1,702 | 3.015625 | 3 | [] | no_license | /* Name: main.c
* Author: <insert your name here>
* Copyright: <insert your copyright message here>
* License: <insert your license reference here>
*/
#include <avr/io.h>
// #include "USARTInit.h"
#include <avr/interrupt.h>
#include <util/delay.h>
#define bit_set(p,m) ((p) |= (m));
#define bit_flip(p,m) ((p) ^=... | true |
f0068a140f91688d772b52a65d7fda79abbedb43 | C | Coggroach/Quarks | /Control/Shapes.h | UTF-8 | 413 | 2.640625 | 3 | [] | no_license | #ifndef SHAPES_H
#define SHAPES_H
#include "Colour.h"
typedef struct Point
{
unsigned short x, y;
} Point;
typedef struct Rect
{
unsigned short x, y;
unsigned short width, height;
} Rect;
typedef struct Circle
{
unsigned short x, y;
unsigned short radius;
} Circle;
unsigned short doesRectContainPoint(Rect re... | true |
cb9ad36bf040e4b201c724cec11b905929387cb4 | C | githuanghaining/device_src | /src/traceroute/ly_trace.h | GB18030 | 636 | 2.53125 | 3 | [] | no_license | #ifndef _LY_TRACE_H
#define _LY_TRACE_H
#define MAX_IP_ADDR 50
#define MAX_DOMAIN 150
#define PROBE_NUMBER 3
typedef struct route_info{
int ttl; //
char domain[PROBE_NUMBER][MAX_DOMAIN]; //
char ip[PROBE_NUMBER][MAX_IP_ADDR]; //IPַ
int time[PROBE_NUMBER]; //ÿ̽ʱ䣬λ
... | true |
74dc2a142eb8dfc79d9abe43c93e5ce07582bbf4 | C | aakidev/c-programming | /msub.c | UTF-8 | 1,187 | 3.171875 | 3 | [] | no_license | #include<stdio.h>
#define r 2
#define c 3
int main()
{
int i,j;
int a[r][c];
int b[r][c];
int t[r][c];
printf("enter first matrix:\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("enter second matrix:\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
... | true |
d1dc0446947628d2e960e1410dd12ea08814f7bd | C | monoflop/USBNameTagLEDTool | /src/main.c | UTF-8 | 6,847 | 2.78125 | 3 | [] | no_license | /*******************************************************
LEDTool
Alternative tool to upload messages to the VADIV LED Nametag
Device 12x48 (VID:0x483, PID:0x5750)
STMicroelectronics 0STM32 Composite MSC+HID
Philipp Kutsch
********************************************************/
#include <stdio.h>
#include <stdl... | true |
880b1bdc881280c8fbf1704862183478dc457629 | C | syedqaisar/Data_Structure | /linklist Data Structure/Array/insert.c | UTF-8 | 1,338 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n, i, *ptr, update, entry, j, num, x;
int a[3];
ptr = a;
printf("how many number yoou want in array:");
scanf("%d", &n);
ptr = (int *)calloc(n, sizeof(int));
int size = sizeof(a);
printf("%d", size);
// for (i = 0; i... | true |
4631b740d1a19b0d243b61d283d6da42c7de6186 | C | IyaneG10/Moteur-de-workflows-en-C | /AJAC_S8/Socket/libsck.c | UTF-8 | 3,626 | 3.015625 | 3 | [] | no_license | /**
* @file libsck.c
* @brief
* @version 0.1
* @date 2020-01-30
*
* @copyright Copyright (c) 2020
*
*/
/* Fichier d'inclusion */
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <stddef.h>
#include <fcntl.h>
#include <errno.h>
#include <netdb.h>
#include <string.h>
#i... | true |
0f26f19cc036611e8d65aa7a7fbfed3e5779e90f | C | isabella232/AnghaBench | /source/robotjs/src/extr_str_io.c_createMMBitmapFromString.c | UTF-8 | 2,371 | 2.578125 | 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 |
e75d5097b14096ea661e5c911f9925e21075027c | C | enzorossetto/uri-online-judge-problems | /c/1581.c | UTF-8 | 1,031 | 3.53125 | 4 | [] | no_license | #include <stdio.h> //Bibliotecas utilizadas
#include <stdlib.h>
#include <string.h>
int main()
{
char L[100][21]; //Matriz para receber os idiomas falados por cada pessoa
int k, n; //Variáveis para recebimento de quantias
scanf("%i", &n); //Recebe quantos casos
for (int i = 0; i < n; i++)
{... | true |
d8a08d36b7d902bf55a83871e45b227318c2ed29 | C | ihavec/JsonRPC_c | /block.c | UTF-8 | 1,499 | 2.96875 | 3 | [] | no_license | #include <string.h>
#include <math.h>
#include <stdlib.h>
#include "block.h"
block_t * block_Alloc( size_t i_size )
{
block_t *p_block = malloc( sizeof(block_t) );
if ( !p_block )
return NULL;
size_t i_max = ceil( i_size * 1.0 / 4096 ) * 4096;
p_block->p_buffer = malloc( i_max );
if ( !p_b... | true |
9bdc055ffa2681bb41d94316920fedca02071c63 | C | nhegde610/c_programs | /posorneg.c | UTF-8 | 280 | 3.875 | 4 | [] | no_license | #include<stdio.h>
int main(){
int num;
printf("enter a number to determine if it is positive or negative:");
scanf("%d",&num);
if (num < 0)
printf("The number is negative\n");
else
{
printf("The number is positive\n");
}
return 0;
} | true |
c690cc819a801c6e23eefd1d9c4ac4de420997e4 | C | kuller416/matrix | /proga.c | UTF-8 | 2,924 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
/* m - line , n - pillars */
int m, n;
int x, z; /* SCH */
int mem;
int min;
int xmin;
int zmin;
int o;
int p;
min = 150;
srand(time(NULL));
m = rand() % 10 + 3;
n = rand() % 10 + ... | true |
aeaf6cb626ae21ce882e3acfd31ae3118f70e340 | C | Emile442/Epitech | /Tek1/C_Pool/Rush-2/rush2.c | UTF-8 | 2,245 | 3.21875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2018
** rush2
** File description:
** Rush 2 Detect Lang
*/
#include "my.h"
#include "rush.h"
int count_alpha(const char *str);
int count_letter(const char *str, char c)
{
int counter = 0;
char *tmp = str;
tmp = my_strlowcase(tmp);
if (c >= 65 && c <= 90)
c = c + 32;
... | true |
aad8a2ce52671e47e2b83c31ec536488c51b4a96 | C | sbenning42/42 | /proj/42sh/srcs/exec/exec_sep.c | UTF-8 | 1,388 | 2.578125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* exec_sep.c :+: :+: :+: ... | true |
a7bdc2447de4a2aac3dfca39cd4a24a4a85c6654 | C | DvGentoo/StudentWorks | /Algorithms/Bubble Sort/Bubble sort.c | UTF-8 | 573 | 3.84375 | 4 | [] | no_license | #include <stdio.h>
int bubbleSort(int arr[], int sizeArr);
int main()
{
int array[] = {2,6,7,8,1,9};
int sizeArray = sizeof(array) / sizeof(int);
bubbleSort(array,sizeArray);
return 0;
}
int bubbleSort(int arr[], int sizeArr)
{
int result = 1;
while(result)
{
result = 0;
... | true |
bc7c4e246e2376ed995740f3f22a3a4f0286c254 | C | Takanashi-Rikka-O/C | /C/Linux_C/PIPE/pipe2.c | UTF-8 | 889 | 3.125 | 3 | [] | no_license | #include<unistd.h>
#include<sys/types.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
int main(void)
{
int data_processed;
int file_pipes[2];
const char some_data[]="123";
char buffer[BUFSIZ+1];
pid_t fork_result;
memset(buffer,'\0',sizeof(buffer));
if (pipe(file_pipes) == 0)
{
fork_result=fork(... | true |
2727cc69503c4d5012f675915f0d5adc34a19c16 | C | mohanlalyadav222/Basic-Beginners-Code-C-Language | /a5.c | UTF-8 | 293 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
/*Print Fahrenheit-Celsius table
for fahr=0,20,40....300*/
int main(){
int fahr,celsius,lower,upper,step;
lower=0;//lower limit
upper=300;//upper limit
step=20;
while(fahr<=upper){
celsius=5*(fahr-32)/9;
printf("%d\t %d\n",fahr,celsius);
fahr=fahr+step;
}
}
| true |
c6a5704c299f07063d98ca3af644fea2d309d360 | C | choijam/BOJ | /3943.c | UTF-8 | 335 | 3.28125 | 3 | [] | no_license | #include <stdio.h>
int max;
int hailstone(int n){
if(max<=n)
max=n;
if(n%2==0)
hailstone(n/2);
else if(n%2==1&&n!=1)
hailstone(n*3+1);
else if(n==1)
return max;
}
int main()
{
int t;
int n,result;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
max=n;
printf("%d\n",hailstone(n));
max=0;
}
... | true |
f05633046f346d02617bcae4301d955d95f0f1be | C | lgcardeas/system_command | /find_inside.c | UTF-8 | 2,797 | 3.5625 | 4 | [] | no_license | #include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
char *Pattern;
/*Prototipo de funciones usadas*/
int isFile(char *path);
int isDirectory(char *path);
void movDir(char *path);
int BruteForce(int fd);
int main(... | true |
9863ca6bc856f0a0a95fb7a27a5578f45d6e2879 | C | sofixa/Pipex | /libft/ft_strsplit.c | UTF-8 | 1,702 | 3.0625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsplit.c :+: :+: :+: ... | true |
5945da714488c7cfafdd44cafb83cefdec702774 | C | AndreaFalanti/middleware-2020-falanti-ferri-faltaous | /project4/individual.c | UTF-8 | 1,230 | 2.78125 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stddef.h>
#include "individual.h"
const char* statusNames[] = { "susceptible", "infected", "immune" };
void printIndividualState(individual i) {
printf("[ID: %d] status: %s, position: (%f, %f), speed: (%f, %f), cumulated time: %ld\n",
i.id, statusNames[i.status], i.pos... | true |
c23047e266ea55fc6dce0824d492a1728a57fbdd | C | AlexanderNevarko/Alex-compiler | /node.h | UTF-8 | 2,119 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#define NODE
#include "tree_def.h"
enum types_t
{
BAD_OP = -1,
TEXT = 0,
NUMBER = 1,
VARIABLE = 2,
CALL = 3,
OPERATOR = 4,
COMPARISON = 5,
ASSIGN = 6,
IF_T = 7,
ELSE_T = 8,... | true |
eb01b09a3df779ecb2da0c7cf9ebfadfa5c70938 | C | SandKierkegaard/intelligent_camera_trap | /Turret/NINJA_168/NINJA_168/src/StepperMotor/StepperMotorSTM.c | UTF-8 | 6,830 | 2.609375 | 3 | [] | no_license | #include "./Header/StepperMotorSTM.h"
#include "./Header/StepperMotorTimer.h"
#include "./Header/StepperMotorIO.h"
#include "./Header/StepperMotorPosition.h"
#include "./Header/Constant.h"
unsigned char panSpeedAdjustment(unsigned char direction)
{
static unsigned char directionHistory [4] = {STAY_PUT,STAY_PUT,STA... | true |
b0d4adf4dd6c76f1dad0c3fe469e0fea7eb941f0 | C | Neon-20/My-library-for-CP | /data structure/BIT.h | UTF-8 | 351 | 3.234375 | 3 | [] | no_license |
struct BIT
{
int n;
vector<int>bit;
BIT(int _n)
{
n=_n;
bit.resize(n+1);
}
void update(int indx,int val)
{
if(indx>0) for(;indx<=n;indx+=(indx&-indx)) bit[indx]+=val;
}
int sum(int indx)
{
int tot=0;
for(;indx>0;indx-=(indx&-indx)) tot+=bit[indx];
return tot;
}
int sum(int l,int r)
{
... | true |
e52fb9018508963ae0d5a4678f2d0ede865d47b8 | C | daniellycosta/parallel-programming-exercises | /ch3/q19.c | UTF-8 | 2,455 | 3.421875 | 3 | [] | no_license | /* File: q19.c
*
* Purpose: A program in which multiple MPI processes receive a slice of two vectors (v1,v2)
* and a escalar (a) and makes: (a*v1) * v2
*
* Compile: mpicc -g -Wall -o q19 q09.c
* Usage: mpiexec -n <number of processes> ./q19
*
* Input: arrays size, escalar, array elements
* Output: ... | true |
be78485cf42a550d52a6c21cd0e4e9b43f950ca8 | C | AlexIsaacT/github-project | /C_programming/chapter1/ex1.18.c | UTF-8 | 665 | 3.546875 | 4 | [] | no_license | #include <stdio.h>
#define MAXLINE 1000
int getlines(char s[], int max);
int main()
{
int len, i;
char line[MAXLINE];
while ((len = getlines(line, MAXLINE)) != 0)
{
if (len > 1)
{
for (i = len-1; (line[i] == ' ' || line[i] == '\t' || line[i] == '\n'); i--)
;
... | true |
b9cca8d3fa049de15dc1f33e62bbdd302c49fd0a | C | ShresthaBaburam/dataStructure | /array.c | UTF-8 | 3,518 | 4.6875 | 5 | [] | no_license | #include<stdio.h>
int main(){
int i, n , m;
/*
Arrays
Arrays are defined as the collection of similar type of data items stored
at contiguous memory locations.
Arrays are the derived data type in C programming language which can store
the primitive type of data such as int, char, double, float, et... | true |
3bb5a20c99197b0f2bf7a40ecfb8cfdc4d95063a | C | JoshuaTPierce/Learning_Repo1 | /Lafore_OOCPP/Random, Various/Arduino C Programs/simpleTimer.C | UTF-8 | 626 | 3.1875 | 3 | [] | no_license | /*
* Simple Timer
* Demonstrates the use of a non-core Arduino Library and Serial Communications
* Joshua Pierce
*/
#include <SimpleTimer.h>
SimpleTimer timer; //Constructor for the timer function from SimpleTimer
boolean currentLEDState;
int ledPin = 13;
void setup(){
currentLEDState = false;
pinMode(ledPi... | true |
cb62471c27c9c41b3169052325a5b1e99a96cf4c | C | Soos99/rexp | /Tree.c | UTF-8 | 1,245 | 3.46875 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include "Tree.h"
Tree makeNode0(char *x, int indent){
Tree root;
root = (Tree) malloc(sizeof(struct Node));
root->label = x;
root->child = NULL;
root->sibling = NULL;
root->indent = indent;
root->freeable = false;
return root;
}
Tree makeNode1(c... | true |
55b4ed35b15725da50b38ae24733f74e5a285fd2 | C | JamesWright52/BeInfo | /include/intersect.h | UTF-8 | 1,073 | 3.1875 | 3 | [] | no_license | #ifndef INTERSECT_H
#define INTERSECT_H
#include <stdio.h>
#include <stdlib.h>
#include "fonction.h"
/* Ici, on est oblige d'utiliser la notation struct listepoint,
car la structure s'auto-reference!*/
typedef struct elemListe {
POINT p;
VECTEUR vecteur;
struct elemListe* suivant ;
} ELEMT ;
typedef struct Liste{... | true |
c6d579bc3dc161395b665d6b06e2c91ad9530441 | C | bradduthie/Inbreeding | /vectorrank.c | UTF-8 | 1,002 | 3.21875 | 3 | [] | no_license | /***********************************************************************************/
/* Program: arraysort2D.c
By: Brad Duthie
Description: Sorts a 2D array by the value of a column element.
Compile: gcc randpois.c -ansi -Wall -pedantic */
/*********************... | true |
df1164ba16e6fc4141e4d55e26a45a44c735063c | C | J0nhy/Tarefa5-Ficheiros | /Tarefa5/ficheiro03.c | UTF-8 | 794 | 2.734375 | 3 | [] | no_license | //All rights reserved to Custodio Co. Copyright 2020
#include<stdio.h>
#include<stdlib.h>
#include <locale.h>
int main(){
setlocale(LC_ALL, "Portuguese");
FILE *fp;
char username[100];
char password[50];
char ponto[1] = {';'};
int i;
fp = fopen("user.dat","wb");
if(!fp){
printf("Erro na ... | true |
3e0d4c94b533138456498fb86f1e14b085274bd7 | C | joyeepeng/pjCLibs | /pjJpegFile/pjJpegFile.c | UTF-8 | 9,091 | 2.59375 | 3 | [] | no_license | /*******************************************************************************
* File Name: pjJpegFile.c
* Author: Joyee Peng
* Email: joyee.peng@gmail.com
* Github: https://github.com/joyeepeng
* Blog: http://blog.csdn.net/pengqianhe
* History:
2012-10-23 initial release version
************************************... | true |
8dd810b0589423ac431505520d83346ef714c6d8 | C | AlexEzzeddine/Crypto | /src/base64/base64.c | UTF-8 | 3,287 | 2.609375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* base64.c :+: :+: :+: ... | true |
cde1357d0cc9e56b8f70a296c9b9ba81c0cb77f9 | C | zwshen/mudos-game-ds | /ds/cmds/std/shoot.c | BIG5 | 1,486 | 2.6875 | 3 | [] | no_license | // use.c
#include <ansi.h>
#include <skill.h>
inherit SSERVER;
int main(object me, string arg)
{
object target,weapon,arrow,creater;
seteuid(getuid());
if( !weapon=me->query_temp("weapon") ) return 0;
if( weapon->query("skill_type")=="bow")
{
if( !arrow=present("arrow", me ) ) return notify_fail(" A... | true |
53d3fc94135305df3f67ac5cd077d5c4de26d349 | C | wangtaooo/Linux | /algo/02_data_struct/03_集合/source/set.h | UTF-8 | 1,171 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __SET_H__
#define __SET_H__
typedef List Set;
void set_init(Set *set, int (*match)(const void *key1, const void *key2),
void (*destory)(void *data));
#define set_destory list_destory
/**
* 插入操作成功返回0;如果插入的成员在集合中已经存在返回1;否则返回-1
* 复杂度O(n)
* */
int set_insert(Set *set, const void *data);
/**
* 如果移除操作成... | true |
c63dd7d61cf542df26c8d077bd5197d6df85bda2 | C | NightShop/cs50 | /2019-x-crack/crack.c | UTF-8 | 2,545 | 2.75 | 3 | [] | no_license | #define _XOPEN_SOURCE
#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>
#include <unistd.h>
int main(int argc, string argv[])
{
if (argc == 2)
{
string salt1 = argv[1];
char salt[3];
strncpy(salt, salt1, 2);
salt[2] ='\0';
char input[6];
... | true |
5074298966fece8cbf4d717c4fcd086295093fe7 | C | alcap-org/AlcapDAQ | /www/html/online/trend_plots/runsummary/tutorials/principal.C | UTF-8 | 2,889 | 3.171875 | 3 | [] | no_license | #include "TPrincipal.h"
#include "iomanip.h"
void principal(Int_t n=10, Int_t m=10000)
{
//
// Principal Components Analysis (PCA) example
//
// Example of using TPrincipal as a stand alone class.
//
// We create n-dimensional data points, where c = trunc(n / 5) + 1
// are correlated with the re... | true |
6863a679378bd419d724d63e138dfdb7d40d080a | C | iakoviid/Embeeded-Systems | /extra/periodic_thread/sampl_cor.c | UTF-8 | 3,322 | 3.125 | 3 | [] | no_license | #include <sys/time.h>
#include <signal.h>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// calculates addition of positive arguments
void add(struct timeval * a, long b)
{
a->tv_usec = a->tv_usec + b;
if (a->tv_usec >= 1... | true |
c4d243b503b9db0fdf8e734f4a76057502a0f1d0 | C | Wil12Fred/InteraccionHumanoComputador | /Vector_tools.h | UTF-8 | 4,652 | 3 | 3 | [] | no_license | //#include <stdio.h>
//#include "Vector_tools.h"
#define TRUE 1
#define FALSE 0
#define VECTOR_EPSILON 0.00001f
#define DISTANCE_EPSILON 1e-08f
#define ANGLE_EPSILON 0.00872665f
#define MOD(A,B,C) (float) sqrt( A*A + B*B + C*C )
#define PI_VALUE 3.14159265359f
#define DEGREE_TO_RAD 0.... | true |
3aa3b6b8fe3855e325fba875ba61db4e5b72ba3c | C | luccalm/Algoritmos-SENAC | /Lista 8/ex01.c | UTF-8 | 282 | 3.859375 | 4 | [] | no_license | /*1. Escreva uma função que imprime todos os inteiros de 1 a 1000. Escreva também um programa que chama
essa função.*/
#include <stdio.h>
void contador();
int main() {
contador();
return 0;
}
void contador() {
int i;
for(i = 1; i <= 1000; i++)
{
printf("%d\n", i);
}
} | true |
45897e768e375b9f572bed80f702abfca0077c7c | C | andreaslindner/Balanced-arm-project | /inc/motor.h | UTF-8 | 1,594 | 2.90625 | 3 | [] | no_license | #ifndef MOTOR_H_
#define MOTOR_H_
/* ---MOTOR CONFIGURATION-- */
/**
* @brief Init both motors
* @param Nothing
* @return Nothing
* @note Nothing
*/
void Init_Motor();
/**
* @brief Start both motors
* @param Nothing
* @return Nothing
* @note Nothing
*/
void Motor_Start();
/**
* @brief Stop both motors
... | true |
59417d05e6ee4218ede8313ca60728a94602ee91 | C | arkrwn/Praktikum | /Stuktur Data/Posttest/Roni Dwi Kurniawan_2015470052.c | UTF-8 | 1,371 | 3.640625 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct mahasiswa
{
char nim[20];
char namamhs[20];
struct mahasiswa *next;
};
struct mahasiswa *ujung;
int tambah_data_mhs()
{
struct mahasiswa *tampung;
int j=0;
char jawab[2];
printf(" Linked List LIFO(Last In First Out) ");
p... | true |
6256a7a280f1e34acc31552b25c698e6a69197fd | C | dhanalakshmigutha/Hackerrank-Solution | /Algorithms/Implementation/Birthday Chocolate.c | UTF-8 | 533 | 2.84375 | 3 | [] | no_license | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main() {
int n,i,j,c=0,s;
scanf("%d", &n);
int *ar = malloc(sizeof(int) * n);
for(i = 0; i < n; i++){
scanf("%d",&ar[i]);
}
int d;
int m;
... | true |
27586e5b8c1ff7039ec339a37d67e285b363314f | C | anshi595/c_codes | /Test/Test_01/08_largestno_bitwise.c | UTF-8 | 256 | 3.5 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int max(int x, int y)
{
return x^((x^y) & -(x < y));
}
int main()
{
int a, b;
printf("Enter the two no:\n");
scanf("%d \n %d", &a, &b);
printf("The maximun of two no is : %d", max(a, b));
return 0;
}
| true |
3a3f9f8d9736efb9bdf6e08878f33c679f68dc10 | C | MrBrant/FanController | /Firmware/Initialize.c | UTF-8 | 1,575 | 2.59375 | 3 | [] | no_license | /*
* File: Initialize.c
* Author: Craig
*
* Created on August 4, 2011, 10:03 PM
*/
#include "pic.h"
void initialize();
void initialize()
{
//Programming
/* MCLREN;//Enables the MCLR pin to reset the PIC
MCLRE = 1;//MCLR set as MCLR
//I need access to CONFIG as a register for so many reasons! See pg ... | true |
796c0c4bfac1a5aa60ad777fd28a8031d5259d5e | C | bhargavi-muppirisetti/Stepin-Unit-Converter-and-Calculator | /implementation/main.c | UTF-8 | 8,709 | 3.96875 | 4 | [] | no_license | #include "Stepin-Unit-Converter-and-Calculator.h"
#include<stdio.h>
int main()
{
int choice;
double input1,input2;
double result;
int res1;
int in1,out;
double triginput,trigoutput;
int a=0;
int b=0;
int c=0;
int d=0;
int z=0;
int n,ram=0;
int year;
... | true |
fa6edcdab8c3092602e7d513ab4e9bbd337394f1 | C | astrotycoon/Cplusplus | /6_3/6_3.c | UTF-8 | 239 | 3.953125 | 4 | [] | no_license | #include <stdio.h>
int isBigger(int a, int b)
{
int x1, x2;
x1 = a;
x2 = b;
if (x1 > x2)
return 1;
else
return -1;
}
int main(void)
{
int a = 5;
int b = 10;
printf("The bigger values is %d\n", isBigger(a,b));
return 0;
} | true |
e61bcbe20c813f4df50508364c32a496bbaafe08 | C | ayush-kadakia/CS-211 | /pa1/seventh/seventh.c | UTF-8 | 227 | 3.171875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(int argc, char** argv){
int i;
for(i = 1; i < argc; i++){
int len = strlen(argv[i]);
printf("%c", argv[i][len-1]);
}
printf("\n");
return 0;
}
| true |
0e74dc68553dd550f418d90718f8208c987eb7d8 | C | ramiterdos1/C-progs | /contest programs/PE57.c | UTF-8 | 2,079 | 3.375 | 3 | [] | no_license | #include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
struct frac{
long long num;long long denom;
};
typedef struct frac * FP; //fraction-ponter
FP get_fraction()
{
FP f=(FP)malloc(sizeof(struct frac));
return f;
}
long long gcd(long long a,long long b)
{
if(a<b)return gcd(b,a);
else... | true |
c0fc8eea2f8f202c203db2fed7b6675278d47ffd | C | HedbergMartin/MatchC | /src/datatypes/vector.c | UTF-8 | 3,070 | 3.53125 | 4 | [
"MIT"
] | permissive | #include "vector.h"
//#include "time.h"
#include <memory.h>
#include <stdio.h>
#include <errno.h>
/*
* Implementation of C++ like vector in C.
*
* Author: Martin Hedberg
*
* Version information:
* 2021-05-13: v1.1, added back poping.
* 2021-04-21: v1.0, first implementation.
*/
struct vector {
void** dat... | true |
14dd1b91e164d5de87f0d4b32cede7a07e238c6a | C | york-rwsa/EMBR | /Assessment2/Stages/Stage2/lcd.h | UTF-8 | 815 | 2.828125 | 3 | [] | no_license | #include "lpc_types.h"
#include "lcd_commands.h"
#define LCD_ADDRESS 0x3b
#define DDRAM_SIZE 80
void lcd_init();
/**
* Sends data to the lcd address: LCD_ADDRESS in lcd.h
* @param data array of 8 bit ints to send
* @param length lenth of the array. use LEN() macro from utils
*/
void lcd_send_data(uint8_t *data,... | true |
47e6ec1f1c82bbe4536f794acad4c1968b9d664e | C | venetya/cs_assignments | /exercises/address.c | UTF-8 | 170 | 3.375 | 3 | [] | no_license | #include <stdio.h>
int main(){
int x = 10;
int y = 15;
printf("The address of x: %p\n", &x);
printf("The address of y: %p\n", &y);
return 0;
} | true |
27c1af34cd063d9f299bb4c90ac5dd1942efedf8 | C | Kakisuke1005/Image_Information_Processing | /2nd/ex1.c | UTF-8 | 822 | 3.515625 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#define MAX_SIZE 100
int main()
{
FILE *fp1,*fp2;
int c1,c2;
char file_name[2][MAX_SIZE];
printf("比較するファイルを入力して下さい: ");
scanf("%s %s",file_name[0],file_name[1]);
fp1=fopen(file_name[0],"rb");
if(fp1==NULL){
printf("Cannot open the %s!!\n",file_name[0]);
exi... | true |
3898093fb9e34947a6e6c89897ff3763bf87cc76 | C | Nhoutain/benchmark | /fork/fork.c | UTF-8 | 1,107 | 2.640625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// mesure copy-on-write, also with pthread
#include "benchmark.h"
#define N 42
int main (int argc, char *argv[]) {
timer *t = timer_alloc();
recorder *parent_rec = recorder_alloc("parent.csv");
recorder *child_rec = recorder_alloc("child.csv");
pi... | true |
00d44871b5d20844d1e1790f708a31487332c921 | C | stakenschneider/git.polytest | /OS/9/listings/priorities.c | UTF-8 | 954 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #include <stdio.h>
#include <sched.h>
int main (void)
{
struct sched_param shdprm;
printf ("SCHED_FIFO : from %d to %d\n",
sched_get_priority_min (SCHED_FIFO), sched_get_priority_max (SCHED_FIFO));
printf ("SCHED_RR : from %d to %d\n",
sched_get_priority_min (SCHED_RR), sched_get_priority_max (SCHED_RR));
pr... | true |
0cc8562d174bc62fa51573ebeac14602dc965f0e | C | ishafie/filesystem | /my_cp.c | UTF-8 | 3,423 | 3 | 3 | [] | no_license | #include "filesystem.h"
int copy_file_to_fs(t_fs *fs, int prev_inode) {
char *tmp;
int nb_blocks;
int index_block;
int index_block_prev;
int len;
int i;
int inode;
inode = 0;
while (inode < MAXBLOC && fs->tab_inode[inode].available == FALSE) {
inode++;
}
if (already_exist(fs, fs->tab_inode[p... | true |
6c02860c1b5339931657bb83d7f09b17ca4691ca | C | FrenzyJay/connect4 | /libft/ft_get_next_line.c | UTF-8 | 2,274 | 2.8125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_get_next_line.c :+: :+: :+: ... | true |
313627344f0e41f447244934eb52493b5a1e2cc3 | C | JerryZhou/isee | /code/foundation/container/ineighbor.c | UTF-8 | 2,270 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #include "foundation/container/ineighbor.h"
/* ineighbor destructor */
void ineighbor_destructor(const imeta* meta, iptr o) {
ineighbor *neighbor = icast(ineighbor, o);
ineighborclean(neighbor);
}
/* set the relation entry in graphics */
void ineighborbuild(ineighbor *neighbors, ientryrefjointresrelease entry... | true |
2b31deb3f2ca80f120194c28cccca80a958be4b8 | C | namsu5857/Learned-c | /Whetting your Apitite/C language/5_Operators/5.3.2IncreAndDecre.c | UTF-8 | 4,358 | 3.96875 | 4 | [] | no_license | /*************** Whetting Your Apitite ***************/
/*************** C Language ***************/
/*************** Chapter No.5 ***************/
/*************** Operators *... | true |
811b9ad2e9125aecfa1559ec70dc5acaaaaaefc8 | C | yorickdewid/DynnOS | /src/kcommon/file.c | UTF-8 | 2,249 | 2.953125 | 3 | [] | no_license | #include <kcommon/call.h>
#include <kcommon/file.h>
#include <kcommon/memory.h>
#include <kcommon/string.h>
void file_close(unsigned int fd)
{
call_close(fd);
}
unsigned int file_info(char *name, struct file_info *info)
{
return call_info(name, info);
}
int file_open(char *name)
{
return call_open(name);
}
unsig... | true |
7f01d8e84dc4691489c0c485a0d430ef6ef048c9 | C | ThaisLuca/EDA-UFF-2019 | /Lista6/fila.c | UTF-8 | 900 | 3.640625 | 4 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
#include "fila.h"
//Cria a fila
TFila* criaFila(void){
TFila *f = (TFila *) malloc(sizeof(TFila));
f->ini = f->fim = NULL;
return f;
}
int filaVazia(TFila *f){
return f->ini == NULL;
}
//Insere um elemento na fila
void insere(TFila *f, int x){
TNO *novo = (TNO *) malloc(s... | true |
19019a964fff25e629767288c8659c96b035cdab | C | SrB30/Competitive-Programming | /UVA/371 - Ackermann Functions.c | UTF-8 | 776 | 3.375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
long long int L, H, V, S, cnt, temp, temp1, i;
while (scanf("%lld%lld", &L, &H))
{
if (L == 0 && H == 0)
return 0;
if (L > H)
{
temp1 = L;
L = H;
H = temp1;
}
S = 0;
for (i=L;... | true |
b64ce6d51ece4c550fedc7dbac9a8a336006ebf9 | C | ynain/ece368 | /Project3/mapping.c | UTF-8 | 8,971 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include "mapping.h"
#define INF INT_MAX
int main(int argc, char * argv[]) {
if (argc != 3) {
fprintf(stderr, "Input format: ./proj3 mapfile queryfile\n");
return EXIT_FAILURE;
}
// Read file, bu... | true |
621b4140f722e81c40dac9942b867ddc889f447c | C | YuhanLiin/Cryptopals-C | /set1/break_repeating_xor.c | UTF-8 | 4,709 | 3.328125 | 3 | [] | no_license | #include <assert.h>
#include <stdlib.h>
#include "type.h"
#include "letter_score.h"
#include "xor.h"
#define MAX_KEYSIZE 40
#define MIN_KEYSIZE 2
size_t edit_distance(const byte_t * str1, const byte_t * str2, const size_t len) {
size_t total = 0;
for (size_t i = 0; i < len; ++i) {
byte_t xor = str1[i... | true |
e14216c6df11a8a17a906c29229d14440f2928ad | C | bsuverzabaek/Code-Chef-Exercises | /Hard/teamSelection/teamSelection.c | UTF-8 | 962 | 3.03125 | 3 | [] | no_license | #include <stdio.h>
#include <assert.h>
#include <stdlib.h>
int main(void){
int T,N,curSum,ans,bestDiff;
scanf("%d",&T);
assert(T>=1 && T<=100);
while(T>0){
scanf("%d",&N);
assert(N>=1 && N<=100);
ans = 0;
curSum = 0;
int ele[N];
int sum[450002];
for(int i=0;i<N;i++){
scanf("%d",&ele[i]);
a... | true |
400b58a5ef6121a0f5ffddb4172ebb87cc6baeba | C | 4rterius/cgtfs | /tests/tests_records/tests-records_trips.c | UTF-8 | 2,371 | 2.859375 | 3 | [
"MIT",
"CC-BY-3.0",
"CC-BY-4.0"
] | permissive | #ifndef CGTFS_TESTS_RECORDS_TRIPS_C
#define CGTFS_TESTS_RECORDS_TRIPS_C
#include "greatest/greatest.h"
#include "records/trip.h"
TEST trip_read(void) {
#define FIELDS_NUM_13 10
char *field_names[FIELDS_NUM_13] = {
"route_id", "service_id", "trip_id", "trip_headsign", "trip_short_name",
"direc... | true |
db0e8dee274de7d4c52a5e881e08106fa2a7e1e7 | C | wabilin/OJSols | /leetcode/split-a-string-in-balanced-strings.c | UTF-8 | 505 | 3.71875 | 4 | [
"Unlicense"
] | permissive | // Runtime: 0 ms, faster than 100.00% of C online submissions for Split a String in Balanced Strings.
// Memory Usage: 5.1 MB, less than 100.00% of C online submissions for Split a String in Balanced Strings.
int balancedStringSplit(char * s){
int r = 0;
int l = 0;
int count = 0;
while(*s) {
i... | true |
90f1bcc3d127569467c18f8a25f2f586377e3157 | C | fegemo/cefet-lfui | /descbin.c | UTF-8 | 3,383 | 3.890625 | 4 | [] | no_license | #include <stdio.h>
#define TAM 12
#define TRUE 0
#define FALSE -1
#define MAX_LINHAS 800
// A implementação (corpo) destas funções está lá embaixo
void imprime_numero(char, unsigned int); // imprime em binário ou hexadecimal
void imprime_vazios(char, int); // imprime espaços vazios
// E... | true |
9ce30fa3b3eea2aa847390fd2fdabf47968b6383 | C | nicecoolwinter/learn_c | /明解C語言/實作篇/chapter04/List4-17/List4-17.c | UTF-8 | 1,384 | 3.515625 | 4 | [] | no_license | /*
將單字從檔案讀入並顯示
*/
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#define Q_NO 3 /* 問題個數 */
FILE* fp;
/*--- 初始處理 ---*/
int initialize(void)
{
fp = fopen("DATA", "r");
return ((fp == NULL) ? 0 : 1);
}
/*--- 結束處理 ---*/
void ending(void)
{
fclose(fp);
}
/*--- 主函式 --... | true |
73262917abc81b84abbe8b18abb330539817efd7 | C | Asylumrots/C-Study | /C1/06多文件编程/01test.c | UTF-8 | 160 | 2.828125 | 3 | [] | no_license | #include <stdio.h>
#include "test.h"
int main()
{
printf("%d", max(10, 20));
return 0;
}
int max(int a, int b)
{
if (a > b)
return a;
else
return b;
} | true |
5788a6c4118ca900d550754409aa959b40dae763 | C | mhscardoso/Labs-Alg.Prog | /Lab2/ex12.c | UTF-8 | 656 | 3.90625 | 4 | [] | no_license | #include <stdio.h>
int main(void)
{
int n, iguais;
double a1, a2, soma, produto;
soma = 0;
produto = 1;
iguais = 0;
printf("Quantos pares de numeros? ");
scanf("%i", &n);
for (int i = 0; i < n; ++i)
{
printf("Digite a1: ");
scanf("%d", &a1);
printf("Digite a2: ");
scanf("%d", &a2);
if (a1 > a2)... | true |
a7771e6545b5d0aaba83e13e1bdb8d65fe12d398 | C | miz060/Parallel-Programming-Practice | /MPI_Ring/svalidate.c | UTF-8 | 2,589 | 3.796875 | 4 | [] | no_license | /** @file
* \brief a small set of validation functions for strings
* \author Mingcheng Zhu
* \email zhumc11@gmail.com
* \date 19 Jan 2018
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "svalidate.h"
/**
* \fn char * trim (char * input)
* \param input... | true |
6d698772ddcfdac85990924ada740e82fb1fafde | C | kateyose/Hole-punching-chat | /udp_client.c | UTF-8 | 2,671 | 2.75 | 3 | [
"Unlicense"
] | permissive | #include <arpa/inet.h>
#include <netinet/in.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#define BUFLEN 512
#define NPACK 10
#define PORT 6868
#define SRV_IP "18.225.5.21"
static int s;
struct client {
int host;... | true |
97ec6649e3a653d51a8b0c58e5530a4b8a28baeb | C | nikopapp/SoftwareEngineering-1 | /encryption.c | UTF-8 | 7,202 | 3.0625 | 3 | [
"MIT"
] | permissive | /*next steps
1. implemnet the grid
2. implement key presses with SDL
3. test if everything works*/
#include "encryption.h"
#define GRIDSIZE 10
void enc_shufle(char word[LENGTH], int size);
int enc_isenc_vowel(char c);
char enc_vowel();
char enc_constant();
void enc_changeRow(char word[LENGTH], int size);
void enc_cha... | true |
4727b944c1a8f828f3747887f8774277705ca182 | C | aadamsaleem/Data-Structures-Using-C | /sorting Techniques/MERGEREC.C | UTF-8 | 1,013 | 3.71875 | 4 | [] | no_license | /* Implement Merge Sort through Recursion */
#include<stdio.h>
#include<conio.h>
#define MAX 20
int array[MAX];
void merge(int low, int mid, int high )
{
int temp[MAX];
int i = low;
int j = mid +1 ;
int k = low ;
while( (i <= mid) && (j <=high) )
{
if (array[i] <= array[ j])
temp[k++] = array[i++] ;
else
temp[k++] = a... | true |
db616c2a1e929f2e5283ad930583d7e2ca8e2720 | C | kushagratandon1997/DSA-CODES | /DSA_LAB_8_part_b.c | UTF-8 | 5,319 | 3.484375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int truck_on_road[100],r=-1; /*array for trucks on road*/
int truck_in_garage[100],days_of_stay[100]; /* circular queue 1 for truck in garage and circular queue 2 for days of stay of truck in garage*/
int front=0,rear=-1,truck,c;
int charge();
i... | true |
89b3ac2c9ab13c5518f82123147f23f225c0067a | C | gazfaris/dot_julia | /packages/Ccluster/i80C5/local/include/ccluster/numbers/compRat.h | UTF-8 | 3,550 | 2.71875 | 3 | [] | no_license | /* ************************************************************************** */
/* Copyright (C) 2018 Remi Imbach */
/* */
/* This file is part of Ccluster. ... | true |
2a91eb05b1b0fb3c2c9de02fb8067b895c396e96 | C | alanamiyai/MTP | /aula20170921/iif3.c | UTF-8 | 366 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
int main()
{
double fat, n;
printf("Insira um valor para o qual deseja calcular seu fatorial: ");
scanf("%lf", &n);
if (n <= 20)
{
for(fat = 1; n > 1; n = n - 1)
fat = fat * n;
printf("\nFatorial calculado: %lf", fat);
}
else
printf("... | true |
1216fc30ae3d05234668ed198968fc97e0447675 | C | cfkcoder/CODE | /Project26/Project26/text.c | ISO-8859-7 | 2,577 | 3.375 | 3 | [] | no_license | #include <stdio.h>
#include <malloc.h>
#include <stdbool.h>
#include <assert.h>
#pragma warning(disable:4996)
#define ElemType int
typedef struct LinkQueueNode
{
ElemType data;
struct LinkQueueNode *link;
}LinkQueueNode;
typedef struct LinkQueue{
struct LinkQueueNode *head;
struct LinkQueueNode *tail;
}Li... | true |
550abeda43d1685354a488c01b477c8fb0dbca48 | C | bianca-bouleanu/Hash-Table | /Hash-Table/functions.c | UTF-8 | 6,533 | 3.765625 | 4 | [] | no_license | /**
* Tema 1 SO - Hash table
*
* Copyright (C) 2018, Oana-Bianca Bouleanu 333CA
* <oana.bouleanu@stud.acs.upb.ro>
*
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hash.h"
#incl... | true |
07d98dc4d7ba597c6418252eea6bd526cd87a220 | C | Ebloin/orazio_logger | /test_queue.c | UTF-8 | 282 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
#include "queue.h"
int main() {
queue_t* c = createQueue();
int a[10] = {0,1,2,3,4,5,6,7,8,9};
int i;
for (i=0; i<10; i++) {
enqueue(c, &a[i]);
}
for (i=0; i<10; i++) {
int* e = dequeue(c);
printf("dequeued %d\n", *e);
}
return 0;
}
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.