source string | code_lang string | content string | idx int64 |
|---|---|---|---|
the-stack-v2-dedup | C | #include <stdio.h>
int main() {
long n;
for (int i = 0; i < 100; i ++) {
n += numbers[i];
}
printf ("%ld\n", n);
return 0;
}
| 1,331,400 |
the-stack-v2-dedup | C | // This Was done by Mark Campbell 1602979 and Marie Mckenzie 1602967
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void books(int size); // this is the prototype for books
void addmember(); // this is the prototype for members
void DisplayBooks();
void Displaymember();
void del... | 1,331,401 |
the-stack-v2-dedup | C | #include <avr/io.h>
#include "BUTTON.h" // Don't forget "BUTTON.c" in makefile!! (SRC = $(TARGET).c BUTTON.c)
int main (void)
{
type_BUTTON button_A;
type_BUTTON button_B;
/// Configure Devices //////////////////////////////////////
// Buttion A configuration
button_A.ddr = &DDRC;
button_A.port = &PORTC;
... | 1,331,402 |
the-stack-v2-dedup | C | #include <stdio.h>
#include <ctype.h>
int main (int argc, char **argv) { /* lower: convert input into lower case */
int c;
int (*caseconv)(int) = tolower;
if (!strcmp (argv[0], "./upper"))
caseconv = toupper;
while ((c = getchar()) != EOF)
putchar (caseconv(c));
return 0;
}
| 1,331,403 |
the-stack-v2-dedup | C | // SPDX-License-Identifier: GPL-2.0-only
/*
* Pinconf driver for TI DA850/OMAP-L138/AM18XX pullup/pulldown groups
*
* Copyright (C) 2016 David Lechner
*/
#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>... | 1,331,404 |
the-stack-v2-dedup | C | #include "calchead.h"
int main (int argSize, char * String[]) {
int op1 = atoi(String[1]);
int op2 = atoi(String[3]);
int opr = *(String[2]);
int size = argSize;
checkInputSize(size);
printf("Your answer = %d\n", calculate(op1, opr, op2));
return EXIT_SUCCESS;
}
| 1,331,405 |
the-stack-v2-dedup | C | #include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
int main(int argc, char *argv[]){
int i,j,k,len,max,prime[1001],b[26],num;
char a[1001];
for(i=0;i<=1000;i++)prime[i]=1;
prime[0]=0;prime[1]=0;
for(i=2;i<=1000;i++)if(prime[i])for(j=i+i;j<=1000;j+=i)prime[j]=0;
while(scanf(... | 1,331,406 |
the-stack-v2-dedup | C | #pragma config(Motor, port1, frontLeft, tmotorVex393_HBridge, openLoop, reversed, driveLeft)
#pragma config(Motor, port2, backLeft, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port3, piston, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, ... | 1,331,407 |
the-stack-v2-dedup | C | h58560
s 00001/00001/00120
d D 7.1 86/06/04 23:22:32 mckusick 26 25
c 4.3BSD release version
e
s 00007/00001/00114
d D 6.3 85/06/08 14:57:05 mckusick 25 24
c Add copyright
e
s 00023/00006/00092
d D 6.2 83/09/23 16:28:54 karels 24 23
c fix fcntl
e
s 00000/00000/00098
d D 6.1 83/07/29 06:12:16 sam 23 22
c... | 1,331,408 |
the-stack-v2-dedup | C | #include <stdio.h>
int main(int argc, char const *argv[])
{
int i,num,t,hi,lo,sum[200],ns=0,j;
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%d %d",&lo,&hi);
if(lo%2==0)
{
lo++;
}
for(j=lo;j<=hi;j=j+2)
{
ns=ns+j;
}
sum[i]=ns;
ns=0;
}
for(i=1;i<=t;i++)
{
printf("Case %d: %d\n",i,sum[i]);
... | 1,331,409 |
the-stack-v2-dedup | C |
#ifndef __AUX_ARRAY_FUNCTIONS
#define __AUX_ARRAY_FUNCTIONS
void displayArray(int *arr, int len);
/* It creates and returns three identical arrays with the given size N */
/* These arrays are in ascending order */
void createAlreadySortedArrays(int *&arr1, int *&arr2, int *&ar... | 1,331,410 |
the-stack-v2-dedup | C | #include <list.h>
#include <stdio.h>
#include <string.h>
#include <block.h>
#include <assert.h>
#include <malloc.h>
#include <fs.h>
#include <drive.h> // fixme
#include <fs/devfs.h>
static LIST_HEAD(g_bdev_list);
struct block_device *bdev_get(const char *name)
{
struct list_head *iter;
list_for_each(iter, &g_bdev_... | 1,331,411 |
the-stack-v2-dedup | C | #include<math.h>
#include<time.h>
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<stdint.h>
#define MAX_INPUT 1024
#define MOD 256
struct page {
unsigned long memory;
struct page * next;
struct page * prev;
struct page * nextHash;
struct page * prevHash... | 1,331,412 |
the-stack-v2-dedup | C | /*
## Cypress FX3 Core Library Header (cyu3descriptor.h)
## ===========================
##
## Copyright Cypress Semiconductor Corporation, 2010-2018,
## All Rights Reserved
## UNPUBLISHED, LICENSED SOFTWARE.
##
## CONFIDENTIAL AND PROPRIETARY INFORMATION
## WHICH IS THE PROPERTY OF CYPRESS.
##
## Use o... | 1,331,413 |
the-stack-v2-dedup | C | #include<stdio.h>
int main(){
int i;
char s[100010];
scanf("%s",s);
for(i=0;s[i];i++);
if(s[0]==s[i-1])i++;
printf("%s\n",i%2?"First":"Second");
return 0;
} ./Main.c: In function ‘main’:
./Main.c:5:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-... | 1,331,414 |
the-stack-v2-dedup | C | /*
****************************************************************
* *
* fdisk.c *
* *
* Altera a tabela de partição de discos *
* *
* Versão 4.6.0, de 11.09.04 *
* 4.9.0, de 24.12.07 *
* *
* Módulo: fdisk *
* Utilitários Sofisticados *
* *
* TROPI... | 1,331,415 |
the-stack-v2-dedup | C | /************************************************
* Auteur : Beaumont Thibault *
* Nom prog : 2degv1.c *
* Role : *
* Version : 1 *
* Fabrication : gcc -Wall -o *
* Date : 10/1... | 1,331,416 |
the-stack-v2-dedup | C | #define _CRT_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_DEPRECATE
#define WIN32_LEAN_AND_MEAN
#include <stdio.h>
#include <time.h>
#include "Hero.h"
#include "Map.h"
#include "Game.h"
#include <locale.h>
#if defined(WIN32) || defined(_WIN32)
#include <windows.h>
#endif
int main() {
setlocale(LC_ALL, "");
#if defin... | 1,331,417 |
the-stack-v2-dedup | C | #ifndef __ADSP_VSM_API_H__
#define __ADSP_VSM_API_H__
/**
@file adsp_vsm_api.h
@brief This file contains API definitions for the Voice Stream Manager (VSM).
*/
/*===========================================================================
NOTE: The @brief description and any detailed descriptions above do not appea... | 1,331,418 |
the-stack-v2-dedup | C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* data_struct.h :+: :+: :+: ... | 1,331,419 |
the-stack-v2-dedup | C | #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... | 1,331,420 |
the-stack-v2-dedup | C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi.c :+: :+: :+: ... | 1,331,421 |
the-stack-v2-dedup | C | //STACK
//https://github.com/L-F-Z/ADT_Code
//Developed by UCAS ADT_Code Group
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
//----------|Status|-----------
typedef int Status;
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLO... | 1,331,422 |
the-stack-v2-dedup | C | #include <stdio.h>
int main()
{
char a = 11, b = 111, c, x = 96, y = 38, z;
c = a*b;
z = x + y;
printf("%c, %c", c, z);
}
| 1,331,423 |
the-stack-v2-dedup | C | /*
* /drivers/char/hndl_char_devices/hnos_lcd_cog.h
*
*
* The source code in this file can be freely used, adapted,
* and redistributed in source or binary form, so long as an
* acknowledgment appears in derived source files. The citation
* should list that the code comes from the book "Linux Device
* Drivers"... | 1,331,424 |
the-stack-v2-dedup | C | #include "utils.h"
int parseArguments(int argc, char *argv[], struct Arguments* args)
{
int c;
memset(args, 0, sizeof(struct Arguments));
if (argc == 1) return ERROR;
while ((c = getopt (argc, argv, "hvi:d:x:t:s:l:p:f:g:")) != -1)
switch (c) {
case 'i':
strncpy(args->interface, optarg, (strlen(... | 1,331,425 |
the-stack-v2-dedup | C | #include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main (int argc, char *args[]) {
int fd = open(args[1], O_CREAT|O_WRONLY);
if (fd == -1) {
printf("There was an error with the destination file!");
return 1;
}
char buffer[1];
while... | 1,331,426 |
the-stack-v2-dedup | C | // Merge sort
// Time complexity Best, Worst, Average case = O(n log(n));
#include<stdio.h>
#define n 5
void display(int a[])
{
int i=0;
for(i=0;i<n;i++)
{
printf("%d ",a[i]);
}
printf("\n");
}
void merge(int a[],int l,int r,int m)
{
int n1=(m-l)+1;
int n2=(r-m);
int left[n1];... | 1,331,427 |
the-stack-v2-dedup | C | /*
* CDDL HEADER START
*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied t... | 1,331,428 |
the-stack-v2-dedup | C | #ifndef RM32_H
#define RM32_H
#include <stdint.h>
#include "../ModRM/Mod.h"
#include "../../Reg/Reg.h"
#include "../../Imm/Imm.h"
#include "../../../Prefix/Prefix.h"
#include "SIB/SIB.h"
typedef enum
{
ADDR_EAX,
ADDR_ECX,
ADDR_EDX,
ADDR_EBX,
ADDR_SIB,
ADDR_DISP32,
ADDR_ES... | 1,331,429 |
the-stack-v2-dedup | C | /*
** EPITECH PROJECT, 2020
** include special command
** File description:
** include file for minishell
*/
#ifndef _SPECIAL_COMMAND_H_
#define _SPECIAL_COMMAND_H_
// functions includes
// functions includes from built in commands
command_t built_in_command(linked_list_t *list, char *input, command_t command);
int ... | 1,331,430 |
the-stack-v2-dedup | C | #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... | 1,331,431 |
the-stack-v2-dedup | C | /*
============================================================================
Name : DLLuso.c
Author : imoren2x
Version :
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int suma_int(int, int);
int es_... | 1,331,432 |
the-stack-v2-dedup | C | #ifndef DETAILS_H_INCLUDED
#define DETAILS_H_INCLUDED
#include <stdlib.h>
#include <stdio.h>
char* strsep(char** stringp, const char* delim);
#endif // DETAILS_H_INCLUDED
| 1,331,433 |
the-stack-v2-dedup | C | /* Lukasavicus - 2146 */
#include <stdio.h>
#include <string.h>
int main(){
int v;
while(scanf("%d", &v) != EOF){
printf("%d\n", (v-1));
}
return 0;
} | 1,331,434 |
the-stack-v2-dedup | C | /*
* 1023.c
*
* Created on: Dec 20, 2017
* Author: ashwini.p
*/
#include <stdio.h>
#include <math.h>
int main() {
float a, b, c = 0.0;
float R1, R2 = 0.0;
scanf("%f %f %f", &a, &b, &c);
if ((a == 0) || ((b * b - 4 * a * c) < 0)) {
printf("Impossivel calcular\n");
return 0;
}
R1 = (-b+sqrt(b*b -... | 1,331,435 |
the-stack-v2-dedup | C | // gcc -Werror battleship.c -o battleship && ./battleship && rm battleship
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <time.h>
#include "global_var.h"
#include "map.h"
#include "player.h"
#include "boat.h"
#include "utils.h"
/* ------------------------------TO DO LIST---... | 1,331,436 |
the-stack-v2-dedup | C | /***************
Chef and Linear Chess\
Chef wants to play a game of linear chess on a one-dimensional board ― an infinite row of squares numbered by positive integers. In this game, he has a pawn, which is initially at a square K. There are also N other people (numbered 1 through N); Chef can choose one of them to pla... | 1,331,437 |
the-stack-v2-dedup | C | //tangting.c 四川唐门—唐听卧室
#include <ansi.h>
#include <room.h>
inherit ROOM;
void create()
{
set("short", "寝室");
set("long",
"这是一间简陋的卧室。屋中只有一张硬木床和一张枣木红桌。这里住\n"
"着唐老太太的贴身保镖唐听。\n"
);
set("exits", ([
"west" : __DIR__"nzlang3",
]));
set("area", "t... | 1,331,438 |
the-stack-v2-dedup | C | /******************************************************************//**
* *
* Advanced file I/O module (CORE) *
* *
* HISTORY ... | 1,331,439 |
the-stack-v2-dedup | C | /*
GPLv3 License.
A collection of basic statistic functions.
*/
#ifndef OC_BASICSTATS_H
#define OC_BASICSTATS_H
double meanSingleVector(const char a_type,const int a_size,
const void* a_data);
/* Computes the mean of a single data series */
void meanSdSingleVector(const int a_mode,const char a_type,const int a_siz... | 1,331,440 |
the-stack-v2-dedup | C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_make_pad.c :+: :+: :+: ... | 1,331,441 |
the-stack-v2-dedup | C | 1,1,2
1,4,2
2,2,2
3,5,2
4,2,2
| 1,331,442 |
the-stack-v2-dedup | C | /*
Copyright (C) Ian Hogg
Happenings and Actions Routines for CBUS event management - part of CBUS libraries for PIC 18F
This work is licensed under the:
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
To view a copy of this license, visit:
http://creativecommons.o... | 1,331,443 |
the-stack-v2-dedup | C | /*
* =====================================================================================
*
* Filename: recver.h
*
* Description: Reciever Relativant Processes
*
* Version: 1.0
* Created: 2012/06/16 16时21分03秒
* Revision: none
* Compiler: gcc
*
* Author: Lev... | 1,331,444 |
the-stack-v2-dedup | C | /*SwitchControl.h
*Enrique Perez-Osborne
*Juliana Pulido
*TA: Cody Horton
*Last Edited: 11/29/17
*/
//Initialize buttons
void PortE_Init(void);
//Initialize oneshot timer
void Timer1A_Init(void);
| 1,331,445 |
the-stack-v2-dedup | C | Lights1 sad_carousel_f3d_material_117_lights = gdSPDefLights1(
0x7F, 0x7F, 0x7F,
0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28);
Lights1 sad_carousel_f3d_material_118_lights = gdSPDefLights1(
0x47, 0x49, 0x55,
0x8F, 0x93, 0xAA, 0x28, 0x28, 0x28);
Lights1 sad_carousel_f3d_material_012_lights = gdSPDefLights1(
0x1B, 0x1E, 0x... | 1,331,446 |
the-stack-v2-dedup | C | /*
* injection.c
*
* Created on: Dec 1, 2020
* Author: aljaz
*/
#include "injection.h"
#include "generalfunctions.h"
// GLOBALS
Injection_InjectorCyl Injection_Cyl1; // Global Variable for Cylinder 1, containing all Info regarding Injection
Injection_InjectorCyl Injection_Cyl2; // Global Variable for Cyli... | 1,331,447 |
the-stack-v2-dedup | C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... | 1,331,448 |
the-stack-v2-dedup | C | #ifndef B_OGL_ENGINE_VERTEX_H
#define B_OGL_ENGINE_VERTEX_H
#include <glm/glm.hpp>
struct Vertex {
glm::vec3 position;
glm::vec3 normal;
glm::vec2 texCoord;
};
#endif //B_OGL_ENGINE_VERTEX_H
| 1,331,449 |
the-stack-v2-dedup | C | #include <fs/onix/fsbitmap.h>
#include <onix/bitmap.h>
#include <onix/assert.h>
#include <onix/kernel/harddisk.h>
#include <onix/kernel/debug.h>
#define DEBUGINFO
#ifdef DEBUGINFO
#define DEBUGP DEBUGK
#else
#define DEBUGP(fmt, args...)
#endif
int32 onix_inode_bitmap_alloc(Partition *part)
{
int32 idx = bitmap_s... | 1,331,450 |
the-stack-v2-dedup | C | #include <string.h>
#include <stdbool.h>
#include <sys/types.h>
#include <ndm/int.h>
#include <ndm/endian.h>
#include "test.h"
int main()
{
NDM_TEST(NDM_INT_MIN(char) == CHAR_MIN);
NDM_TEST(NDM_INT_MAX(char) == CHAR_MAX);
NDM_TEST(
( ndm_endian_is_le() &&
ndm_endian_letoh16(0x1234) ==
0x1234) ||
(!ndm_e... | 1,331,451 |
the-stack-v2-dedup | C | /*-
* SPDX-License-Identifier: Apache License 2.0
*
* Copyright 2017-2018 Yutaro Hayakawa
*
* 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/LICEN... | 1,331,452 |
the-stack-v2-dedup | C | /*
* Copyright (C) 2010 OpenSIPS Project
*
* This file is part of opensips, a free SIP server.
*
* opensips 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 you... | 1,331,453 |
the-stack-v2-dedup | C | // Largest palindrome product
// Problem 4
// A palindromic number reads the same both ways.
// The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
// Find the largest palindrome made from the product of two 3-digit numbers.
#include<stdio.h>
#include<stdlib.h>
int r... | 1,331,454 |
the-stack-v2-dedup | C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* command_processing.c :+: :+: :+: ... | 1,331,455 |
the-stack-v2-dedup | C | #include "ruby.h"
#include "SpiceUsr.h"
#include "signal.h"
#include <stdbool.h>
#include "nmatrix.h"
//Top level IMPLICIT Declarations
VALUE spicerub_top_module;
VALUE spicerub_nested_module;
VALUE rb_spice_error;
//Kernel Loading Functions
VALUE sr_furnsh(VALUE self, VALUE kernel);
VALUE sr_unload(VALUE self, VAL... | 1,331,456 |
the-stack-v2-dedup | C | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include <assert.h>
#include <exception>
struct t6_74;
struct t5_132;
#include "codegen/il2cpp-codegen.h"
#include "t5_128.h"
#include "t5_129.h"
#include "t5_131.h"
#include "t5_130... | 1,331,457 |
the-stack-v2-dedup | C | #include "../../src/network/access/qnetworkrequest.h"
| 1,331,458 |
the-stack-v2-dedup | C | /***********************************************************************
* DESCRIPTION :
* main arduino code for EXCISS version 4, PCB revision 1.
*
*
* AUTHOR : Shintaro Fujita START DATE : 29 Jun 2018
*
**/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define UART_ECC_LENGTH 1
#endif | 1,331,459 |
the-stack-v2-dedup | C | #include <x.h>
#include <sandbox.h>
struct sandbox_audio_context_t {
snd_pcm_t * handle;
snd_pcm_hw_params_t * params;
snd_pcm_format_t format;
snd_pcm_uframes_t frames;
unsigned int bytes_per_frame;
};
void * sandbox_audio_playback_start(int rate, int fmt, int ch)
{
struct sandbox_audio_context_t * ctx;
unsig... | 1,331,460 |
the-stack-v2-dedup | C | #include "sdk_img.h"
#include "sdk_print.h"
#include "xGui/inc/2ddraw.h"
#include "xGui/inc/message.h"
#include "xGui/inc/xgui_key.h"
#include "xGui/inc/xgui_bmp.h"
#include "pub/common/misc/inc/mfmalloc.h"
void showbmptest()
{
int logowidth;
int logoheight;
char * pbmp;
int ret;
MESSAGE pMsg;
creat_bmp();
p... | 1,331,461 |
the-stack-v2-dedup | C | #include"data.h"
int main(int argc, char **argv)
{
DataType data;
SeqList *list,*List;
list = init_SeqList();
printf("please input data and input -1 end\n");
scanf("%d",&data);
while(data != -1)
{
Input_SeqList(list,data);
scanf("%d",&data);
}
Out_SeqList(list);
List = Del_data(list);
Ou... | 1,331,462 |
the-stack-v2-dedup | C | //------------------------------------------------------------------------------
// GrB_Vector_extract: w<mask> = accum (w, u(I))
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2018, All Rights Reserved.
// http://suitesparse.com ... | 1,331,463 |
the-stack-v2-dedup | C | /*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
#define FUSE_USE_VERSION 26
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <stdio.h>
#i... | 1,331,464 |
the-stack-v2-dedup | C | #include <stdio.h>
double soma(double valor, int enfeites)
{
if(enfeites == 0)
{
printf("%.2f\n%.2f", (double) valor, (double) (valor/21));
return 0;
}
double n_enfeites, preco;
scanf ( "%lf %lf", &n_enfeites, &preco );
soma(valor + (n_enfeites * preco), enfeites - 1);
}... | 1,331,465 |
the-stack-v2-dedup | C | extern int sub(int c, int d) {
return c - d;
} | 1,331,466 |
the-stack-v2-dedup | C | /* GStreamer
* Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) ... | 1,331,467 |
the-stack-v2-dedup | C | #include <stdio.h>
int main(void) {
int amount, initialValue, i, j, isPrime;
printf("Por favor, insira o número de números primos que você deseja imprimir: ");
scanf("%d", &amount);
printf("Insira agora, o valor inicial: ");
scanf("%d", &initialValue);
if (amount < 0 || initialValue < 0) {
printf("N... | 1,331,468 |
the-stack-v2-dedup | C | #include <curses.h>
#include "msweeper.h"
/* カーソルの表示 */
void draw_cursor(PARAMETER *data, int x, int y, int *oldc)
{
char tmp;
if (CHKFIELDFLAG(data, x-EDGE, y-EDGE) == MFLAG ||
CHKFIELDFLAG(data, x-EDGE, y-EDGE) == QFLAG) {
tmp = flag_2_char(data->field_flag[y-EDGE][x-EDGE]);
} else if (CHKFIELDFLAG... | 1,331,469 |
the-stack-v2-dedup | C | /*
* gui.c
* gridlabd
*
* Created by d3g637-local on 10/26/10.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#include <stdlib.h>
#include "complex.h"
#include "object.h"
#include "load.h"
#include "output.h"
#include "random.h"
#include "convert.h"
#include "schedule.h"
#include "gui.h"
sta... | 1,331,470 |
the-stack-v2-dedup | C | #ifndef SPI_H
#define SPI_H
/*
* Copyright (c) 2013 Damien Miller <djm@mindrot.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTW... | 1,331,471 |
the-stack-v2-dedup | C | #include<stdio.h>
void bubblesort(int A[],int n)
{
int i,j,k;
k=n-1-i;
int flag=0;
for(i=0;i<n-1;i++,k--)
{
for(j=0;j<k;j++)
{
if(A[j]>A[j+1])
{
int temp=A[j];
A[j]=A[j+1];
A[j+1]=temp;
flag=1;
... | 1,331,472 |
the-stack-v2-dedup | C | /*
* Copyright 2013-2015 Guardtime, Inc.
*
* This file is part of the Guardtime client SDK.
*
* 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/LICENS... | 1,331,473 |
the-stack-v2-dedup | C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_token_queue.c :+: :+: :+: ... | 1,331,474 |
the-stack-v2-dedup | C | // LCD 液晶显示屏硬件接口函数
#include "reg52.h"
#include "LCD.h"
void _LCD_delay()
{
uchar j=0,i=0;
for(j=0;j<255;j++)
for(i=0;i<4;i++);
}
void _LCD_write_char(uchar dat)
{
// 根据时序图
RS = 1;
RW = 0;
E = 0;
LCD_PORT = dat;
_LCD_delay();
E = 1;
E = 0;
}
void _LCD_write_cmd(uchar... | 1,331,475 |
the-stack-v2-dedup | C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
static void sighandler( int signo ) {
if ( signo == SIGINT ) {
printf( "\nSIGINT Caught!\nExiting Program...\n\n" );
exit( 0 );
}
else if ( signo == SIGUSR1 ) {
printf( "\nSIGUSR1 Caught!\nPID of Parent Process: ... | 1,331,476 |
the-stack-v2-dedup | C | /*
* Copyright (c) 2019, Bashi Tech. All rights reserved.
*/
#ifndef __FDR_UTIL_H__
#define __FDR_UTIL_H__
#include <inttypes.h>
#include <time.h>
#include <dirent.h>
time_t fdr_util_strptime(const char *buf);
int fdr_util_rm(const char *dir);
// ts -> year-month-day
int fdr_util_mkdir(char *buffer, int64_t ts);... | 1,331,477 |
the-stack-v2-dedup | C | #include "gl4es.h"
#include "glstate.h"
#include "init.h"
#include "loader.h"
#include "debug.h"
//#define DEBUG
#ifdef DEBUG
#define DBG(a) a
#else
#define DBG(a)
#endif
static void gl_changetex(int n)
{
if(glstate->bound_changed < n+1)
glstate->bound_changed = n+1;
}
static void fpe_changeplane(int n, ... | 1,331,478 |
the-stack-v2-dedup | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(){
char opcao[1];
int olho, cabelo, sexo;
float cont =0, idade, contM=0, contF=0, contOlhoVerde=0, contOlhoAzul=0, contOlhoCastanho=0, contCabeloLouro=0, contCabeloCastanho=0, contCabeloPreto=0;
float altura, peso, mediaIdade=0,... | 1,331,479 |
the-stack-v2-dedup | C | #include<stdio.h>
#include<unistd.h>
#include<sys/wait.h>
#include<stdlib.h>
#include<signal.h>
#include<string.h>
//父子进程拥有自己独立的全局变量和局部变量,修改互不干扰
int g_a = 100;
/*
SIGALRM 已到alarm调用时间
SIGINT 输入ctrl+c
SIGCHLD 子进程终止
*/
void time_out(int sig)
{
if(SIGALRM == sig)
{
printf("time out!\n");
alarm... | 1,331,480 |
the-stack-v2-dedup | C | // php通过zval结构体来保存变量,zval结构体在Zend/zend.h定义,定义如下
struct _zval_struct {
zvalue_value value;
zend_uint refcount_gc;
zend_uchar type;
zend_uchar is_ref_gc;
};
| 1,331,481 |
the-stack-v2-dedup | C | /* $XConsortium: PrintP.h /main/4 1995/07/15 20:43:58 drk $ */
/*
* Motif
*
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by... | 1,331,482 |
the-stack-v2-dedup | C | #include <stdio.h>
int main()
{
int arr[11] = {2,6,10,14,18,3,7,11,15,19};
int key, i, index = -1;
printf("Enter element to delete\n");
scanf("%d",&key);
for(i = 0; i < 11; i++)
{
if(arr[i] == key)
{
index = i;
break;
}
}
if(index != -1)
... | 1,331,483 |
the-stack-v2-dedup | C | #include "headers/cliente.h"
#include "headers/util.h"
int generarMontaje(){
pid_t pid = fork();
if(pid == 0){
char *command[] = {"sshfs","localhost:gitbox/","gitbox","-o","follow_symlinks",NULL};
execvp(command[0],command);
return -1;
}
else{
waitpid(pid, NULL, 0);
}
return 0;
} | 1,331,484 |
the-stack-v2-dedup | C | /*************************************************
LHarc version 1.13b (c)Yoshi, 1988-89.
adaption to ATARI ST with TURBO-C 1.1
from LZS.ASM
by J. Moeller 1990/01/28
HTAB = 4
*************************************************/
#ifndef __TOS__
#error Please try assembling 'lzs.asm'!
#endif
#incl... | 1,331,485 |
the-stack-v2-dedup | C | // To execute this script type: root [0] .x histo_canvas.C
void histo_canvas(){
// Reset ROOT
gROOT->Reset();
// Set Style to plain
gROOT->SetStyle("Plain");
// Customize the Statistics Box
gStyle->SetOptStat(221112111);
// gStyle->SetOptStat("kKsSiourmMen"); //Alernatively (same result)
//... | 1,331,486 |
the-stack-v2-dedup | C | #ifndef VARIADIC_FUNCTIONS_H
#define VARIADIC_FUNCTIONS_H
#include <stdarg.h>
/**
* struct select - struct of charactaer and it's respective function
*
* @c: the char entered
* @f: its relative pointer to function
*/
typedef struct select
{
char *c;
void (*f)(va_list valist);
} my_sel;
int sum_them_all(cons... | 1,331,487 |
the-stack-v2-dedup | C |
#include "path.h"
mapping shelves;
create() {
shelves = ([
WEAP+"dagger" : ({ 1, 2 }),
ARM+"helmet" : ({ 2, 2 }),
MISC+"torch" : ({ 2, 2 }),
ARM+"med_shield" : ({ 2, 2 }),
]);
} /* create() */
mapping query_shelves() {
return shelves;
}
| 1,331,488 |
the-stack-v2-dedup | C | /*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http... | 1,331,489 |
the-stack-v2-dedup | C | /*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* runSmarticles.c
*
* Code generation for function 'runSmarticles'
*
*/
/* Include files */
#include "rt_non... | 1,331,490 |
the-stack-v2-dedup | C | static char sccsid[] = "@(#)45 1.2 baud_close.c, bos, bos320 4/14/93 16:40:52";
/*
**
** COMPONENT_NAME: BAUD Device Driver Top Half Routine
**
** FUNCTIONS: baud_close
**
** ORIGINS: ME
*/
#include <sys/types.h>
#include <sys/device.h>
#include <sys/errno.h>
#include <sys/uio.h>
#include <sys/malloc.h>
#include <sy... | 1,331,491 |
the-stack-v2-dedup | C |
int size(node* head)
{
int size = 0;
node* current = head;
while (current) {
current = current->next;
size++;
}
return size;
}
void check_address(void* node)
{
if (!node) {
printf("Unable to allocate memory.");
exit(EXIT_FAILURE);
}
}
void destroy_list(node* head)
{
node* current = head;
while(c... | 1,331,492 |
the-stack-v2-dedup | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int linhas (){
FILE *f;
int ch, count = 0;
f = fopen("alunos.txt", "r");
do {
ch = fgetc(f);
if (ch == '\n') count++;
}while (ch != EOF);
fclose(f);
return count;
}
void leAlunos(int* matriculas, char **nomes){
int mat, i;... | 1,331,493 |
the-stack-v2-dedup | C | /*
RDS Surveyor -- RDS decoder, analyzer and monitor tool and library.
For more information see
http://www.jacquet80.eu/
http://rds-surveyor.sourceforge.net/
This file is based on code originally written by Danilo F. S. Santos,
and released under the LGPL.
Copyright 2010 Christophe Jacquet
Copyright 2010 ... | 1,331,494 |
the-stack-v2-dedup | C | /*
* File: master.c
* Author: baota
*
* Created on November 2, 2017, 2:11 PM
*/
#include <xc.h>
#define _XTAL_FREQ 8000000
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include "config.h"
#include <string.h>
unsigned char temp;
void master_wait(){
while ((SSPSTAT & 0x04) || (SSPCON2 & 0x1F... | 1,331,495 |
the-stack-v2-dedup | C | /*
* slideshow_tricolor.c
*
* Created on: 15.02.2021
* Author: zhongke.dai
*/
#include <stdio.h>
#include <string.h>
#include "types.h"
#include "FatFs/ff.h"
#include "UC8156.h"
#include "utils.h"
#include "display_functions.h"
#include "config_display_type.h"
#include "slideshow_tricolor.h"
#define MAX_P... | 1,331,496 |
the-stack-v2-dedup | C | #include "atmel.h"
#define PIN 7
void main(void) {
AT91C_BASE_PMC -> PMC_PCER |= (1 << AT91C_ID_PIOA);
AT91C_BASE_PIOA -> PIO_OWDR &= ~(1 << PIN);
AT91C_BASE_PIOA -> PIO_OWER |= (1 << PIN);
AT91C_BASE_PIOA -> PIO_ODSR &= ~(1 << PIN);
} | 1,331,497 |
the-stack-v2-dedup | C | #include <stdio.h>
int dp[40][40];
int main(){
int N, A, B, i,j,k;
long long countS=0ll;
scanf("%d %d %d", &N, &A, &B);
for(i=0; i<N; i++){
scanf("%d", &dp[i][i]);
if(dp[i][i]>=A && dp[i][i]<=B)countS++;
}
if(0>=A && 0<=B)countS++;
for(k=1; k<N; k++){
for(i=0; i+k... | 1,331,498 |
the-stack-v2-dedup | C | //#include <stdio.h>
//
//#define STRING(a) #a
//#define STRING_(a) (++a)
//
//#define PASTER(a, b) a##b
//
//int main(void)
//{
// int nData = 10;
//
// printf("%d\n", PASTER(nDa, ta));
// printf("%d\n", nData);
//
// printf("%s\n", STRING(nData));
// printf("%s\n", STRING_(nData));
// return 0;
//} | 1,331,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.