blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
f11207ec0b219dd093e46b40238137fe2dfc2cdb | C | zheniantoushipashi/dnsProxy | /test/core/lxl_queue_test.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) {
... | true |
23ca1583c62aa25b122c151c21e907e1233dfd8f | C | sangeet123/tree | /src/lib/avl.h | 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... | true |
f2d79368a116642c9b2e0d89b65072ee168246b6 | C | Yinan-Hong/grade-1-c-languague | /lab9pb奇偶数组排序(数组).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]);
... | true |
be0384ddf5498caff05b7e5bdaea8a5518e1c417 | C | ftwftw0/LibftASM | /main.c | UTF-8 | 9,334 | 3.21875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... | true |
0f799b955df932be4d5eb01cc86d4d856c021203 | C | miketsikas/Compiler-and-VM-for-Alpha-programming-language | /symtablehash.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... | true |
62dc6cc9328345718be86532ae75dd07d19e851b | C | bhataprameya/Binary-Search-Tree | /bst.h | 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... | true |
c631669483a3df11937106dbd255496ed2925729 | C | dorianleveque/S7-ROBOT | /docs/WORKSPACE/BASE/FREERTOS_ROBOT/src/drivers/ServoCommand.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 ... | true |
bb5988186f0c68886639a4f94d9158c7b6056f80 | C | gawen947/libgawen | /sm-kr.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
... | true |
55c2b41e0c06f6bb2d57a209e11532bc1f1c492d | C | Yang-9520/led_gpio | /led_gpio_test.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]... | true |
35561256e4ad91ee9d6b8d63574869bc970e45d2 | C | Eviber/push_swap | /src/push_swap.c | UTF-8 | 2,071 | 2.65625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: ... | true |
0b216caabf76723a858e593f44c24fa7e877a92e | C | martindubois/Enseignement_C_Cpp | /Tic-Tac-Toc_Travail/Tic-Tac-Toc.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>
... | true |
6e5e509a2f7cf840671900f2ca6310bdacaab4cc | C | udhayaakash/Basic-c-pgms | /pro4.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++)
{... | true |
5e1c6da757deea0ea646364c94c09e24c1e7dbae | C | bunshue/vcs | /_7.cmpp/_c_test1/LinuxC/ch12/prog12-11.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);
}
| true |
d30f8ecb90c91b656f52722fc05bcec73e719d0a | C | AkshithBellare/year3sem5 | /pc301/class/quiz/test.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... | true |
1c487570f54250cf9f4b232e88cf29b1900e1cae | C | sarahanderson99/Intro-to-C-Programming | /Lab Assignments/lab12_b.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... | true |
589d42c4cbf7e80a5a99cb7e3ccb1e5b6f110420 | C | Jankaemper/Scalefree-Graphs | /shortest_path_main.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... | true |
07d23649855807c2e9e91c5bb842dd55cda1cddb | C | chokojung12/2015-2-system-programming | /실습/ch7/fifo_server/fifo_client.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)) < ... | true |
d0983e77bc2783cc9f26105768ac893a3f9dd7d7 | C | arif98741/basic-c-programming-codes | /Exercise/1134.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... | true |
e2a26d62025b6d96d345b2bb4db28672a53943f6 | C | gabrsar/projetos-graduacao | /Programação Paralela - Projeto 1/src/Client/mergesort.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;
... | true |
fabdd857296b2ad92cb9dd9b0eee902395155c81 | C | GucciGerm/holbertonschool-low_level_programming | /0x1A-sorting_algorithms/0-bubble_sort.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;
... | true |
4494e5b052d59bde3d9e56ec0761230e9e7dd049 | C | starlighto/4 | /ValueArray.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_... | true |
318bbe320d290bb0df169faf990377c9f017d562 | C | socrates77-sh/myDemo | /c/test32p21/KeySbr.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) //ֵ
{
... | true |
f49f2df9bfd3ba9e54b23ec22f1fd6601afe1c9a | C | IvanNotOnlyFAt/StudyNoteBook | /LinuxStudy/06_多线程/信号量/product_name_sem.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
*... | true |
f0d842c122860d99145700bfc441cf8e86b08533 | C | abugatto/Parallel-Computing | /OpenMP/Project2-code/mandel/pngwriter.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... | true |
0047935d6322f637af4c5ec8be4ce284eddfd563 | C | kamakeyo/bokgo | /Stage06/Stage06_05_#1546.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);
}
| true |
3e93b2c9c6354b570d0ba09e42868423b3525038 | C | g31pranjal/dsa2016 | /dsa/scc.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... | true |
080530a608764fc2a5ef855000b3bd29e1065735 | C | geshe-padishe/get_next_line | /rendu/get_next_line.c | UTF-8 | 3,552 | 2.96875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... | true |
e1db9c0ffe2ebbc9b244ddb7bbcfdc2388822c2c | C | aren42/Projets_42_C | /Push_swap/srcs/error.c | UTF-8 | 2,183 | 2.78125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error.c :+: :+: :+: ... | true |
a0f45b9fed52f8f093013bbcf98d98370addc027 | C | pj2/sight-reader | /src/main_window.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... | true |
fa9cf3b2203d82e27ae6be63ef8f1f7b49f75619 | C | evsyukov/corewar | /debug.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)
{
... | true |
c6a8e647858238020be630a24a834ce60a199b5b | C | Torbillon/Systems | /mini_bash/builtin.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... | true |
f9a08da812bbc3c9803a9680a7052381d6deb2e8 | C | xiqingping/embedded_template | /src/j1939/transceiver_platform.h | 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 ... | true |
241342720072d6d81a658f8c5d1f5dde118d4435 | C | morganwilde/c-study | /competition/gram/gram.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... | true |
a67cddaa982df79b1c1c335426a53fe190db5dd3 | C | functionxu123/raw_socket_play | /src/my_raw.cpp | 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... | true |
d0e390a6d754889a7b583f9c02a16db39c13cfab | C | twahlfeld/micro_irc | /srv_io.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... | true |
3e422df0bb1887971245709242013776d6304703 | C | gonzaemon111/AlgorithmC | /12/hanoi.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 から 杭... | true |
a608068388d68064cc86c56905571c23c2ab8e65 | C | ChatteNoir/TADStraido | /Algoritmo/5.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;
} | true |
3091f75d49b35da8f662ba73c17e98c9d0bcae50 | C | Sai-Gruheeth-N/DSA-lab-sem-3 | /week6/6a-Student/6aimp.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 ... | true |
9b69ea506c5088b81cdcffb9708f9ff83533bdf7 | C | lieroz/University | /Sem_03/DataStructuresCPP/Lab_08/graph.h | 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 {
... | true |
6f7ed3677208b3017d32825fcb8880278b4f70f3 | C | jdanielue/holbertonschool-low_level_programming | /0x12-singly_linked_lists/4-free_list.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);
}
}
| true |
c8de326a72eb93f90d5a2a7409520d5511331c37 | C | AndreiSheverda/test_andrei | /003_002/f_003_002.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... | true |
a0554448b1b373aca0eaeea423f6984c257252f9 | C | srishti-ranjan/Primaryy | /Basic/SmallestOf3_minVariable.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... | true |
3d67fa7c03a1c2c0ad61c3e7267952c2f038bdf3 | C | isabella232/AnghaBench | /source/freebsd/sys/cam/extr_cam_queue.c_camq_change_priority.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... | true |
018f1fedc607669b68cf8be5daa15acb189ede92 | C | bogdanoancea/c-programming | /p49.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... | true |
0b68aa5604a810415f7db6693c7a89dff5583ddc | C | k77frank/tankwars | /library/projection.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));
}
| true |
5f7c965c6c1af7549f40c9a59ebe792de2241987 | C | vtols/Scheme | /src/eval.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... | true |
783d20b066b88bdfbfd846d91c789a1001ad2380 | C | R11baka/c-exercises | /c11/pointersPlay/main.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) {
... | true |
eee4634427fa1a2484fe3d0282afd24bdddbcf1f | C | vagaband/linux | /learning/process_mmap_w.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... | true |
00e97c59701be750a2cabcc08a83f0ff87e7cd91 | C | ZhanXix/wangdao-training-camp | /C/homework/6_3-用头插法建立链表.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... | true |
311d096d07e409dc6a3f61ebe5d55758cf3653b3 | C | macosta-42/42 | /00_C_Piscine/Rush_00/ex00/rush04.c | UTF-8 | 1,905 | 3.15625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rush04.c :+: :+: :+: ... | true |
559c101d067fd33f9d77e5dcdb64139bdbd2219c | C | mi-kei-la/monty | /main.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... | true |
8cc73272b92969e5ed970624ae4b12088c31ac82 | C | luizrgguimaraes/APD | /APA/backtrackingPermutacoes.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... | true |
8c9b742f7029b285af16139f0c496e7a94008c7a | C | GiosueOrefice/Operating_Systems | /FIFO/1/fifo.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... | true |
9254ae493d9a7d89eaaf465fa7762224ddba021a | C | keithc2/Homework-2-Basic-C | /area_square_triangle.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... | true |
e13a788680cc6db64e7869e7e998f876b3a7361e | C | wouTERMINATOR/EindopdrachtMicro | /Microcontrollersopdrachten week 3/Week 3/B1/main.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... | true |
e52f9a5629b0ba9d2e0a5c784546bd7fdee2facd | C | sicaolong163/networkCode | /sicaolong/networkCode/network/libevent/fifo/read_fifo.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... | true |
47eb5390c6e950cb1686b1fd1d72a81fcb2829f7 | C | dorberu/Wisdom-Sakura-C | /ex21_30/ex22_1.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;
}
| true |
054e30fe870823b47f12c68fbf0656ca931ade76 | C | WooKimm/Homework | /Unix/tcp/tcp.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... | true |
454a1b0ff40e27d5016db1ae40c1fe4daccef80a | C | karsibali/solutions | /hackerrank/compare-the-triplets.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));
}
| true |
e511111302acbc081cd84b3e282a9ae9088e1d17 | C | FioPio/Grap | /programming/C/MandoBluetooth.c | UTF-8 | 1,074 | 2.765625 | 3 | [
"MIT"
] | permissive | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Bluetoot control using a snake byte device *
* *
* * * * * * * * * * * * * *... | true |
7f71d8687cf5bb5f2699ab80f7bf683c6e3eee21 | C | kippesp/CSE6230-Project1 | /local_mm.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... | true |
aaa83bbd770ca50e06049f08d04e3ddd41a168a7 | C | zhmu/ananas | /external/gcc-12.1.0/libgcc/config/arm/fp16.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... | true |
96eeb7628d0389f249b34d3789ba4c7bd86d3c37 | C | super7ramp/Leonard | /src/shortest_path/shortest_path.h | 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... | true |
427a9ae9ee06e7387baa96a8c38c4ab5eae84764 | C | liuzhezhe123/nginx_fastcgi | /webserver/service/include/web_structure.h | 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)
{... | true |
5e69c1da2d4c9044444b275276e96a3bc38c89ca | C | tdcwilliams/MatlabLibrary | /OP_progs/OP_numint_laguerre.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... | true |
e576e45dfdfcd2078fa7f275954f6e57e21c6d50 | C | Samundrakarki/cProgamming | /a3_p8.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) ){
... | true |
85b4074b4818e810a3aa7dac7074ab0b9f2bdf30 | C | tommwq/demo | /Toolkit/PrintErrno/PrintErrno.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>
... | true |
cd41cefc83d810904b49eaffefe3f92753d93398 | C | Wineet/C-Codes | /basic_codes/stringFunction.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 *);
... | true |
ef537632712aa874979e9554e33dce7df2dd1479 | C | bpfender/Programming-in-C | /Lab Exam/part3.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... | true |
e73cad307a0813e1c76cf53a525545257d480a4f | C | neleai/mthyst | /regreg/memo.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)
... | true |
822034756b207b3fe6b807b4667d9d74cacfc0d8 | C | iper4497/codigo_c | /freebios-20010708/src/superio/SMC/fdc37b807/superio.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 ... | true |
6533c5bf86df80fc17cb444e79a71e35d0418ffa | C | CACTUS-Mission/TRAPSat | /TRAPSat_cFS/cfs/apps/vc0706/fsw/src/vc0706_mux.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 ... | true |
d00176009d62d7e7907b7efe8b527ef7f47beee8 | C | computersciencebenHolberton/holbertonschool-low_level_programming | /0x0B-malloc_free/3-alloc_grid.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 *)... | true |
b9ec677ad720831a6701bfaad702dc8b5822855a | C | Bala16092000/S5 | /SS Lab/prod-cons (copy).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: ... | true |
e4096f0c26f3c4bc7e38e11ffdca619c487f24c5 | C | SwrkNRK/UdSP | /CV4/DU.h | 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"; ... | true |
423931bfe0aa06f802de2429591c8f50c843ef6f | C | hanxuwu/Learning-C | /DateStructureAlgotithm/Leetcode/572.SubtreeofAnotherTree/SubtreeofAnotherTree.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... | true |
94a2365118428cd6afea9dbf7a0836650fb75db0 | C | asabeeh18/PROgrammin | /C/Algorithms/quick_sort.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){
... | true |
421943a0962075c748f9e3c11e41ca9e6689e7b8 | C | gdu-bus/19Cursus | /ft_printf/convers_c.c | UTF-8 | 1,607 | 2.828125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* convers_c.c :+: :+: :+: ... | true |
b1ab8e25d12f335551f2fadc78b3008c935c56c1 | C | amaloz/libacirc | /t/test_circ.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... | true |
1c76e5a992bf7bbb0dce57f7cb98d5916b363db4 | C | sha256-mercury/mini_kernel | /time_print.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,... | true |
1469bf2d3349ca633fb34ba7caa454ce9520ec5a | C | VictorBuiatti/Projetos-Pessoais | /Estruturas de Dados (Linguagem C)/Pilha-Stack/Stack 6/TStackInt.h | 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)
... | true |
f524b5274c342f739a4c877162d7f83ab7fbfb9c | C | langwich/runtime | /malloc/merging/test/merging_basic_tests.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... | true |
239023db66a3ce893552945e62e1693b1c7b7698 | C | hthMMII/Cintro | /week10/10_8.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... | true |
cfc9da0dd4a9ef3532e1dfbd03fda51298e5b667 | C | Aiscky/Zappy | /serv/parse_arg.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... | true |
07815fb3aa28c5f22ca6fec6129987eaa89c06c3 | C | jin519/ThisIsC | /src/chap-14/challenge-02/main.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... | true |
00743e4cc802cc84ee5a26c1054833f6b3f0df4b | C | shyun-ab/Algorithm-Study | /Codeground/Codeground/programming_contest.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... | true |
1f70e34b98408f8f5009b75845b5bc174a776717 | C | blavonne/fdf | /libft/ft_itoa.c | UTF-8 | 1,714 | 3.09375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: ... | true |
ba38068df996301635716ac6106c16ce4b88ca47 | C | Xargam/XARGAM_LABORATORIO-1 | /Practica parciales-Finales/Final 3/xArrayWork.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*
*----> ... | true |
2033158b98afdb7a2e9e02c549ff686595485de4 | C | Jeromecloud/C_practice | /7.7.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]);
... | true |
1a041ccff4caf8d27cb7911fdd0d916f4a2b2209 | C | NavjotAulakh/UOIT-OS-Group10 | /tutorial3/question1.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? ... | true |
617466486824d4282847279273f2a53a1bba0729 | C | Poornimaaj/C-Programming | /PLAYER_LEVEL/SET-20/stone_paper_scissor.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;
}
| true |
778f53c04fffe5e033aa852c4d1e459f34259bbd | C | wuxingyu1983/HackerRank | /FarVertices/main.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 都... | true |
3ee8f685320ef83bf57bd36c5d7690f2631e9fd1 | C | yeonsuyam/os | /src/vm/s-pagetable.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... | true |
ed66e323a3c31e209211d51a8e4d4b5965324e46 | C | vivitharamakrishnan/vivi | /positive.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();
}
| true |
d45cc979daa2fe6d1a447ddcb6b1e84d93d1c615 | C | JeremyLIU1997/OS-Project | /s3.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... | true |
b0e68066c713b236da8b4d3c2908b7c71a8d494b | C | edupland/kenken | /include/grid.h | 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... | true |
73d497c5a3d019b54fb911f7527b640a2040a52a | C | jiangxincode/CppTest | /CLAH/Chap04/r_chol.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... | true |
68445edbd2e8dd9a6047b51d2d12e10a10aa2b57 | C | OScott19/TheMulQuaBio | /lectures/BiolStructs_C/Day4_Code/ptrsref.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... | true |
8b40fd3158a97104c7c536aefc098c565762083c | C | lee-teresa/Fall2017 | /week3/ex5_iteration.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];
}
// ... | true |
4d16b89b6e750949b47b1f4239b7de9460ba695a | C | mstaffeld/AVRSpike | /led.loop.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... | true |