blob_id large_stringlengths 40 40 | language large_stringclasses 1
value | repo_name large_stringlengths 4 124 | path large_stringlengths 2 969 | src_encoding large_stringclasses 35
values | length_bytes int64 6 2.95M | score float64 2.52 5.44 | int_score int64 3 5 | detected_licenses large listlengths 0 58 | license_type large_stringclasses 2
values | text stringlengths 9 2.95M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
066aab1df27e95f7bda98f1f0032c51c8e39744f | C | PaulWendt96/cs240lx-20spr | /labs/15-watchpoint/code/bit-support.h | UTF-8 | 1,603 | 3.65625 | 4 | [] | no_license | #ifndef __PI_BITSUPPORT_H__
#define __PI_BITSUPPORT_H__
// some simple bit manipulation functions: helps make code clearer.
// set x[bit]=0 (leave the rest unaltered) and return the value
static inline
uint32_t bit_clr(uint32_t x, unsigned bit) {
assert(bit<32);
return x & ~(1<<bit);
}
// set x[bit]=1 (leave... | true |
bd2f1e8430544842954376d40c9eed15676aaeff | C | bornbygoogle/Piscines101-Juillet-2018 | /Days/Day11/ex06/main.c | UTF-8 | 1,814 | 2.9375 | 3 | [] | no_license | /* ************************************************************************** */
/* LE - / */
/* / */
/* main.c .:: .:/ . .:: ... | true |
a4187b4382c33f9cea4f7b02a7a1faa9cc1d8f83 | C | sheng09/Seismic-Field-Works | /src/DTime.c | UTF-8 | 2,094 | 3.328125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "libtime.h"
#include "liberrmsg.h"
static char HMSG[]=
{"\
Description: Calculate dt for {D T - F Y}, return value is in seconds.\n\
Usage: %-6s (-Dyyyy/mm/dd | -Jyyyy/ddd)\n\
(-Thh:mm:ss.sss)\n\
(-Fyyyy/mm/dd ... | true |
689ac70c41dba090c1a4ce15f02400ec3a5cca9a | C | dianamateus10/MIEI-UMINHO | /1Ano_2Semestre/PI/Ficha1/triangulo.c | UTF-8 | 85 | 2.578125 | 3 | [] | no_license | void triangulo (int n);
int main ()
{
int n;
triangulo (n);
return 0;
}
| true |
f635a79e3c5550be475ab5f15f67a70584dd15c4 | C | yangboyubyron/PTA_exercise | /简单计算器/简单计算器/简单计算器.c | GB18030 | 674 | 4.03125 | 4 | [] | no_license | #include<stdio.h>
int main()
{
int number1, number2;
int flag; //ƴϢ
char ch;
scanf("%d", &number1);
flag = 1;
while ((ch = getchar()) != '=')
{
scanf("%d", &number2);
switch (ch)
{
case '+': number1 += number2; break;
case '-': number1 -= number2; break;
case '*': number1 *= number2; break;
c... | true |
80fad8ac11db4c07d5231a67d968a46d4e87335f | C | saehyen/C_Algorithm | /dealwithchar.c | UHC | 507 | 3.9375 | 4 | [] | no_license | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
// Ķͷ ־ ڿ const ־ϴ. Ϸ ڿ ؼ ϼ.
bool solution(const char* s) {
bool answer = true;
int len = strlen(s);
if (len != 4 && len != 6) return false;
for (int i = 0; i < len; i++) {
if (s[i] >= '0' && s[i] <= '9') {
continue;
... | true |
2ab7656a743e3207896599befd9f3b4f8ec0f8b3 | C | sbres/malloc | /init_pages.c | UTF-8 | 1,649 | 2.890625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* init_pages.c :+: :+: :+: ... | true |
da154f69dd8582cd3538a31d13a079c99f428f44 | C | cricun/Fillit | /libft/srcs/ft_vecresize.c | UTF-8 | 281 | 2.59375 | 3 | [] | no_license | #include "libft.h"
void ft_vecresize(t_vector *vec)
{
char *tmp;
if (!vec || !(tmp = (char*)malloc(vec->max * 2 + 1)))
return ;
ft_memmove(tmp, vec->arr, vec->len);
*(tmp + vec->len + 1) = 0;
free(vec->arr);
vec->arr = tmp;
vec->max *= 2;
} | true |
4292de2691f9d27a9cf436e4b2e49a6277f22caa | C | Emma321-byte/alx-low_level_programming | /0x01-variables_if_else_while/5-print_numbers.c | UTF-8 | 358 | 3.34375 | 3 | [] | no_license | #include <stdlib.h>
#include <time.h>
#include <stdio.h>
/* more headers goes there */
/**
*main-use print
*Return: print ten numbers from zero
*/
/* betty style doc for function main goes there */
int main(void)
{
int count;
/* your code goes there */
for (count = 0; count < 10; count++)
{
printf("%d", coun... | true |
31b1b958bc024d7ede4a8dc2769a2156c8202943 | C | SGazanchian/Caesar-Cipher-decoder | /placer.c | UTF-8 | 2,139 | 2.890625 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "Constraint.c"
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
void writeToFile(char text[]){
FILE *fptr;
fptr = fopen("placer.txt","w");
... | true |
1f7aeef812f1831aace490b1c54bcae7cf73ded7 | C | I-Dont-Remember/project-euler-solutions | /c/src/p3.c | UTF-8 | 1,252 | 3.90625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
/*
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
*/
//http://www.puzzles9.com/how-to-find-prime-numbers-how-to-check-if-a-number-is-prime/
int is_prime(long... | true |
829be9102ba1428f7b7fa061935b86da584a6fbd | C | YosenChen/SoftwareArchitectureDesign | /OOLikeC-2/main.c | UTF-8 | 1,913 | 2.96875 | 3 | [] | no_license | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "Interface.h"
int main(void)
{
FILE *fp = fopen("out.txt", "w");
struct Interface *pInterfaceA = 0, *pInterfaceB = 0;
struct Interface *pInterfaceA_2 = 0, *pInterfaceB_2 = 0;
printf("This is OO-like C program test\n");
if (!fp)... | true |
dcbd4348476156cbc9cf901db8990dbd27b0e712 | C | divinivi/GUVI | /reverseme.c | UTF-8 | 574 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include<string.h>
int main()
{
int length,i,j;
scanf("%d",&length);
char str[length+1];
scanf("\n%[^\n]s",str);
for(i=0;str[i];i++){
if(str[i]=='a' ||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u'){
for(j=i+1;str[j];j++){
str[j-1]=str[j];
... | true |
5890d4bcf7c9005a8b3d7b0746a3da592f414acf | C | mdambrev2/42 | /projet_en_cour/libft/fork_execve.c | UTF-8 | 1,588 | 2.65625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fork_execve.c :+: :+: :+: ... | true |
a315f409836fee580c4bab507d15559d3c8bedcd | C | Linkadoo/tsea81 | /assignment3/main.c | UTF-8 | 3,982 | 3.09375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
#include "lift.h"
#include "si_ui.h"
// Unfortunately the rand() function is not thread-safe. However, the
// rand_r() function is thread-safe, but need a pointer to an int to
// store the curren... | true |
d00f37a9d12496635975e3ccdb73365e5eb703c3 | C | dougschneider/UVA | /adHoc/UVA1124.C | UTF-8 | 190 | 2.578125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
char ch;
while(true)
{
cin.get(ch);
if(!cin)
break;
cout << ch;
}
return 0;
}
| true |
628850820dd549ec015ff42352fee3abf092eddf | C | joaofbravo/Prog2015 | /gtk3/Inicio/Gtk3_08_01.c | UTF-8 | 3,721 | 2.5625 | 3 | [] | no_license | /*****************************************************
* *
* spin button *
* *
* GTK+ 3 *
* Versao: 1.0 ... | true |
e52e827ce1be89431c05148d8340003e71430d9c | C | StartMilandr/MDR_Pack_v6 | /PACK_Gen/Files/ThirdParty/HSRPRP/MDR_HSRPRP_ProxyTable.c | UTF-8 | 1,334 | 2.53125 | 3 | [] | no_license | #include "MDR_HSRPRP_ProxyTable.h"
#include <MDR_Ethernet_FrameDefs.h>
#include "MDR_HSRPRP_Config.h"
typedef union {
uint32_t loMAC32;
uint16_t hiMAC16;
uint16_t busy;
uint32_t timeRX;
} MDR_ProxyItemMAC;
MDR_ProxyItemMAC _TableMAC[HSR_ProxyNodeTableMaxEntries];
bool MDR_ProxyTable_HasMAC(uint8_t *MAC... | true |
f78a718281d8e56c4584fb4beadbe8a1a9236deb | C | Joyanta1000/C-Code-problems | /itera2.c | UTF-8 | 431 | 3.171875 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#define tol .0001
float g(float x)
{
return 1/(sqrt(1+x));
}
int main()
{
int i=1;
float x,x1,x2;
printf("Enter the value of x1\n");
scanf("%f", &x1);
printf("x1\t\t x2\t\t g1\n");
do{
x2=x1;
x1=g(x1);
i++;
printf("%f\t %... | true |
285620e0b8e43bb386dbe45c265d05c571696510 | C | golliet/42-Ft_printf | /includes/ft_printf.h | UTF-8 | 1,588 | 2.625 | 3 | [] | no_license | #ifndef __FT_PRINTF_H
# define __FT_PRINTF_H
# include "libft.h"
# include <stdarg.h>
# include <stdlib.h>
# include <stdbool.h>
# include <limits.h>
# define error -1
# define BUFFER_SIZE 4096
typedef struct s_flags
{
bool flag_plus;
bool flag_less;
bool flag_space;
bool flag_zero;
bool f... | true |
699abc7f28921a6da773a9ad6b1daf5b00332ed3 | C | saligantipremraj/c_programs | /premraj/programs/print_*_alphabet_pattern.c | UTF-8 | 578 | 3.59375 | 4 | [] | no_license | #include<stdio.h>
void main()
{
int i,j,k,n,count = 0;
char ch = 'a';
printf("enter the number of rows to print\n");
scanf("%d",&n);
for(i = 1 ; i <= n ; i++)
{
for(j = 1 ; j <= n-i ; j++)
{
printf(" ");
}
for(k = 1 ; k <= i ; k++)
{
printf("*")... | true |
d8a5b849b943618366801828ffefa700f3b06c60 | C | deater/vmw-meter | /svmw-meter/src/tools/resistor.c | UTF-8 | 947 | 3.25 | 3 | [] | no_license | /* I used this program to brute force the 5/8 voltage divider */
/* needed by the i2c chip as my hand-attempts never worked right */
#include <stdio.h>
#include <math.h>
#define NUMBER 48
double values[NUMBER]={
100.0,110.0,120.0,130.0,150.0,160.0,180.0,
200.0,220.0,240.0,270.0,
300.0,330.0,360.0,390.0,
... | true |
f0bb1a68596be4e6691ce7cb7e30a6483c55c6b1 | C | Azowyl/TP-Sisop | /handlers.c | UTF-8 | 4,096 | 3.46875 | 3 | [] | no_license | #include "decls.h"
#include <stdbool.h>
#define LEFT_SHIFT 16
/**
* Handler para el timer (IRQ0). Escribe un carácter cada segundo.
*/
static const uint8_t hz_ratio = 18; // Default IRQ0 freq (18.222 Hz).
void timer() {
static char chars[81];
static unsigned ticks;
static int8_t line = 20;
static uint8_t idx... | true |
38f1c2c8b73b0a6696da7a1cbab5953f878bb27b | C | banditopazzo/Sala-Cinema | /client.c | UTF-8 | 8,413 | 2.984375 | 3 | [
"MIT"
] | permissive | #include <sys/socket.h> /* socket definitions */
#include <sys/types.h> /* socket types */
#include <arpa/inet.h> /* inet (3) funtions */
#include <netdb.h> //gethostbyname, ecc
#include <stdio.h> //input-output printf
#include <string.h> //operazioni su... | true |
4f6e16299ca06a3dab37f335fee34944d0291e62 | C | JulienMalka/DistributedHTable | /pps-dump-node.c | UTF-8 | 5,201 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "ctype.h"
// for basic socket communication
#include <sys/socket.h>
#include "error.h"
#include "system.h"
#include "network.h"
#include "config.h"
#include "hashtable.h"
#include "network-utils.h"
size_t parse_kv_pairs(const char *in_msg, ssize_t length, size_t starti... | true |
4c6a42ffe9d3490f313d01a77d317c674cbcd0b4 | C | ayakatakuriko/pseudo-dhcp | /server.c | UTF-8 | 5,689 | 3.125 | 3 | [] | no_license | /**
*@brief DHCP server
*@author ayakatakuriko
*@date 2018/12/14
* */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <inttypes.h>
#include "server.h"
#include "utility.h"
#include "dhcp.h"
/**
* @biref クライアントを双方向リストの最... | true |
55e3b261846a7e457f93acd8d4cd63d5ca0c98bd | C | kennedy-han/myCcode | /ch1_introduction/while.c | UTF-8 | 367 | 3.75 | 4 | [] | no_license | #include <stdio.h>
main()
{
float fahr,celsius;
int lower,upper,step;
lower = 0; //温度表的下限
upper = 300; //温度表的上线
step = 20; //步长
printf("Celsius Fahr\n");
celsius = lower;
while(celsius <= upper){
fahr = (9.0 * celsius) / 5.0 + 32.0;
printf("%3.0f\t%6.1f\n",celsius,fahr);
celsius = cel... | true |
7356c90ff2a679153de7f0892b79d82eba8dcddb | C | metryczka/CS_50 | /Problem Set1/Cash/cash.c | UTF-8 | 919 | 3.75 | 4 | [] | no_license | #include <stdio.h>
#include <cs50.h>
#include <math.h>
int main(void)
{
//Ask the user for amount of change (only positive)
float change;
do
{
change = get_float("Change owed: ");
}
while (change < 0);
// change dollars for cents
int cents = round(change * 100);
// define th... | true |
463ccff9728beb67910cf6c421ad407efe9c6e4e | C | vinifcastro/Lista-5-IPCC | /ex24.c | UTF-8 | 632 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
#define N 1000
void swap(int * x, int * y);
int main(){
int i, n, a[N], k;
scanf("%d", &n);
for (i=0;i<n;i++) {
scanf("%d", &a[i]);
}
for (i=0;i<n;i++) {
for (k=0;k<n;k++) {
if (a[i] == a[k] && i!=k) a[i] = -100000000;
}
}... | true |
58b9aa4b8dc016831832a97c333e17e113506ed7 | C | YannnnR/badapple_stm32f103c8t6_olde12864 | /stm32f103c8t6_badapple/HARDWARE/LED/led.c | GB18030 | 852 | 2.59375 | 3 | [] | no_license | #include "led.h"
#include "stm32f10x.h"
#include "delay.h"
void LED_Init() {
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //ʹ PB ˿ʱ
//nled
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14; // pin10
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //
GPIO_InitStructure.GPI... | true |
ed3f3795ee41cd8564967bba7ea725a7e10e524c | C | JustIT-USY/wangyujie- | /结构体.c | WINDOWS-1252 | 594 | 3.296875 | 3 | [] | no_license | #include<stdio.h>
typedef struct date
{
int year;
int month;
int day;
}DATE;
typedef struct student
{
long studentID;
char studentName[10];
char stdentSex;
DATE birthday;
int score[4];
}STUDENT;
int main()
{
STUDENT stu1 = {100310121, "",'M', {1991,5,19},{72,38,90,82}};
STUDENT stu2;
stu2 ... | true |
c765c8571ad0498cc1e537fe8c94223f5cb5d258 | C | manproffi/push_swap | /ft_printf/for_wchar.c | UTF-8 | 2,550 | 2.875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* for_wchar.c :+: :+: :+: ... | true |
75ea1e91d0ecea23214035901d384f097f2138f8 | C | vladdy-moses/ulstu-ivk-os-2019 | /labworks/lw03/Kayashov/3.3.c | UTF-8 | 1,760 | 3.078125 | 3 | [] | no_license | #include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
/*Задание: напишите программу, создающую процесс-зомби. Выведите
на экран его pid и посмотрите в другом окне терминала, как обозначается
данный процесс при вызове команды просмотра состояния процессов (ко-
манда ps)*/
int main()
{
pri... | true |
477572d1017054fcc1e573cd9ae748c9d294215d | C | plaes/airown | /src/ao_util.c | UTF-8 | 2,796 | 2.515625 | 3 | [] | no_license | /*
* Airown - utility functions
*
* Copyright (C) 2010 sh0 <sh0@yutani.ee>
*
* This program 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 2 of the License, or
* (at your option) any la... | true |
b13d9d76097b15ae1af379696e7333b9d6dd8632 | C | mbrodersen/certikos | /kernel/boot/lib/cprintf.c | UTF-8 | 1,400 | 3.125 | 3 | [] | no_license | // Implementation of cprintf console output for user environments,
// based on printfmt() and cputs().
//
// cprintf is a debugging facility, not a generic output facility.
// It is very important that it always go to the console, especially when
// debugging file descriptor code!
#include <types.h>
/* #include <spinl... | true |
66ee9edbe2ad47e9eaab9f140fc8d819a5485d2b | C | AlexFanw/HUSTER-CS | /系统综合能力—虚拟机/ics2019/nemu/src/monitor/debug/log.c | UTF-8 | 820 | 2.625 | 3 | [
"MIT"
] | permissive | #include "common.h"
#include <stdarg.h>
FILE *log_fp = NULL;
void init_log(const char *log_file) {
if (log_file == NULL) return;
log_fp = fopen(log_file, "w");
Assert(log_fp, "Can not open '%s'", log_file);
}
char log_bytebuf[80] = {};
char log_asmbuf[80] = {};
static char tempbuf[256] = {};
void strcatf(char... | true |
dfa5af0741c7a576b5a3267ed37494ceb9f04404 | C | Mordalsin/C_Burns | /Preprocess/Preprocess/preprocess.c | UTF-8 | 581 | 2.96875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define COMBINE_STRING_LITERAL(x, y) x##y
#define PREPARE_COMBINE_STRING(x, y) COMBINE_STRING_LITERAL(x, y)
#define STRING_IN_QUOTES(a) #a
#define PREPARE_STRING_IN_QUOTES(a) STRING_IN_QUOTES(a)
#define BUFF_SIZE 64
/***************************************************... | true |
313386063a74076156654c2c4af9440d6cf3338f | C | rafaeldaily/MTP2018-1 | /P7.c | WINDOWS-1250 | 374 | 3.578125 | 4 | [] | no_license | //Nome: Rafael Daily Santos Martins
//Matrcula: 11721EEL001
#include <stdio.h>
int a (int m, int n)
{
if(m==0)
return n+1;
else if(m>0 && n==0)
return a(m-1, 1);
else if(m>0 && n>0)
return a(m-1, a(m, n-1));
}
int main ()
{
int m, n;
printf("Digite m: ");
scanf("%d", &m);
printf("\nD... | true |
1dd1a3f246b6c27164b37b1c3b7016b237deecc3 | C | pratima2011patel/c-programs | /APARA4.C | UTF-8 | 180 | 2.765625 | 3 | [] | no_license | #include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
as();
getch();
}
int as()
{
int b=2,h=3,area;
area=b*h;
printf("The Area of Parallelogram is :-%d",area);
} | true |
86b8c79792da2cc9d19be237f29595f7ed8844bd | C | nguyencanhtrung/SDSoC | /XUP/source/lab3/lab3a/src/lab_design.h | UTF-8 | 1,436 | 2.984375 | 3 | [] | no_license | /*
* lab_design.h
*
* Created on: May 28, 2015
* Author: shaunpur
*/
#ifndef LAB_DESIGN_H_
#define LAB_DESIGN_H_
/* includes */
#include <inttypes.h>
#define BLUE_MASK 0x000000FF
#define GREEN_MASK 0x0000FF00
#define RED_MASK 0x00FF0000
// pull out the color component and return as... | true |
6a4b5583c54c654c83ddc024d72a062ac5a2779c | C | hhyyzimu/zyy | /program/my_strcmp.c | UTF-8 | 355 | 3.59375 | 4 | [] | no_license | #include <stdio.h>
int main()
{
char a[40];
char b[40];
printf("a=");
scanf("%s",a);
printf("b=");
scanf("%s",b);
int i=0;
for(i=0;a[i]!='\0' && b[i]!='\0';i++)
{
if(a[i]!=b[i])
{
break;
}
else
{
continue;
}
}
if(a[i]=='\0' && b[i]=='\0')
{
printf("相等\n");
}
else
{
printf("不相等... | true |
bc55915e2d5ca8a3acaf17eb1ca1b4317912446b | C | sidpka/Data_Structures | /Heap_TouranmentAmongGroupOFArrays.C | UTF-8 | 3,442 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
struct HeapNode{
int* Array;
int count;
int index;
};
typedef struct HeapNode HNode;
HNode* NewNode(int count){
HNode* newNode=(HNode*)malloc(sizeof(HNode));
newNode->index=0;
newNode->count=count;
newNode->Array=(int*)malloc(sizeof(int)*new... | true |
4af6498258ff5ffa34a0a5c6b1e042ae98dccd1f | C | WojciechMula/wikibooks-posix-threads | /pthread_setschedparam.c | ISO-8859-2 | 3,277 | 3.34375 | 3 | [] | no_license | /*
* Przykadowy program dla kursu "POSIX Threads" z wikibooks.pl
*
* Temat: priorytety wtkw
*
* Autor: Wojciech Mua
* Ostatnia zmiana: 2010-03-xx
*/
#define _XOPEN_SOURCE 500
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <sched.h>
#include <errno.h>
#include <unistd.h>
#define test_errno... | true |
aa2f1a621f2dc686246e3b1196827109f50e38b0 | C | tetsu5555/c_study | /ex7/ex7-1.c | UTF-8 | 701 | 3.890625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#define ARRAY_SIZE 13
int linear_search (int array[], int n, int key)
{
int i;
for (i = 0; i < n; i++) {
if (array[i] == key) {
return i;
}
}
return -1;
}
void print_array(int array[], int n)
{
int i;
for (i = 0; i < n; i++) {
printf("%d ", array[i])... | true |
241451b2e46eec163c5e0f5fd9f5868a4234b7ce | C | 2014-andy/apue2 | /12-thrctl/10-thrio/thrio.c | UTF-8 | 1,765 | 3.5625 | 4 | [] | no_license | #include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <pthread.h>
char buf1[1024];
char buf2[1024];
int fd;
void *thr_rtn(void *arg)
{
int n;
if ((n = pread(fd, buf1, 1024, 3)) < 0) {
printf("thread 1: pread error: %s\n", strerror(errno));
return (void *)1;
... | true |
9753e5a34a7bf3963c039d5972ccc3df83b7cf41 | C | EldarNomin/libft21. | /ft_striteri.c | UTF-8 | 743 | 3.6875 | 4 | [] | no_license |
#include "libft.h"
/*This function applies the parameter function f to each character of a string
* also passed in it's parameter at at precisely that character's index string
* position. Each character that is passed into the function f is modified if
* necessary.*/
void ft_striteri(char *s, void (*f)(unsigned... | true |
475fa68809f7daccfe4ada8d0f8c20366050a9e0 | C | h-bekker/Kurs1-2 | /rest/puzyri.c | UTF-8 | 359 | 2.890625 | 3 | [] | no_license | #include <stdio.h>
int a[1005];
void puzyr(int n) {
int i,j,t;
for (i=1; i<=n-1; i++)
for (j=1; j<=n-i; j++)
if (a[j]<a[j+1]) {
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
return;
}
int main() {
int n,k;
int s=0;
scanf("%d",&n);
for (k=1; k<=n; k++)
scanf("%d",&a[k]);
puzyr(n);
for (k=1; k<=n; k+=3)
... | true |
7ed8397cc41e7f37e550958732880c476b44fd71 | C | AbhilakshGoel/C | /Worker-Efficiency.c | UTF-8 | 438 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
//#include<conio.h>
int main()
{
float tim;
//clrscr();
printf("Enter the Time taken by the Worker to Complete the Work(In Hrs): ");
scanf("%f", &tim);
if(tim>=2 && tim<3)
printf("You are a Highly Efficient Worker");
else
if(tim>=3 && tim<4)
printf("You must Improve your Speed");
else
if(tim>=4 && t... | true |
cb882371dba29fc0e2d5540bb0a2bcca73bf3765 | C | NationalSecurityAgency/ghidra | /Ghidra/Extensions/SleighDevTools/pcodetest/c_src/BIOPS_BODY.c | UTF-8 | 4,595 | 2.9375 | 3 | [
"GPL-1.0-or-later",
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | true |
0043d5214382c209823c19ab0ab4215ffe9408d3 | C | projectceladon/ikgt-core | /include/lib/string.h | UTF-8 | 3,596 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2015-2019 Intel Corporation.
* All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
*/
#ifndef _SPRINTF_H_
#define _SPRINTF_H_
#include "vmm_base.h"
/* maximum string length */
#define MAX_STR_LEN 0x1000
/* The strnlen_s function computes the length of the string pointed to by str... | true |
08d747627a2495f8400bcb4e600701af84126337 | C | brunohadlich/Programming-Studies | /assembly/intrinsics/intrinsics.c | UTF-8 | 9,631 | 2.984375 | 3 | [] | no_license | //gcc -Wall -march=haswell -std=c11 -O2 -o a.out source_file.c
//clang -std=c11 -mavx avxvec.c -o avxvec
#include <x86intrin.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void clear_array(float *array, int size)
{
for (int i = 0; i < size; i++)
array[i] = 0;
}
void fill_from_to(float *array,... | true |
6a6a1942f4e812a407b3e9f193301ead7f4fde8c | C | PawelMielanczyk/sieci_bramek | /src/file_reader.c | UTF-8 | 3,697 | 3.375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include "file_reader.h"
#include "line_reader.h"
enum file_phase_t {
INPUT_PHASE,
OUTPUT_PHASE,
NODES_PHASE
};
typedef enum file_phase_t File_phase;
Logical_circuit* read_logical_circuit_file(char* filepath) {
FILE *file;
File_phase file_phase = INPUT_PHASE;... | true |
20084ef1b29815e505123bcc0cb3d5101712a5ef | C | ayundina/lem_in | /srcs/ft_paths_better_eval.c | UTF-8 | 2,612 | 3.09375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* :::::::: */
/* ft_paths_better_eval.c :+: :+: ... | true |
15e633b18dc94a1a5449fb026a961e60cdc73b73 | C | elievatine/Projet_Tech_1 | /Projet/BSQ/src/switch.c | UTF-8 | 1,178 | 3.359375 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2017
** switch.c
** File description:
** each carac on a string
*/
#include "../include/included.h"
int get_line(char **map)
{
int x = 0;
while (map[x] != NULL)
x++;
return (x);
}
void my_sw(int **map)
{
for(int y = 0; map[y]; y++)
{
for(int x = 0; map[y][x] != -1; x++)
{
if (... | true |
9d8f9ed5f176e907a1258e0f2a1b2f8a944dfd2b | C | msymkany/Push_swap | /push_swap.c | UTF-8 | 2,229 | 2.75 | 3 | [
"MIT"
] | permissive | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: ... | true |
6819a16732203d804626894dc7031bc314f3d40d | C | calebsander/compsci | /3/FandR/getLine.c | UTF-8 | 965 | 4.3125 | 4 | [] | no_license | /* getLine.c
* Implements the getLine function for CS 3 Lab 2
* Alex Lew
* 11/8/15
*/
#include <stdlib.h>
#include <stdio.h>
#define DEFAULT_ALLOC_SIZE 10
/* Read the next line of the standard input into a newly allocated
* buffer. Returns a pointer to that buffer if successful. If unable
* to allocate memory,... | true |
0f533d5b234bb9193847cbb3e2e60e8f2f88f21e | C | Dempaws/IOI | /1/7/grandefete/main.c | UTF-8 | 404 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main(int ac, char **av)
{
int input;
int startc;
int endc;
int start;
int end;
int current;
scanf("%d%d", &start, &end);
scanf("%d", &input);
current = 0;
while (input--)
{
scanf("%d%d", &startc, &endc);
if (startc <= end && endc >= start)... | true |
8ce4ba540c55be7e3e693d69e9effeb2a1b06f24 | C | OhYea777/Minix | /src/301/tmp.c | UTF-8 | 515 | 2.75 | 3 | [] | no_license | #include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
int main(int argc, char **argv)
{
char buf[2];
char file[] = "/tmp/httpXXXXXX";
int filedesc = mkstemp(file);
printf("%s\n", file);
/*int filedesc = open(file, O_RDWR);*/
if(filedesc < 0)
{
return 1;
}
write(filedesc,"Th... | true |
1eb7d5e4118cfc694a3c1e6d895f28d7a3a795e5 | C | amaury2diaz/The-Compiler | /scanner/buffer.h | UTF-8 | 3,935 | 2.78125 | 3 | [] | no_license | /**********************************************************************************************
Filename: buffer.h
Compiler: Visual Studio Premium 2012
Author: Amaury Diaz Diaz, 040-738-985
Course: CST8152 Compilers, Lab Section: 012
Assignment: Assignment 1 - The B... | true |
8ee68b69a29f9e1646c5c7898ca6bc1c172819f6 | C | wemadefoxwxl/APUE | /02process/02/02fork.c | UTF-8 | 629 | 3.0625 | 3 | [] | no_license | #include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#define ERR_EXIT(m)\
do\
{\
perror(m);\
exit(EXIT_FAILURE);\
}while(0)
int globale = 100;
int main()
{
signal(SIGCHLD,SIG_IGN);... | true |
5469df008a069761d57b252c4052dbf512875bfb | C | sigmaister/ArDos_with_RADON | /ArDos_with_RADON/uartSender.h | UTF-8 | 1,433 | 2.71875 | 3 | [
"MIT"
] | permissive | #if USE_UART
//----------------------------------Инициализация UART----------------------------------
void dataChannelInit(void) //инициализация UART
{
PRR &= ~(0x01 << 1); //включаем питание UART
UBRR0 = (F_CPU / (8UL * UART_BAUND)) - 1; //устанавливаем битрейт
UCSR0A = (0x01 << U2X0); //устанавливаем удвоение с... | true |
e9e688c23791919b605b89be036ec3591e6e60e5 | C | mohammadmahdi255/CFL_9831066 | /MohammadMahdi Nemati Haravani.c | UTF-8 | 1,654 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int win(char c[]){
if(c[0]==c[1] && c[1]==c[2] && c[0]!='\0')
return 1;
else if(c[3]==c[4] && c[4]==c[5] && c[3]!='\0')
return 1;
else if(c[6]==c[7] && c[7]==c[8] && c[6]!='\0')
return 1;
else if(c[0]==c[3] && c[3]==c[6] ... | true |
19e516f4276e5562ad721bc226bce3c75548e1f7 | C | berkitamas/malom | /src/board.h | UTF-8 | 5,691 | 2.921875 | 3 | [
"MIT"
] | permissive | /**
* @file board.h
* @author Berki Tamás - PDRE31
* @date 2017. 11. 01.
*/
#ifndef BOARD_H
#define BOARD_H
#define BOARD_BG "\e[0m" ///< A táblában használt háttérszín (fehér)
#define BOARD_FG "\e[0m\e[7m" ///< A táblában használt előtérszín (fekete)
#define BOARD_EMPTY "\e[38;5;252m" ///< Az üres elem előté... | true |
6ec571c0c924a323a6a2d3ea222c0c2d790f0967 | C | ggg1976/sufs | /memorybuffer.h | UTF-8 | 958 | 2.6875 | 3 | [] | no_license | #define __ELEMENT_NODE__
// 这个头文件必须在fifo前,才能使用ElementNode,否则fifo会调用内部自定义的结构体。
typedef struct
{
char * lpBuffer;
int nLoc;
int nSize;
int bUsed;
}MemoryBuffer,*ElementNode;
#include "fifo.h"
#ifndef __MEMORY_H__
#define __MEMORY_H__
// 分配MemoryBuffer内存,释放MemoryBuffer内存
MemoryBuffer * memory_new_d... | true |
e8e1144b679820796ee751bd7533291111d01d83 | C | Firkraag/csapp | /chapter2/cs2-95.c | UTF-8 | 2,258 | 3.453125 | 3 | [] | no_license | #include "csapp.h"
#include "bit.h"
typedef unsigned float_bits;
/* Return the position of leftmost one. The position starts at 1. When x = 0, return 0 */
int leftmost_one_pos(unsigned x) {
int high = 31;
int low = 0;
int middle;
int result;
int length = high - low;
while (length >= 0) {
middle = (low + hig... | true |
7f3c22f4352ac36336f0d07e52849f1a86d736dc | C | j867178942/answer-for-C-PrimerPlus | /MOOC/MOOC 5.2.3-1.c | UTF-8 | 351 | 3.453125 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int x;
int one, two, five;
scanf("%d", &x);
for(one=0;one<=x*10;one++)
{
for(two=0;two<=x*5;two++)
{
for(five=0;five<=x*2;five++){
if(one+two*2+five*5==x*10){
printf("%d , %d and %d get %d .\n", one, two, five, x);
break;
}
}
break;
... | true |
389a876388de843e41d7903998d7ce9c01b002a0 | C | min-0/C | /C 교재 실습 문제/5장 연습문제 1.c | UHC | 214 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int n;
scanf_s("%d", &n);
if (n < 0)
{
printf(" µ %d Դϴ\n", n);
}
else
{
printf(" µ %d Դϴ\n", n);
}
return 0;
} | true |
d37e12d60d212dcab788074d94c96211a8f0addf | C | mgckaled/C_Lessons_SoloLearn | /3_Functions_Arrays_Pointers/e_Pointers.c | UTF-8 | 2,197 | 4.6875 | 5 | [] | no_license | /* POINTERS */
// Pointers are very important in C programming because they allow you
// to easily work with memory locations.
// They are fundamental to arrays, strings, and other data structures and
// algorithms.
// A pointer is a variable that contains the address of another variable.
// In other words, it "p... | true |
6322c5770f15aa915eafcd4427c0aabee8eefdb9 | C | jedimatt42/fcmd | /b1_strutil.h | UTF-8 | 2,516 | 2.953125 | 3 | [
"MIT"
] | permissive | #ifndef _STRUTIL_H
#define _STRUTIL_H 1
#include <string.h>
#include "banking.h"
int strcmp(const char* a, const char* b);
int strcmpi(const char* a, const char* b);
int str_equals(char* a, char* b);
int indexof(const char* str, int c);
int lindexof(const char* str, int c, int start);
int str_startswith(const char* s... | true |
c95c9731a1468f986b3cf3a4d49221336ef216b3 | C | siddharth1704/Projects | /100 funct.c | UTF-8 | 39,820 | 2.78125 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
void hello();
void add();
void subtract();
void Multi();
void div();
void mod();
void cal();
void prime();
void rev1();
void count();
void count1();
void armstrong();
void strong1();
void cuber();
void squarer();
void cube();
void square();
void npow();
void evec... | true |
fc44171cf62ba202d54e0f44efdbb8f66ae44784 | C | gonzalosinnott/parciales | /primer_parcial/src/client.c | UTF-8 | 17,335 | 3.03125 | 3 | [] | no_license | /*
============================================================================
Name : client.c
Author : Gonzalo Sinnott Segura
Version :
Copyright :
Description : Library client.c
============================================================================
*/
#include <stdio_ext.h>
#include ... | true |
fb0174e83d68f930731e3672beae72185e6ba5dc | C | parthasaaradhi/euler | /070.c | UTF-8 | 948 | 3.3125 | 3 | [] | no_license | #include<stdio.h>
int is_permutation(long long m, long long n) {
int m_d[10],i;
for(i=0;i<10;i++)
m_d[i] = 0;
while(m!=0) {
m_d[m%10]++;
m=m/10;
}
while(n!=0) {
m_d[n%10]--;
n=n/10;
}
for(i=0;i<10;i++)
if(m_d[i] !=0)
return 1;
return 0;
}
int main() {
char primes[1000000];
long long i,j;
floa... | true |
7318af55e0d449d9a03d53b75c1c883f62bdb63c | C | ishiikaa/C-p | /desc_pyramid.c | UTF-8 | 192 | 3 | 3 | [] | no_license | #include <stdio.h>
int main(int argc, char const *argv[])
{
for (int i = 1; i < 10; i++){
for (int j = i; j > 0; j--){
printf("%i ", j);
}
printf("\n");
}
return 0;
}
| true |
8e30e7b706efdc77bab00d6cbb684df47eb0f6ef | C | xiaopeng-sodu/algrithm | /sort/selectsort.c | UTF-8 | 260 | 3.078125 | 3 | [] | no_license | #include "selectsort.h"
#include "qsort.h"
void
selectsort(int data[], int N){
int i, j, tmp, m;
for(i=0;i<N;i++){
tmp = data[i];
m = i;
for(j=i+1;j<N;j++){
if(data[j] < tmp){
tmp = data[j];
m = j;
}
}
swap(data, i, m);
}
} | true |
60d5895c709c5e3bb0befae7aadbd4c866e891e5 | C | Wazmin/serveur | /_old/ProjetEntite/Fonctions.c | ISO-8859-1 | 1,065 | 3.34375 | 3 | [] | no_license | //#include "Fonctions.h"
#include <stdio.h>
int copierFichier(char const * const, char const * const);
int TmpMain(int argc, char **argv) {
char fichierS[] = "dataTest";
char fichierD[] = "dataTest2.";
copierFichier(fichierS, fichierD);
getchar();
}
int copierFichier(char const * const nomfichierSource, ch... | true |
99f327b002f32b6774c85da901ce243134fe9e8e | C | xiaowangzhixiao/car_a | /USER/utils.h | UTF-8 | 409 | 2.5625 | 3 | [] | no_license | #include <stdint.h>
#ifndef UTILS_H
#define UTILS_H
/*
To avoid the bug of the compilers
*/
double int2double(signed int i);
typedef struct
{
char *data;
uint32_t front, rear;
uint16_t count, max_size;
} char_queue;
int init_char_queue(char_queue *p, char buf[], uint16_t max_size);
int in_ch... | true |
4c6a2b75fe513065c322c965df18e64ef296f934 | C | AtilioA/C-20182 | /Slides e testes/IO, IfElse, For, While, etc/Ex045.c | UTF-8 | 638 | 4 | 4 | [] | no_license | // 3. Obter o MDC entre dois números inteiros.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, n1, m, m1, aux, resto = 1;
printf("Informe n: ");
scanf("%i", &n);
printf("Informe m: ");
scanf("%i", &m);
// Guarda valores iniciais
m1 = m;
n1 = n;
while (resto != 0)
... | true |
9308dbfbd8fab5865edad866192deeea0073d1c4 | C | KingVizzy/EEGR_409 | /Lecture5.1/Lecture5.1/Lab3.C | UTF-8 | 385 | 3.296875 | 3 | [] | no_license | //Vallery Salomon
//Lecture 5 Lab 2
//EEGR 409 C Programming Applications
//September 30, 2016
#include <stdio.h>
int main()
{
//Declare Variables
char c;
char c2;
int i = 0;
printf("Enter some text\n");
//Function
do
{
scanf_s("%c", &c);
printf("%c", c);
if (c >= 'a' && c <= 'z') c2 -= 32;
print... | true |
5eb387d9276bb12f60a02405c805e8a64f23e681 | C | MayukhSobo/ass | /examples/print_alphabet.c | UTF-8 | 122 | 2.6875 | 3 | [
"MIT"
] | permissive | int putchar (int c);
int main () {
int n = 0;
while (n < 26) {
putchar(65 + n);
n = n + 1;
}
return 0;
}
| true |
a23d0f1e1bfa677c4fc7ac3d9eb7df6377341b25 | C | Fuu3214/LinuxKernelSecurity | /Code/test_is/syscall.c | UTF-8 | 3,635 | 2.75 | 3 | [] | no_license | #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/unistd.h>
#include <linux/init.h>
/*
* For the current (process) structure, we need
* this to know who the current user is.
*/
#include <linux/sched.h>
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
... | true |
ddca30dab66124549365b03fca018b80cb0d4d2f | C | microuzi9797/C2018 | /Chapter11/282-Maximum_number_of_1s_for_long_long.c | UTF-8 | 274 | 3.03125 | 3 | [] | no_license | #include <stdio.h>
int main()
{
unsigned long long n;
int i;
unsigned long long test;
while(scanf("%llu", &n) != EOF)
{
int count = 0;
for(i = 0;i < 64;i++)
{
test = (n >> i);
if(test & 1)
{
count++;
}
}
printf("%d\n", count);
}
return 0;
} | true |
7480cd3153e7e7a2e87697537f4cb97901afda7a | C | sapienzastudents/exercises | /Sistemi Multicore/01 - Ripasso C pt1 /ex08.c | UTF-8 | 741 | 4.46875 | 4 | [] | no_license | /*
Scrivere una funzione che dato un array di interi e un
valore x cerca il valore x nell’array. Se il valore x è
presente allora restituirà la posizione altrimenti un codice
di errore 404.
*/
#include <stdio.h>
int find(int* A, int n){
size_t lenght = sizeof(A); //Permette di conoscere il numero di elementi del... | true |
b226de61b90cfb29e7bfc3fa89b62e289772c604 | C | gustavovelascoh/static_data_structures | /examples/03-linkedlist-1/main.c | UTF-8 | 2,288 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include "ll.h"
typedef struct {
uint8_t age;
char name[32];
} person_t;
#define PERSONS_LL_SIZE 16
void print_person(void * person_p){
person_t * person = (person_t *) person_p;
printf("Name: %s, Age: %d\n", person->name, person->age);
}
void print2(ll_t * pll){
ll_node_t * c... | true |
6354da80aa35aa8811783072ee66b40aa0ea211e | C | virtines/wasp | /libc/newlib/libc/machine/nds32/abort.c | UTF-8 | 692 | 3.40625 | 3 | [
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"MIT",
"LGPL-2.1-only",
"BSD-2-Clause-Views",
"GPL-2.0-or-later",
"GCC-exception-2.0",
"LicenseRef-scancode-gcc-compiler-exception-2.0",
"BSD-3-Clause",
"HP-1986",
"LicenseRef-scancode-newlib-historical",
"BSD-2-Clause",
"SunPro",
"LicenseRef-scanco... | permissive | /*
FUNCTION
<<abort>>---abnormal termination of a program
INDEX
abort
SYNOPSIS
#include <stdlib.h>
void abort(void);
DESCRIPTION
Use <<abort>> to signal that your program has detected a condition it
cannot deal with. Normally, <<abort>> ends your program's execution.
In general implementation, <<abort>> raises ... | true |
3644bef51dd546ada5dd673c6a05677a94ecd68a | C | Mimicmi/CPool | /CPool_infinadd_2019/infinadd.c | UTF-8 | 3,610 | 3.421875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** CPool_infinadd_2019
** File description:
** infinadd
*/
#include <unistd.h>
#include <stdlib.h>
#include "./include/my.h"
char *add(char *s1, char *s2)
{
int i = 0, rest = 0, len = 0, lena = my_strlen(s1), lenb = my_strlen(s2);
char *poi = (char *)malloc(len + 1);
if (lena >... | true |
2cdc699646bffaeed84177a0285f4861f3e670d9 | C | PillNandHSLU/PRGCFS2021PillNandHSLU | /21_Workshops/20_Solutions/04_ForLoop/06_ForLoop.c | UTF-8 | 385 | 3.71875 | 4 | [] | no_license | #include <stdio.h>
int main() {
int start = 1;
int end = 100;
int stop = 555;
int sum = 0;
int lastAddition = 0;
for(int i = start; i <= end; i++)
{
sum = sum + i;
lastAddition = i;
if(sum >= stop){
break;
}
else{
continue;
}
}
printf("With max. sum %d, the integers from %d to %d s... | true |
8a977682b78d1b7fbccb172dd8973cbe823f8d76 | C | ZePedroResende/li2 | /src/srcBackup/joga5cartasBots.c | UTF-8 | 9,285 | 2.609375 | 3 | [] | no_license | #include "big2.h"
/**
O estado joga_straight é aquele que faz com que o bot jogue um straight. Após todas as validações da sua mão, ele adiciona cartas para jogar, removendo-as da sua mão.
Posto isto, mostra as cartas no tabuleiro, e é a vez de outro jogador.
@param e O estado actual.
@returns O novo estado.
*/
ESTADO... | true |
3f2041133256aba58716cf4f254689fc3f0a4420 | C | aadesh-2806/day-64-on-github | /dstack.c | UTF-8 | 1,138 | 3.84375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct node{
int info;
struct node *next;
};
typedef struct node node1;
void initlist(node1 **list)
{
*list=NULL;
}
void pushdynamic(node1 **list,int x)
{
node1 *l;
l=(node1*)(malloc(sizeof(node1)));
l->info=x;
l->next=*list;
*list=l;
}
void popdynamic(node1 **list... | true |
c03961d603a674cafb69b68a1964018db1467bfe | C | GeorgeHRocha/UFABC_AED1 | /Introducao-Revisao/Miojo.c | UTF-8 | 380 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main () {
long t, a, b, a2, b2;
scanf("%ld %ld %ld", &t, &a, &b);
a2 = a;
b2 = b;
while (abs(a - b) != t) {
if (a < b) {
a = a + a2;
} else {
b = b + b2;
}
}
if (a < b) {
printf("%ld\n", b);
... | true |
9323bb795c13ea1ab983778c9035897dc7ef8164 | C | naztar0/Ucode-ush | /src/mx_export.c | UTF-8 | 9,581 | 2.609375 | 3 | [] | no_license | #include "ush.h"
static void sort_vars(char **vars) {
char *temp;
int p = 1;
while (p == 1) {
p = 0;
for (int i = 0; vars[i + 1]; i++) {
if (strcmp(vars[i], vars[i + 1]) > 0) {
temp = vars[i];
vars[i] = vars[i + 1];
vars[i + 1] = temp;
... | true |
5ef9d9450ae41e98741b1a635ede6beeb4833b77 | C | Brunompsousa/C | /Maiorstrings/main.c | UTF-8 | 408 | 3.28125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "funcoes.h"
#define NUM 20
int main()
{
int i = 0;
int nums[NUM];
int maior = 0;
for( i=0; i < NUM; i++ )
{
printf("Insira um numero [%d/20] \n", i+1);
scanf("%d", &nums[i]);
}
maior ... | true |
1b8e6118e9465bb3324eccf26132740986a2b506 | C | apelykh/42-minishell | /src/dir_utils.c | UTF-8 | 2,903 | 2.75 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* dir_utils.c :+: :+: :+: ... | true |
7b06e761f4c8c84223c3e1c5890e96282c68d5f2 | C | jljianglei/Helloworld | /sqlite3Test/t4.c | UTF-8 | 242 | 2.734375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
const char * const str = "hello";
printf("%s\n",str);
char const * ptr = "we";
printf("%s\n",ptr);
ptr = "omg";
printf("%s\n",ptr);
return 0;
}
| true |
dc03d9a647658600bf4424fe4f9db8e97c244ca6 | C | dhochberger/Game-of-life | /jeudelavie.c | UTF-8 | 4,808 | 3 | 3 | [] | no_license | // Jeu de la vie avec sauvegarde de quelques itérations
// compiler avec gcc -O3 -march=native (et -fopenmp si OpenMP souhaité)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <mpi.h>
// hauteur et largeur de la matrice
#define HM 1200
#define LM 800
// nombre total d'itératio... | true |
34d6914e82c1f61d71b3190dec17bc785473028d | C | huming2207/PeasantEvaluation | /weather.c | UTF-8 | 3,831 | 2.703125 | 3 | [] | no_license | //
// Created by Ming Hu on 4/9/17.
//
#include "weather.h"
char * get_weather_json()
{
// Curl string declaration
curl_string str_buffer;
str_buffer.memory = malloc(1);
str_buffer.size = 0;
// Curl declaration
CURL * curl;
CURLcode curl_response_code;
// Curl init
curl = curl_ea... | true |
366b932502ecf3145608ed716395c0e1d80dbbba | C | isabella232/AnghaBench | /source/freebsd/stand/liblua/extr_lfs.c_push_st_mode.c | UTF-8 | 1,309 | 2.546875 | 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 |
8cccdea2d3a0a236498fb18597ed4755703906c1 | C | liyijiax/linux | /code/fork_path.c | UTF-8 | 550 | 2.671875 | 3 | [] | no_license | /*************************************************************************
> File Name: fork_path.c
> Author: liyijia
> Mail: liyijiax@163.com
> Created Time: 2019年10月13日 星期日 14时18分44秒
************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib... | true |
37dba50d500fd0d58c6c271ac3f2b7a9d660f79b | C | Pufcorina/PDAV | /lab1/src/decoder.c | UTF-8 | 6,057 | 3.0625 | 3 | [] | no_license | #include "../header/decoder.h"
#include "../header/matrixMan.h"
#include<stdio.h>
#include<stdlib.h>
void writePPM_P6(const char *filename, struct PPMImage *img) {
FILE *fp;
//open file for output
fp = fopen(filename, "wb");
if (!fp) {
fprintf(stderr, "Unable to open file '%s'\n", filename);
exi... | true |
ad22142d3b9e37fc71e608d0c73be16b9cb37f69 | C | drsysmts/design-patterns-for-embedded-system-in-c | /chapter3/03-intermediary/main.c | UTF-8 | 1,295 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include "RobotArmManager.h"
#include "Action.h"
int main(int argc, char const *argv[])
{
int x,y,z,t;
RobotArmManager* me = RobotArmManager_Create();
x=1;
y=2;
z=3;
t=4;
RobotArmManager_computeTrajectory(me, x, y, z, t);
x=5;
y=6;
z=7;
t=8;
RobotArmM... | true |
e10bddbbca70d76bcbc093ea0afed9aa6c96c1e6 | C | farabi1233/compiler_lab | /calculator.c | UTF-8 | 1,013 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
int main(){
printf("\tCalculator\n\n");
while(1){
float num1, num2, total;
int oper;
printf("................\n");
printf("1 for sum\n");
printf("2 for sub\n");
printf("3 for mul\n");
printf("4 for div\n");
printf("5 for exit\n... | true |