language string | src_encoding string | length_bytes int64 | score float64 | int_score int64 | detected_licenses list | license_type string | text string |
|---|---|---|---|---|---|---|---|
C | UTF-8 | 552 | 2.828125 | 3 | [] | no_license |
#include <lxl_queue.h>
int main(int argc, char *argv[])
{
lxl_log_t *log;
lxl_pool_t *pool;
lxl_queue_t *queue;
log = lxl_log_init(LXL_LOG_DEBUG, LXL_LOG_FLUSH);
pool = lxl_pool_create(LXL_DEFAULT_POOL_SIZE, log);
queue = lxl_queue_create(pool, 20, sizeof(int));
int i;
int *elt;
for (i = 0; i < 30; ++i) {
... |
C | UTF-8 | 1,573 | 2.546875 | 3 | [] | no_license | /*
* File: avl.h
* Author: Sangeet Dahal
*/
#ifndef AVL_H_
#define AVL_H_
typedef struct tnode* AVLTreeNodePtr;
typedef struct tnode {
void *data;
AVLTreeNodePtr right;
AVLTreeNodePtr left;
AVLTreeNodePtr parent;
int height;
} Treenode;
typedef struct tree* AVLTreePtr;
typedef struct tree {
AVLTreeNodePtr... |
C | GB18030 | 1,180 | 3.5625 | 4 | [] | no_license | #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[]) {
int t;
scanf("%d",&t);
while(t--){
int n;
scanf("%d",&n);
int a[n];
int i;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
... |
C | UTF-8 | 9,334 | 3.21875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
C | UTF-8 | 6,712 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "symtable.h"
#include "quad.h"
#define HASH_MULTIPLIER 65599
#define MAXSIZE 300
struct symtable {
/* array of MAXSIZE positions, each one
with a -pointer to- list node */
Node_T hashtable[MAXSIZE];
};
/* hash function: ret... |
C | UTF-8 | 876 | 2.609375 | 3 | [] | no_license | #ifndef BST_H
#define BST_H
typedef struct
{
int value;
}Data;
typedef struct node
{
Data data;
struct node * left;
struct node * right;
struct node * parent;
}Node;
typedef struct
{
Node * root;
}Tree;
Node * createNode(Data d, Node * parent);
Tree * createTree();
Data * insert(Tree *, Data);
Data * search(T... |
C | UTF-8 | 2,964 | 2.59375 | 3 | [] | no_license | /*
* ServoCommand.c
* Created: 20/06/2013 10:50:07
* Authors: kerhoas, ziad
* kerhoas@enib.fr
*/
#include "ServoCommand.h"
#include "asf.h"
#include "conf_board.h"
#include "conf_clock.h"
#define SERVO_HIGH 0
#define SERVO_LOW 1
#define NUM_SERVOS 2
#define SERVO_H_CHANNEL 2
#define SERVO_L_CHANNEL 3
static ... |
C | UTF-8 | 3,460 | 2.734375 | 3 | [
"BSD-2-Clause"
] | permissive | /* Copyright (c) 2013, David Hauweele <david@hauweele.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... |
C | UTF-8 | 500 | 3.34375 | 3 | [] | no_license | #include "stdio.h"
#include "fcntl.h"
#include "unistd.h"
int main(int argc, char *argv[])
{
int ret;
int fd;
int val = 0;
if(argc != 2)
{
printf("error, Please input 1 argument\n");
return -1;
}
fd = open("/dev/led0", O_WRONLY);
if(fd < 0)
{
printf("open failed\n");
return -1;
}
if(strcmp(argv[1]... |
C | UTF-8 | 2,071 | 2.65625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: ... |
C | UTF-8 | 4,095 | 3.515625 | 4 | [] | no_license |
// Auteur Martin Dubois, ing.
// Produit Enseignement/C_Cpp
// Fichier Tic-Tac-Toc_Travail/Tic-Tac-Toc.c
// Includes
/////////////////////////////////////////////////////////////////////////////
// ===== C ==================================================================
#include <assert.h>
#include <stdio.h>
... |
C | UTF-8 | 351 | 3.734375 | 4 | [] | no_license | #include<stdio.h>
double power(double,int);
int main()
{
int n;
double m,c;
puts("Please enter the value of m and n\n");
scanf("%lf%d",&m,&n);
if(n==0)
n=2;
c=power(m,n);
printf("The value of m power n is %lf\n",c);
}
double power(double a,int b)
{
int i;
double p=1;
for(i=0;i<b;i++)
{... |
C | UTF-8 | 284 | 2.609375 | 3 | [] | no_license | #include <unistd.h>
#include <stdio.h>
main(void)
{
char oldfilename[100], newfilename[100];
printf ("Please input source filename:");
scanf("%s", oldfilename);
printf ("Please input target filename:");
scanf("%s", newfilename);
link(oldfilename, newfilename);
}
|
C | UTF-8 | 866 | 2.921875 | 3 | [] | no_license | #include<stdio.h>
#include<omp.h>
#include<stdlib.h>
#define NUMBER_SENSORS 1000
int main() {
double temperature[NUMBER_SENSORS][24];
srand(0);
for(int i=0; i<1000; ++i) {
for(int j=0; j<24; ++j) {
temperature[i][j]= rand() % 50;
}
}
double overall_average = 0.0;
do... |
C | UTF-8 | 1,157 | 4.15625 | 4 | [] | no_license | //Sarah Anderson
//CPSC 1111.005
//lab 12
//11-27-18
//Description: This file asks for a length of a string and uses malloc to
//allocate enough space. If there isnt enough room to allocate it, then it
//prints out "failed". IF there is it asks for a inout from user and then
//it is copied from one string to anothe... |
C | UTF-8 | 3,321 | 2.609375 | 3 | [] | no_license | /****************************************************************/
/*** Main program for experiments with scale-free graphs ***/
/*** Results (histogram in .dat files) in folders Output/ and Output_Normed/ ***/
/*** For evaluation and fitting with gnuplot use: e.g. load "Plotscripts/gnuplot_ausgabe_fit_powe... |
C | UTF-8 | 951 | 2.90625 | 3 | [] | no_license | #include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#define FIFO_WRITE "fifo_c"
#define FIFO_READ "fifo_s"
int main()
{
int fp_w;
int fp_r;
int i = 1;
if((fp_r = open(FIFO_READ, O_RDWR)) < ... |
C | UTF-8 | 592 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #include <stdio.h>
int main()
{
///incomplete
int alc=0,gas=0,di=0;
int temp=0,n;
while(1){
if(n==4){
break;
}
else{
scanf("%d",&n);
if()
if(n==1){
alc++;
printf("%d",alc);
}
e... |
C | UTF-8 | 1,101 | 3.5625 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
void merge(int v[], int size) {
int mid; // Mid of vector (size/2)
int i, j, k;
int* tmp; //Use this to help sort vector
tmp = (int*) malloc(size * sizeof(int));
if (tmp == NULL) {
printf("\n\n\nPC DA XUXA!\n\n\n");
fflush(stdout);
exit(-1);
}
mid = size / 2;
... |
C | UTF-8 | 642 | 4 | 4 | [] | no_license | #include "sort.h"
/**
* bubble_sort - Here we will sort an array of integers in ascending order
* @array: This is the pointer to the first element within our array
* @size: This is the size of our array
*
* Return: We want to return non because VOID
*/
void bubble_sort(int *array, size_t size)
{
int temp = 0;
... |
C | UTF-8 | 538 | 3.546875 | 4 | [] | no_license | #include <stdio.h>
void fun (int *x, int *y, int *z);
void main(void)
{
int i = 5;
int array_A[3] = {1, 2, 3};
int array_B[3] = {8, 9, 10};
printf("Initial value of i: %d\n", i);
printf("Initial value of array_A[0]: %d\n", array_A[0]);
printf("Initial value of array_B[0]: %d\n", array_B[0]);
fun(&i, &array_A[0], array_... |
C | GB18030 | 2,165 | 2.609375 | 3 | [] | no_license |
#include <mc32p21.h>
#include "CONST.h"
#include "externVar.h"
// ̰ 2
void Key_Scan(void)
{
if(!KEY_I) //а
{
if(key_time <= KEY_EFFECT) //ȥ
{
key_time++;
if(key_time == KEY_EFFECT)
{
if(!key_flag_bak) //ֵ
{
... |
C | UTF-8 | 3,864 | 3.328125 | 3 | [] | no_license | #include <stdlib.h>
#include <pthread.h>
#include <stdio.h>
#include <semaphore.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <time.h>
#include <sys/stat.h>
//文件模式
/*
*S_IRUSR:文件所有者的读权限 100
*S_IWUSR:文件所有者的写权限 010
*S_IRGRP:文件所有者同组用户的读权限 000 100
*S_IROTH:其他用户的读权限 000 100
*... |
C | UTF-8 | 1,979 | 2.765625 | 3 | [] | no_license | #include "pngwriter.h"
#include <stdlib.h>
png_data *png_create(int nWidth, int nHeight) {
int i;
png_data *pData = (png_data *)malloc(sizeof(png_data));
pData->nWidth = nWidth;
pData->nHeight = nHeight;
pData->pPixels = (png_bytepp)malloc(nHeight * sizeof(png_bytep));
for (i = 0; i < nHeight; i++)
p... |
C | UTF-8 | 272 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
int main(){
double max=0, a[1000], sum=0;
int n, m;
scanf("%d", &n);
for(m=0; m<=n-1; m++){
scanf("%lf", &a[m]);
if(max<=a[m])
max = a[m];
}
for(m=0; m<=n-1; m++){
a[m] = (a[m]/max)*100;
sum = sum + a[m];
}
printf("%lf", sum/n);
}
|
C | UTF-8 | 3,433 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
typedef struct Stack stack;
struct Stack {
int * arr;
int c;
int max;
};
stack * initStack(int max) {
stack * s = (stack *)malloc(sizeof(stack));
s->c = 0;
s->max = max;
s->arr = (int *)malloc(max*sizeof(int));
return s;
}
void push(stack *s, int n) {
if(s->c < s->m... |
C | UTF-8 | 3,552 | 2.96875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... |
C | UTF-8 | 2,183 | 2.78125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error.c :+: :+: :+: ... |
C | UTF-8 | 7,622 | 2.53125 | 3 | [
"MIT"
] | permissive | /* window.c
Author: Joshua Prendergast */
#include "main_window.h"
#define INT16_MAX 65535
void main_window_init(game *game, main_window *window) {
window->game = game;
window->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
window->drawing_area = gtk_drawing_area_new();
GtkWidget *layout = gtk_vbox_n... |
C | UTF-8 | 1,159 | 3.28125 | 3 | [] | no_license | #include "asm.h"
void print_token(t_token *token)
{
if (token == NULL)
return ;
ft_putstr(token->str);
write(1, " [", 2);
ft_putstr(type_to_string(token->type_token));
write(1, "]", 1);
}
void print_token_list(t_token_list *token_list)
{
t_token *token;
token = token_list->begin;
while (token != NULL)
{
... |
C | UTF-8 | 1,813 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define FD_OUT stdout
#define SPACE " "
#define NEWLINE "\n"
#define STRFORM "%s"
/* Prototypes for helper functions */
void xit(char** argv, int argc);
void eco(char** argv, i... |
C | UTF-8 | 2,206 | 2.6875 | 3 | [] | no_license | #ifndef __J1939_TRANSCEIVER_PLATFORM_H__
#define __J1939_TRANSCEIVER_PLATFORM_H__
#include <stdint.h>
#ifndef __FAR
#define __FAR
#endif
struct can_extended_frame {
uint32_t id;
uint8_t len;
uint8_t dat[8];
};
/// \brief transceiver_received_callback CAN收发器在接受到一帧数据并保存之后调用这个回调函数通知上层接收到数据.
///
/// \param ... |
C | UTF-8 | 1,750 | 3.828125 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
void printCharCount(int index, int *array) {
if ((index >= 48 && index < 58) ||
(index >= 65 && index < 91) ||
(index >= 97 && index < 123)) {
printf("char[%c] = %d\n", index, array[index]);
}
}
int main() {
FILE *fileI = fopen("gram.in", "r");
FILE *fileO = fopen("gra... |
C | UTF-8 | 6,412 | 2.609375 | 3 | [] | no_license | #include "sock_funs.h"
int get_IP_MAC( char *ip, int ip_l, char *mac, int mac_l) { //返回的IP地址为字符串型:"192.168.1.1",返回Mac为6个char
struct ifreq ifr;
struct ifconf ifc;
char buf[max_ether_len];
int success = 0;
int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);//create a socket to get mac and ip addres... |
C | UTF-8 | 7,926 | 2.828125 | 3 | [] | no_license | /*
* ============================================================================
*
* Filename: srv_io.c
*
* Description: Server's input and output and parser for client I/O
* Functions:
* void broadcast(const List *usr_lst, const char *msg, int self_sock)
* -> Prints msg t... |
C | UTF-8 | 756 | 4.0625 | 4 | [] | no_license | #include <stdio.h>
// 最小移動回数を求める。
int hanoi_min(int n)
{
if(n > 1)
return( 2*hanoi_min(n - 1) + 1 );
else
return 1;
}
// 最小で移動させる手順を求める。
// hanoi(int 円盤数,int 移動元,int 仲介,int 移動先)
void hanoi(int n, char start, char use, char end)
{
if(n > 0) {
hanoi(n - 1, start, end, use);
printf("円盤%dを 杭%c から 杭... |
C | UTF-8 | 269 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
int menor(int a, int b){
int m;
m = b;
if (a>b)
m = b;
return m;
}
int main (int argc, char ** argv){
int num1, num2, resultado;
scanf ("%d", &num1);
scanf ("%d", &num2);
resultado = menor(num1, num2);
printf("%d", resultado);
return 0;
} |
C | UTF-8 | 2,660 | 3.421875 | 3 | [] | no_license | #include "6a.h"
static Node* create_Node(int data, Node* link) {
Node* temp = (Node*)malloc(sizeof(Node));
temp -> data = data;
temp -> link = link;
return temp;
}
void List_initialize(List* ptr_List)
{
//TODO
ptr_List->head=NULL;
ptr_List->number_of_Nodes=0;
}
void List_insert_front(List* ptr_List, int ... |
C | UTF-8 | 822 | 3.140625 | 3 | [] | no_license | //
// Created by lieroz on 02.12.16.
//
#ifndef LAB_10_GRAPH_H
#define LAB_10_GRAPH_H
#include "heap.h"
// A structure to represent a node in adjacency list
typedef struct AdjListNode {
int dest;
int weight;
struct AdjListNode* next;
} AdjListNode;
// A structure to represent an adjacency list
typedef struct {
... |
C | UTF-8 | 294 | 3.640625 | 4 | [] | no_license | #include "lists.h"
/**
* free_list - function that frees a list_t list.
* @head: pointer to the first element
* Return: Always 0.
*/
void free_list(list_t *head)
{
list_t *clear = head;
for (clear = head; clear != NULL; clear = clear->next)
{
free(clear->str);
free(clear);
}
}
|
C | UTF-8 | 530 | 3.265625 | 3 | [] | no_license | #include <stdio.h>
int f_003_002(int a, int b, int c, int d) {
printf("\n a=%d", a);
printf("\n b=%d", b);
printf("\n c=%d", c);
printf("\n d=%d", d);
printf("\n ===================");
int I, i, max, min, result;
I=4;
int mass[I];
mass[0] = a;
mass[1] = b;
mass[2] = c;
mass[3] = d;
max = mass[0];
m... |
C | UTF-8 | 512 | 4.15625 | 4 | [] | no_license | //smallest of three numbers using min variable
#include<stdio.h>
void in(int *x, int *y, int *z)
{
printf("Enter the three numbers, I shall determine the smallest of them.\n");
scanf("%d %d %d",x,y,z);
}
int com(int a,int b, int c)
{
int min=a;
if(b<min) min=b;
if(c<min) min=c;
re... |
C | UTF-8 | 1,088 | 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... |
C | UTF-8 | 426 | 3.96875 | 4 | [] | no_license | #include<stdio.h>
void swap(int* a, int* b);
int main() {
int x;
int y;
printf("Introduceti x: ");
scanf("%d", &x);
printf("Introduceti y: ");
scanf("%d", &y);
printf("\nInainte de interschimbare: \n");
printf("x = %d\ty = %d \n", x, y);
swap(&x, &y);
printf("\nDupa de interschimbare: \n");
printf("x... |
C | UTF-8 | 232 | 2.5625 | 3 | [] | no_license | #include "projection.h"
bool overlaps(Projection p1, Projection p2) {
return !(p1.min > p2.max || p1.max < p2.min);
}
double getOverlap(Projection p1, Projection p2) {
return (MIN_(p1.max, p2.max) - MAX_(p1.min, p2.min));
}
|
C | UTF-8 | 6,537 | 3.046875 | 3 | [] | no_license | /* eval.c - Evaluation */
#include <stdio.h>
#include <string.h>
/* parse_single() */
#include <parser.h>
/* object definition */
#include <object.h>
/* env_hashtable definition */
#include <hashtable.h>
#include <eval.h>
static object *eval_preproc(object *obj, env_hashtable *env);
static object *preprocess_synt... |
C | UTF-8 | 878 | 3.84375 | 4 | [] | no_license | #include "stdio.h"
#define N 10
void swap(int *a, int *b) {
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int findMinIndex(int a[], int startIndex, int len) {
int minIndex = startIndex,
minElem = a[minIndex];
for (int i = startIndex; i < len; i++) {
if (a[i] < minElem) {
... |
C | UTF-8 | 971 | 2.890625 | 3 | [] | no_license | #include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<sys/mman.h>
#include<unistd.h>
#include<stdlib.h>
#include<fcntl.h>
#define MAPLEN 0x1000
struct STU{
int id;
char name[ 20];
char sex;
};
void sys_err( char *str, int exitno)
{
perror( str);
exit( exitno);
}
int main( int argc, char *a... |
C | GB18030 | 725 | 3.6875 | 4 | [] | no_license | /*ͷ巨*/
#include <stdio.h>
#include <stdlib.h>
typedef struct LNode
{
int data;
struct LNode* next;
}LNode_t, * pLNode_t;
void insertHead(pLNode_t* toHead, pLNode_t* toTail, int newData)
{
pLNode_t pNew;
pNew = (pLNode_t)calloc(1, sizeof(LNode_t));
pNew->data = newData;
if (*toHead == NULL)
{
*toHead = pNe... |
C | UTF-8 | 1,905 | 3.15625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rush04.c :+: :+: :+: ... |
C | UTF-8 | 1,566 | 2.953125 | 3 | [] | no_license | #include "monty.h"
/**
* main - entry point
*
* @ac: argument counter
* @av: argument vector
*
* Return: EXIT_SUCCESS if succes, EXIT_FAILURE otherwise
*
* Description: a simple interpreter for the monty language
*/
int main(int ac, char **av)
{
FILE *fd = NULL;
int i, ret = 0, line_number = 1, op... |
C | UTF-8 | 519 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#define TAM 3
void escreva(int *s){
for(int i=0;i<TAM;i++){
printf("%d ",s[i]);
}
printf("\n");
}
void permutacao(int *s,int i, int *v, int n,int *x){
if(i == TAM ){
escreva(s);
}else{
for(int j=0;j<n;j++){
if(x[j]==0){
x[j]=1;
s[i]=v[j];
permutacao(s... |
C | UTF-8 | 1,260 | 3.375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define fifoName "/tmp/my_fifo"
int main(int argc, char const *argv[])
{
int res,i;
int open_mode = 0;
int check = 1;
if (argc <2 || argc>3){
printf("Uso: Inserisci la mo... |
C | UTF-8 | 3,764 | 3.046875 | 3 | [] | no_license | {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww17200\viewh14820\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\f0\fs24 \cf0 //Kei... |
C | UTF-8 | 2,021 | 2.953125 | 3 | [] | no_license | #define F_CPU 8e6
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <stdio.h>
#define LCD_E 3
#define LCD_RS 2
void lcd_strobe_lcd_e(void);
void init_4bits_mode(void);
void lcd_write_string(char *str);
void lcd_write_data(unsigned char byte);
void lcd_write_cmd(unsigned char byte);
voi... |
C | UTF-8 | 1,098 | 2.828125 | 3 | [] | no_license | #include <stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<stdlib.h>
#include<string.h>
#include<fcntl.h>
#include<event2/event.h>
void read_cb(evutil_socket_t fd,short what,void *arg)
{
//读管道
char buf[1024]={0};
int len=read(fd,buf,sizeof(buf));
printf("data len=%d,buf=%s... |
C | UTF-8 | 301 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
int main() {
char str[] = "kitty on your lap";
printf("str[0]の内容\t\t= %c\n" , *str);
printf("str[0]のアドレス\t= %x" , str);
// 警告: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘char *’
return 0;
}
|
C | UTF-8 | 1,379 | 3.203125 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#define BUFFSIZE 4096
int
tcp(const char* source, const char* target);
int
main(int argc, const char *argv[])
{
//ensure the parame... |
C | UTF-8 | 241 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
int main() {
int a0, a1, a2;
scanf("%d %d %d", &a0, &a1, &a2);
int b0, b1, b2;
scanf("%d %d %d", &b0, &b1, &b2);
printf("%d %d", (a0 > b0) + (a1 > b1) + (a2 > b2),
(a0 < b0) + (a1 < b1) + (a2 < b2));
}
|
C | UTF-8 | 1,074 | 2.765625 | 3 | [
"MIT"
] | permissive | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Bluetoot control using a snake byte device *
* *
* * * * * * * * * * * * * *... |
C | UTF-8 | 9,002 | 2.625 | 3 | [] | no_license | /**
* \file local_mm.c
* \brief Matrix Multiply file for Proj1
* \author Kent Czechowski <kentcz@gatech...>, Rich Vuduc <richie@gatech...>
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#define MB *1024*1024
#define KB *1024
/* Intel Xeon X5650 CPU Gulftown (sixcore) */
/* L1 and L2 cache are p... |
C | UTF-8 | 5,962 | 2.703125 | 3 | [
"LGPL-2.1-only",
"GPL-3.0-only",
"GCC-exception-3.1",
"GPL-2.0-only",
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"Zlib",
"LicenseRef-scancode-public-domain"
] | permissive | /* Half-float conversion routines.
Copyright (C) 2008-2022 Free Software Foundation, Inc.
Contributed by CodeSourcery.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, o... |
C | UTF-8 | 1,331 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef __SHORTEST_PATH_H
#define __SHORTEST_PATH_H
#define INFINITE 999
#define ERROR_COORD 0.75
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "map_common.h"
/** @brief Return the index of a point in the map, according to its coordinates
Note that there is a margin error here if the coordina... |
C | UTF-8 | 626 | 2.78125 | 3 | [] | no_license | #ifndef __WEB_STRUCTURE_H__
#define __WEB_STRUCTURE_H__
#include "web_constant.h"
struct ProtocolHeader
{
uint16_t magic;
uint16_t cmd;
uint32_t data_length;
ProtocolHeader()
{
magic = kProtocolMagic;
cmd = CT_MIN;
data_length = 0;
}
void CopyData(ProtocolHeader *self, const ProtocolHeader *other)
{... |
C | UTF-8 | 1,542 | 2.859375 | 3 | [] | no_license | /* To Compile:
* 'mex OP_numint_gausslaguerre.c' (on a machine with gsl installed) */
#include <math.h>
#include "mex.h"
#include <stdio.h>
#include <stdlib.h>
#include <gsl/gsl_math.h>
#define EPS 3.0e-14
#define MAXIT 10
int n;
double alf;
void Gaulag0(double *,double *,double , int );
void Gaulag0(double *x, d... |
C | UTF-8 | 435 | 3.296875 | 3 | [] | no_license | /*
JTSK-32011
a3_p8.c
Samundra karki
sa.karki@jacobs-university.de
*/
#include <stdio.h>
int main(){
char ch,ch1;
int n;
scanf("%c",&ch);
scanf("%d",&n);
if ((n>32 || n<7)){
printf("Input is invalid\n");
return 1;
}
int i;
for (i=1; i<=n; i++){
ch1 = ch - i;
if( !(ch1>=97 && ch1<=122) ){
... |
C | UTF-8 | 2,243 | 3.578125 | 4 | [] | no_license | /*
* File: PrintErrno.c
* Description: View message associated with errno,
* or list all errno and their messages,
* an alternative of program perror.
* Author: Wang Qian
* Create Date: 2016-08-15
* Last Modified Date: 2016-08-16
*/
#include <errno.h>
#include <stdio.h>
... |
C | UTF-8 | 3,062 | 3.78125 | 4 | [] | no_license | // Q1. Define your own iterative functions for
// (using array notation as well as exclusively using pointers)
// i) finding a substring in a main string
// j) Whether a string starts or ends with a particular sub string
#include<stdio.h>
int str_len(char *);
void str_cpy(char *,char *);
int str_cmp(char *,char *);
... |
C | UTF-8 | 776 | 3.53125 | 4 | [] | no_license | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define EXT_LEN 3
#define EXTENSION "808"
char* pwdextend(char* a);
int main(void) {
char *p2, *p1;
p1 = pwdextend("password");
p2 = pwdextend("hackable");
assert(strcmp(p1, "password808") == 0);
assert(strcmp(p2, "ha... |
C | UTF-8 | 1,147 | 2.71875 | 3 | [] | no_license | #include "stack_machine.h"
typedef struct {
char *str;exp *e ;exp *memo;
memo_s set;
} memo_entry;
static memo_entry *memos;static long memo_no;
static void memo_set(Global *g,char *str,exp *e ,exp *memo, memo_s set){int i;
for(i=0;i<memo_no;i++){
if (memos[i].str==str && memos[i].e==e && memos[i].memo==memo)
... |
C | UTF-8 | 4,270 | 2.75 | 3 | [] | no_license | #include <subr.h>
#include <cpu/p5/io.h>
/*
* This file is for setting up the SMC Super IO chip.
*
* This file contains some hard coded mappings for IRQs which may
* work for most boards but is really board specific. A
* configuration mechanism is needed.
*
* I have only implemented the UART features that I ... |
C | UTF-8 | 969 | 2.859375 | 3 | [
"NASA-1.3",
"MIT"
] | permissive | /*******************************************************************************
** File: vc0706_mux.c
**
** Purpose:
** This file is main hdr file for the VC0706 application.
**
**
*******************************************************************************/
#include "vc0706_mux.h"
int mux_init(mux_t *mux, int ... |
C | UTF-8 | 714 | 3.578125 | 4 | [] | no_license | #include "holberton.h"
#include <stdlib.h>
/**
*alloc_grid - creates 2d array of integers
*@width: width
*@height:height
*Return: Always
*/
int **alloc_grid(int width, int height)
{
int **array;
int loop;
int loop1;
int loop2;
if (width <= 0 || height <= 0)
{
return (NULL);
}
array = (int **) malloc(sizeof(int *)... |
C | UTF-8 | 1,151 | 3.8125 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
int mutex=1, n, full=0, empty, buffer[25], temp=0, f=-1, r=-1;
void wait(int *s) {
(*s)--;
}
void signal(int *s) {
(*s)++;
}
void producer() {
int x;
wait(&mutex);
signal(&full);
wait(&empty);
// produce an item
printf("Enter the item to be produced: ... |
C | UTF-8 | 3,048 | 3.203125 | 3 | [] | no_license |
#ifndef CV4_DU_H
#define CV4_DU_H
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
char* trim(char* str){
char* r = str+(strlen(str)-1); // r = koniec stringu
while (isblank(*r)){ // orezanie od konca
r--;
}
*(r+1)="\0"; ... |
C | UTF-8 | 741 | 3.6875 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
bool isEqual(struct TreeNode* s,struct TreeNode* t){
if(s==NULL||t==NULL) // when there is one tree is NULL
return s==t; // if both tree is NULL, return tru... |
C | UTF-8 | 566 | 3.4375 | 3 | [] | no_license | //Quick Sort
#include<stdio.h>
#include<conio.h>
int partition(int a[],int left,int right)
{
int i=left,j=right,x=a[left];
while(a[i]<=x && i<left)
i++;
while(a[j]>x)
j--;
if(i<j)
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
a[left]=a[j];
a[j]=x;
return j;
}
void quickSort(int a[],int left, int right){
... |
C | UTF-8 | 1,607 | 2.828125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* convers_c.c :+: :+: :+: ... |
C | UTF-8 | 2,100 | 2.515625 | 3 | [] | no_license | #include <acirc.h>
#include <stdlib.h>
#include <gmp.h>
int
test(const char *fname)
{
acirc_t *c;
int err = 1;
printf("\n* %s *\n\n", fname);
if ((c = acirc_new(fname, false, false)) == NULL)
return err;
printf("ninputs: %lu\n", acirc_ninputs(c));
printf("nconsts: %lu\n", acirc_ncons... |
C | UTF-8 | 1,892 | 2.59375 | 3 | [] | no_license | #include "inttypes.h"
#include "cpu.h"
#include "ecran.h"
#include "stdio.h"
#include "stdbool.h"
#include "segment.h"
#include "time_print.h"
#include "processes.h"
#define QUARTZ 0x1234DD
#define CLOCKFREQ 50
static int compteur = 0;
void tic_PIT() {
compteur++;
char ch[9];
outb(0x20, 0x20);
snprintf(ch,... |
C | UTF-8 | 664 | 3.25 | 3 | [] | no_license | #define SUCCESS 0
#define INVALID_NULL_POINTER -1
#define OUT_OF_RANGE -2
typedef struct TStackInt TStackInt;
TStackInt *stack_createInt(int max); //Cria a pilha
int stack_freeInt(TStackInt *st); //Libera a pilha
int stack_pushInt(TStackInt *st, int a); //Insere na pilha (por ser um vetor, insere na ultima posição)
... |
C | UTF-8 | 20,976 | 2.78125 | 3 | [
"MIT"
] | permissive | /*
The MIT License (MIT)
Copyright (c) 2015 Terence Parr, Hanzhou Shi, Shuai Yuan, Yuanyuan Zhang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation... |
C | UTF-8 | 468 | 3.265625 | 3 | [] | no_license | #include <stdio.h>
void sort(int a[], int n)
{
int tmp;
for (int i = 0; i < n / 2; i++)
{
tmp = a[i];
a[i] = a[n - 1 - i];
a[n - 1 - i] = tmp;
}
}
int main()
{
int a[10], n;
printf("So phan tu mang la");
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
p... |
C | UTF-8 | 2,600 | 2.515625 | 3 | [] | no_license | /*
** parse_arg.c for plazza in /home/wautel_l/rendu/PSU_2014_zappy/serveur
**
** Made by lucie wautelet
** Login <wautel_l@epitech.net>
**
** Started on Tue May 12 15:15:12 2015 lucie wautelet
** Last update Sun Jul 5 17:47:36 2015 lucie wautelet
*/
#include "../include/serveur.h"
void my_stock_larg(char *str, t... |
C | UHC | 953 | 3.8125 | 4 | [] | no_license | // 442p 2
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main()
{
char words[10][21];
int cnt = 0;
do
{
char input[21] = { '\0' };
fputs("ܾ Է ( end Է): ", stdout);
scanf_s("%s", input, (unsigned int)sizeof(input));
if (!strcmp(input, "end"))
break;
strcpy_s(words[cnt++], size... |
C | UTF-8 | 2,194 | 3.796875 | 4 | [] | no_license | /*
You should use the statndard input/output
in order to receive a score properly.
Do not use file input and output
Please be very careful.
*/
#include <stdio.h>
#include <stdlib.h>
int Answer;
int static compare(const void *first, const void *second)
{
if (*(int*)first > *(int*)second)
return 1;
else if (*(i... |
C | UTF-8 | 1,714 | 3.09375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: ... |
C | ISO-8859-1 | 12,354 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xget.h"
#include "xvalidate.h"
#include "xArrayWork.h"
#include "xlook.h"
/*
--------------------------------------------ETIQUETAS------------------------------------------------->
Cambiar tipo de dato de las funciones:
*----> eGeneric*
*----> ... |
C | UTF-8 | 520 | 3.59375 | 4 | [] | no_license | //了解多种方法输入输出字符串
#include <stdio.h>
void main()
{
char str1[12],str2[12],str3[12];
int i ;
printf("用gets()/puts()输入/输出字符串(<12:)\n");
gets(str1);
puts(str1);
printf("用scanf()/printf()输入/输出单个字符(<12:)\n");
for(i=0;i<12;i++)
{
scanf("%c",&str2[i]);
}
for(i=0;i<12;i++)
{
printf("%c",str2[i]);
... |
C | UTF-8 | 612 | 4.0625 | 4 | [] | no_license | /* Tutorial 3 Question 1
**Group 5
**By: Carlos Fabregas
** Prompts the user for their first name, age and height then prints it back into console
*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char name[20];
int age;
int height;
//asks for user input
printf("What is your first name? ... |
C | UTF-8 | 248 | 2.78125 | 3 | [] | no_license | #include <stdio.h>
int main()
{
char c,r;
scanf("%c %c",&c,&r);
if((c=='S')&&(r=='R')||(c=='R')&&(c=='S'))
printf("R");
else if((c=='P')&&(r=='R')||(c=='R')&&(c=='P'))
printf("P");
else
printf("S");
return 0;
}
|
C | UTF-8 | 3,295 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define DEBUG 0
int N, K, max;
struct vertice {
int u, v;
};
struct vertice vertices[101];
// phd[point index][height][distance] = point count
int phd[101][101][101];
void rfn(int p, int pp) {
// 初始化,如果只有该点自己,则 height 和 distance 都... |
C | UTF-8 | 8,538 | 2.546875 | 3 | [
"MIT-Modern-Variant",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #include "vm/s-pagetable.h"
#include <stdio.h>
#include "threads/synch.h"
#include "threads/palloc.h"
#include "threads/malloc.h"
#include "threads/thread.h"
#include "userprog/pagedir.h"
#include "threads/pte.h"
#include "userprog/pagedir.h"
#include "userprog/syscall.h"
#include "userprog/process.h"
#inclu... |
C | UTF-8 | 282 | 3.046875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("enter the no");
scanf("%d",&n);
if(n>0)
{
printf("the no is positive");
}
else if(n=0)
{
printf("the no is zero");
}
else
{
printf("the no is negative");
}
getch();
}
|
C | UTF-8 | 3,869 | 2.734375 | 3 | [] | no_license | #include "s3.h"
/* prototype */
void getInput(char *instr);
void cmdToChild(int fd_toC[][2], char *instr);
void toChild(int fd_toC[][2], char *instr);
void test(int fd_toC[][2], int i);//to be deleted
char report_filename[100];
void analyzer();
float scoring(char *filename);
/* global variable */
int fd_t... |
C | UTF-8 | 1,100 | 2.59375 | 3 | [] | no_license | #ifndef GRID_H
#define GRID_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define LAST_ELMT -1
#define CONSTRAINT_SIZE 2
#define NB_OPERATORS 4
typedef enum
{
ROW_INDEX,
COL_INDEX,
CELL_SZ
} index_cell;
typedef enum
{
PLUS,
MINUS,
TIMES,
DIV,
EQ
} operation_t;
typedef struct
{
size... |
C | UTF-8 | 1,844 | 3.5 | 4 | [
"MIT"
] | permissive | #include "../utility.h"
/**
* 函数名:r_chol
* 功能描述:对称正定实矩阵的Cholesky分解
* 输入参数:mat 指向待分解 * 返回值的矩阵的指针
n 矩阵阶数
u 指向返回的下三角阵的指针
eps 精度要求,小于此值的数据认为是0
* 返回值:整型。运行成功则返回1,失败则返回0
*/
int r_chol(double *mat,int n,double *u,double eps)
{
int i,j,k;
double t;
if((mat==NULL)||(u==N... |
C | UTF-8 | 469 | 3.703125 | 4 | [
"CC-BY-3.0",
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
int x = 0;
int *intptr = NULL;
int *intptr1;
int *intptr2;
intptr1 = &x;
intptr2 = intptr1;
int intarray[] = {3, 5, 7, 9};
intptr = intarray;
printf("The value at intptr: %i\n", *intptr);
printf("The value at intptr + 1: %i\n", intptr[1]);
pri... |
C | UTF-8 | 507 | 4.0625 | 4 | [] | no_license | #include <cs50.h>
#include <stdio.h>
#define N 25
int main(void)
{
// declare the array, and store the first two values
int fibo[N];
fibo[0] = 0;
fibo[1] = 1;
// calculate and store the next 23 values
for (int i = 2; i < N; i++)
{
fibo[i] = fibo[i - 1] + fibo[i - 2];
}
// ... |
C | UTF-8 | 756 | 3.359375 | 3 | [] | no_license | #include <avr/io.h>
#include <util/delay.h>
#define BLINK_DELAY_ON_MS 1000
#define BLINK_DELAY_OFF_MS 700
int turn5OnQuicklyAndWait()
{
/* turn it back on */
PORTB |= _BV(PORTB5);
_delay_ms(200);
}
int turn5OffQuicklyAndWait()
{
// turn it back off quickly
PORTB &= ~_BV(PORTB5);
_delay_ms(200);
}
int ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.