language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include "holberton.h"
/**
* _isalpha - alpha
* @c: this is about the alphabet
* description: alphabet
* Return: 1, 0
*/
int _isalpha(int c)
{
if ((('a' <= c) && (c <= 'z')) || (('A' <= c) && (c <= 'Z')))
{
return (1);
}
else
{
return (0);
}
}
|
C | inherit VERB_OB;
int get_floor(object living);
int get_ceiling(object living);
void drain_target(object living);
void concentration(object living);
void do_steallife_liv(object living)
{
object this_body = this_body();
if (this_body->query_guild_level("jedi"))
{
if (this_body->is_body() && !this_body-... |
C | // 123 = 1 + 2 + 3 = 6
// 852 = 8 + 5 + 2 = 15
#include <stdio.h>
int main()
{
int num, rem = 0, sum = 0, temp;
printf("Enter a number: ");
scanf("%d", &num);
temp = num;
while (num != 0)
{
rem = num % 10;
num = num / 10;
sum = sum + rem;
}
printf("Sum of %d ... |
C | #include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "forces.h"
#include "scene.h"
#include "sdl_wrapper.h"
#include "shapes.h"
#include "color.h"
#define WIDTH 1000
#define HEIGHT 500
#define NUM_BODIES 100
#define NUM_SIDES 10
#define RADIUS 10
#define MASS 20000000
#define GRAVITY 1... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <mpi.h>
// Creates an array of random numbers.
int *create_random_array(int num_elements, int max_value)
{
int *arr = (int *)malloc(sizeof(int) * num_elements);
for (int i = 0; i < num_elements; i++)
{
arr[i] = (rand() % max_value);
}
retu... |
C | /*
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
Example 1:
Input: 121
Output: true
Example 2:
Input: -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
Exampl... |
C | #include "libmx.h"
int mx_sqrt(int x) {
long root = 1;
if (x < 0) return 0;
for (; root*root < x; root++);
if (root*root == x) {
return (int)root;
}
return 0;
}
// double mx_sqrt(double x) {
// // - algorithm for real numbers:
// double root = x / 2;
// double scale_fac... |
C | #include <stdio.h>
#include <stdlib.h>
int main() {
return 0;
}
void baja( ePersona pers[] , int cantidad ) {
int auxId, i , flag = 0;
char respuesta;
printf("Ingrese id: ");
scanf( "%d" , &auxId );
for( i = 0 ; i < cantidad ; i++ ) {
if( auxId == pers[i].id ) {
print... |
C | /*
* a MinHeap ADT Header
* Ref: www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding
* Written by Tianpeng Chen z5176343 for COMP9319 assignment 1
* Destroy method added
* Table transfer function added
*/
// a huffman tree node structure
typedef struct MinHeapNode {
unsigned char data;
unsigned freq;... |
C | /**
\archivo sh.c
\descripcion Este archivo representa al proceso sh que funge
como shell o interpretador de comandos, en este
caso solo puede aceptar comandos con un solo
argumento, el comando EXIT, sale de sesion y el
comando SHUTDOWN, cierra todos los procesos
\autores Jose Andr... |
C | /*
* Daniel Goncalves > 1151452@isep.ipp.pt
* ARQCP - Turma 2DK
*
* same_word.h
*/
#include <stdio.h>
/*
* Compares words in the string address with the word received
*
* returns 1 or 0 depending if a word matches with a word in the given string or not.
*/
int same_word(char *word, char *str){
while(*s... |
C | #include<stdio.h>
main()
{
int a[50],i,n,large,small;
printf("enter the number of elements in an array:\n");
scanf("%d",&n);
printf("enter the elements in an array\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
large=small=a[0];
for(i=1;i<n;i++)
{
if(a[i]>large)
large=a[i];
if(a[i]<small... |
C | // list/list.h
//
// Interface definition for linked list.
//
// <Daniel>
#include <stdbool.h>
/* Defines the node structure. Each node contains its key and value, and points to the
* next node in the list. The last element in the list should have NULL as its
* next pointer. */
struct node {
char* key;
ch... |
C | #include <stdio.h>
#include "calculadora.h"
#define TAMANHO_VETOR 10
int main(void) {
// Declarando variáveis
int
resultado,
vetor1[TAMANHO_VETOR] = {0,0,0,0,0,0,0,0,0,0},
vetor2[TAMANHO_VETOR] = {0,0,0,0,0,0,0,0,0,0};
// Menu interativo
printf("Calculadora de Vetores [versão 1.0]\n\... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: ... |
C | #include <stdio.h>
int main(){
int metre,nbre_foliole;
scanf("%d\n%d",&metre,&nbre_foliole);
if(metre<=5 && nbre_foliole>=8)
printf("Tinuviel\n");
if(metre>=10 && nbre_foliole>=10)
printf("Calaelen\n");
if(metre<=8 && nbre_foliole<=5)
printf("Falarion\n");
if(metre>=12 && nbre_foliole<=7)
printf("Dorthonion\... |
C | #include<stdio.h>
#include<SDL2/SDL.h>
#include<SDL2/SDL_image.h>
/*Declarando variáveis globais*/
SDL_Window* janela = NULL;
SDL_Renderer* renderizador = NULL;
SDL_Texture* fundo = NULL;
/*Função usada para carregar as imagens para variáveis tipo textura*/
SDL_Texture* carrega_textura(char *caminho_img) {
SDL_Textu... |
C | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define tam 1000000000
void exectime(int time_s){
clock_t time_e = clock();
double execution = (double) (time_e - time_s) / CLOCKS_PER_SEC;
printf("\tTempo de execucao: %f\n", execution);
}
void main(){
int i, j, k, np... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "List.h"
void printStringArray(FILE *out, char **array, List L, int count);
int main(int argc, char *argv[])
{
int count = 0, i, j;
int *lineLength;
int *indexArray;
char c = '0';
char **input;
// char *buffer;
FILE *in, *... |
C | /*
* This file is part of KONNEKTING Device Library.
*
* The KONNEKTING Device Library 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 of the License, or
* (at your option... |
C | #include <stdio.h>
unsigned int power(unsigned int p, unsigned int k) {
if (k == 0) {
return 1;
} else if (k % 2 == 0) {
return power(p * p, k / 2);
} else {
return p * power(p * p, (k - 1) / 2);
}
}
int main() {
printf("%d\n", power(3, 2));
return 0;
} |
C | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "simplehash.h"
// 初始化 hashtable
table * init_hash_table()
{
int i;
table *t = (table *)malloc(sizeof(table));
if (t == NULL) {
printf("init hash table is failed!\n");
return NULL;
}... |
C | /*
* File Name: arithcl.c
* version: 1.0
* Author: William Collins
* Date: 2/14/2012
* Assignment: Assignment 1
* Course: Real Time Programming
* Code: CST8244
* Professor: Saif Terai
* Due Date: 2/17/2012
* Submission
* Type: Email Submission
*... |
C | /*
** EPITECH PROJECT, 2018
** 42sh
** File description:
** Functions to tokenize the cut command
*/
#include "list.h"
#include "lexer.h"
#include "tools.h"
#include "str_manip.h"
/* Always put the doubly separator at the top */
static const token_type_list_t TYPES[] = {
{"||", OR},
{">>", D_SUP},
{"<<", D_INF},
... |
C | #ifndef __HIDRANTE_H
#define __HIDRANTE_H
typedef void* Hidrante;
/*
Cria um hidrante
Pré: Atributos do hidrante (id, x e y)
Pós: Retorna o endereço do hidrante
*/
Hidrante criaHidrante(char* id, float x, float y);
//Setters
/*
Define algum atributo do hidrante
Pré: Atributo do hidrante referente deseja definir
Pós:... |
C | #include<stdio.h>
#defline INT_SIZE sizeof(int)*8
int main()
{
int num,zero=0,one=0;
intn,m,a[20][20],k,i,j,temp;
prinf("size of matrix\n");
scanf("%d%d",&m,&n);
printf("enter the elements of matrix\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
if (a[i][j]==0)
{
zero ++;
}
else
{
one ++;
}
}
}
printf... |
C | /*
** EPITECH PROJECT, 2021
** B-CPE-110-RUN-1-1-antman-alexis.picard
** File description:
** my_memset
*/
#include "my.h"
#include <stdio.h>
char *my_memset(void *s, char data, size_t n)
{
char *s_ptr = (char *)s;
for (int i = 0; i < n; i++)
s_ptr[i] = data;
return s;
} |
C | /**
* Driver for LED Panel - 8 LEDs
* Model: KingBright DC-10EWA
*
* @author Tyler Thompson
* @date 3/26/2018
* @note LED panel has 10 LEDs, but this driver only uses 8
*/
/* Includes ------------------------------------------------------------------*/
#include "LED_Panel_X8.h"
/**
* @brief Ini... |
C | /********Software Analysis - FY2013*************/
/*
* File Name: data_overflow.c
* Defect Classification
* ---------------------
* Defect Type: Numerical defects
* Defect Sub-type: Data overflow
* Description: Defect Code to identify defects in data overflow in static declaration
*/
static int sink;
#include "Header... |
C | /*
Author: daddinuz
email: daddinuz@gmail.com
Copyright (c) 2018 Davide Di Carlo
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 the rights to u... |
C | #include <stdio.h>
int main()
{
int matriz1[4][7];
int i;
int j;
//leer matriz
for(i = 0;i<4;i++)
{
for(j=0;j<7;j++)
{
scanf("%d",&matriz1[i][j]);
}
}
//imprimir matriz
for(i = 0;i<4;i++)
{
for(j=0;j<7;j++)
{
prin... |
C | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <time.h>
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#define lebar_layar 1080
#define tinggi_layar 720
#define phi 3.14159265358979323846
typedef struct {
int a, b, c, d, e, f, g, h, i, j, k... |
C | /*
* trans.c - Matrix transpose B = A^T
*
* Each transpose function must have a prototype of the form:
* void trans(int M, int N, int A[N][M], int B[M][N]);
*
* A transpose function is evaluated by counting the number of misses
* on a 1KB direct mapped cache with a block size of 32 bytes.
*/
#include <stdio.h... |
C | /*
*PPM.C
*A 16 Bit PWM module is used to gennerate the PPM train
*The PWM actually gennerates an inverted CPPM __|_|_|_|_|_|_|_|_|___|_|_|_|_|_|_|_|_|___|_
*this has the advantage that the pulse width can stay constant, only the periode has to be changed
*on everey compare match interrupt the periode value for the ne... |
C | #include <stdio.h>
#include <stdlib.h>
int flag_a = 0;
int flag_b = 0;
int flag_c = 0;
/*
* We use a fully instantiated manifest.
*
* The Config Prime engine should remove everthing except the only
* possible execution.
*
* EXPECTED: all strings "You should NOT see this message" are removed
* in the bitcode... |
C | #include <stdio.h>
int main(void)
{
int myIntArray [10] = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100};
float myFloatArray [5] = {1, 2, 3, 4, 5};
char myCharArray [256] = {0};
printf("%d \n", myIntArray[2]);
printf("%f \n", myFloatArray[2]);
printf("%c \n\n", myCharArray[2]);
m... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* range_comb.c :+: :+: :+: ... |
C | #include <idt.h>
#include <isr.h>
#include <irq.h>
#include <tty.h>
#include <kb.h>
#include <timer.h>
#include <memory.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <paging.h>
#include <malloc.h>
/* This is only a test entry point */
void dummy_entry(){
}
static char *
ge... |
C | /******************************************************************************
* Unit Test 2
* Checks to see if player has 5 cards at start
* Primary tested function: numHandCards()
******************************************************************************/
#include <stdio.h>
#include "assert.h"
#include "../d... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing_memory.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
struct sockaddr_un *local;
static void die(const... |
C | #include "spi.h"
#include "usart_u.h"
/**
* SPI2 ʼ
*
**/
void SPI2_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
SPI_InitTypeDef SPI_InitStructure;
RCC_APB1PeriphClockCmd( RCC_APB1Periph_SPI2, ENABLE );//SPI2ʱʹ
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;
GPIO_InitStructure.... |
C | #include <stdio.h>
#include "./drivers/inc/LEDs.h"
#include "./drivers/inc/slider_switches.h"
#include "./drivers/inc/pushbuttons.h"
#include "./drivers/inc/HEX_displays.h"
int main() {
while (1) {
int readInteger = read_slider_switches_ASM();
int toHEXDisplays = read_PB_data_ASM() & 0x0000000F; // 0b1111
... |
C | #include "inodes.h"
// void locate_inode(int inode_number, int inodes_per_group, int* inode_group, int* inode_offset){
// *inode_group = (inode_number -1)/inodes_per_group;
// *inode_offset = (inode_number -1)%inodes_per_group;
// }
int is_dir(uint16 i_mode){
if(i_mode >= 0x4000 && i_mode < 0x5000)
return 1;
r... |
C | /**
* File: str.h
* Author: AWTK Develop Team
* Brief: string
*
* Copyright (c) 2018 - 2019 Guangzhou ZHIYUAN Electronics Co.,Ltd.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICU... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
int isolateExp(unsigned int hex, unsigned int nExp, unsigned int nFrac); //Prototype for function to isolate the exponent bits
double calculateExp(unsigned int iExp); //Prototype for function to calculate the exponent
int i... |
C | /**
************************************************************
* @file usart.c
* @brief
* @author Javid
* @date 2019-02-20
* @version 1.0
*
***********************************************************/
#include "sys.h"
#include "usart.h"
/*****************ڳʼ******************/
voi... |
C | /*
* reference: https://www.cnblogs.com/wangcq/p/3520400.html
*/
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
int socket_fd;
void socket_init()
{
int ret = socket_fd = socket(AF_INET, SOCK_STREAM, 0);
... |
C | /********************************
* OS Lab 1 Part 1a *
* *
* Usage: *
* ./part1a.exe *
* *
* Spawns a child process *
********************************
* For: Professor Megherbi *
* By: David T... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef enum {
FALSE,
TRUE
} BOOL;
typedef struct Element {
int row;
int column;
int element;
struct Element *line;
struct Element *col;
} Element;
typedef struct SparseMatrix {
int row;
int column;
Element **line; //Pointer Ve... |
C | #include <stdio.h>
// #include <ctype.h>
// #include <conio.h>
int main(){
char ch;
printf("Enter ch: ");
ch = getchar();
if( (ch>='A' && ch<='Z') || (ch>='a' && ch<='z') ) // if( isalpha(ch) )
printf("%c is an alphabet\n", ch);
else if( ch>='0' && ch<='9' ) // else if( isdigit(ch) )
printf("%c... |
C |
#include "test.h"
#include "symbol_set.h"
#include "chain.h"
static void header(const char * text)
{
printf("---------------- %s ---------------\n", text);
}
static void print_chain(GhBrain * gh, bool back)
{
for (size_t i = 0; i <= gh->chain_mask; i++) {
GhChain * chain = gh->chains[i];
whi... |
C | /*
** EPITECH PROJECT, 2017
** my_strcat.c
** File description:
** my_strcat.c
*/
#include "my.h"
char *my_strcat(char *dest, char const *src)
{
int len = my_strlen(src) + my_strlen(dest) + 1;
char *temp = malloc(sizeof(char) * len);
int i = 0;
int j = 0;
for (; src[i] != '\0'; i++, j++)
temp[j] = src[i];
fo... |
C | #include <stdio.h>
#define MAXLINE 1000 // maximum input line length
/*if these two are declared after print_longest_line_for_stdin, gcc will give warning*/
/*another solution is put print_longest_line_for_stdin function at last*/
int getline_for_me(char s[], int lim);
void copy_for_me(char to[], char from[]);
int p... |
C | #ifndef __COMMON_H__
#define __COMMON_H__
#include <tina_log.h>
/*----------------------------------------------------------------------
| result codes
+---------------------------------------------------------------------*/
/** Result indicating that the operation or call succeeded */
#define SUCCESS ... |
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... |
C |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <WINGs/WINGs.h>
void showSelectedColor(void *self, void *cdata)
{
WMColorPanel *panel = (WMColorPanel *) self;
printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
}
int main(int argc... |
C | /* Program : KelerengMudah_MuhammadFauzanLubis.c
Deskripsi : Menapilkan warna kelereng
Nama /Author : Muhammad Fauzan Lubis
Tanggal/versi : 24 Oktober 2019/1.0
Compiler : gcc (tdm64-1) 5.1.0
Pertanyaan : Terdapat sejumlah kelereng berwarna Merah (M), kelereng berwana Biru (B) dan kelereng be... |
C | #include<stdio.h>
struct COUNTRY
{
double achiv[3];
int rank[4];
int firank[2];
double gp;
double medalp;
/* data */
};
int main()
{
int m,n;
while(scanf("%d%d",&m,&n)!=EOF)
{
int opc[n];
struct COUNTRY country[m];
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < 3; ++j)
scanf("%lf",&countr... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... |
C | //
// Home Presence Detector
// AlanFromJapan http://kalshagar.wikispaces.com/
//
// includes
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
//use this trick to ""adjust"" the timer1 and subscale it
#define TIMER_DIVIDER 2
volatile uint16_t mTimerCounter = 0;
volatile unsigned cha... |
C | /*
* maze.h - header file for 'maze.c' module
*
* A maze contains a 2D array of objects that will be shared and updated
* by all the avatars. The avatar will make use of this maze to update walls
* and check for any existing walls. See object.h for details on each
* object in the array.
*
* CS50 Winter 2020
... |
C | /*
* RangeSumQueryImmutable2.c
*
* Created on: Sep 28, 2016
* Author: xinsu
*
* Dynamic programming, O(n) space
*/
/*
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.
Example:
Given nums = [-2, 0, 3, -5, 2, -1]
sumRange(0, 2) -> 1
sumRange(2, 5) ... |
C | void sorty()
{
double array_size=5;
const Double_t aray[5] = { 3, 1, 7, 9, 2 };
const int index[5];
aray= TMath::Sort(5,aray,index,0);
for(int i=0;i<5;i++){
cout << aray[i] << " ";
}
cout << endl;
for(int i=0;i<5;i++){
cout << index[i] << " " << aray[index[i]] << endl;
}
cout << endl;
}
|
C | #ifndef FUNCTION_H_INCLUDED
#define FUNCTION_H_INCLUDED
#define PI 3.1415926 //ԲPIĺ궨塣
#ifdef __cplusplus
extern "C"{
#endif
//Ŀ꺯
double f(double x);
/*********************************************************************************
data˫ȸ飻
keyֵ
left_indexʼ±ꣻ
right_indexֹ±ꣻ
ܣŴ㷨dataдkeykeyڵ±꣬
-1ֹ±ꡣ
*********... |
C | #include <stdio.h>
#include <syscall.h>
#include "threads/malloc.h"
int
main (int argc, char **argv)
{
int i;
printf("Hello pINTOS\n");
for (i = 0; i < argc; i++)
printf ("%s hello", argv[i]);
printf ("\n");
/*
for(i =0; i<10000;i++){
malloc(400);
printf("malloc....");
}
*/
return EXIT_SUCCESS... |
C | #include "sequence_list.h"
#include <stdlib.h>
/*
*ܣӡԱ
*
*/
void Display_Sq(SqList *L)
{
int i;
for (i = 0;i < L->length;i++)
{
printf("L %d elem is %d \n",(i + 1),L->elem[i]);
}
}
/*
*ܴԱ
*/
Status InitList_Sq(SqList *L)
{
//һյԱL
if (0 == (L->elem = (ElemType*) mall... |
C | #include <stdio.h>
#include <string.h>
//请编写一个函数void fun(char a[],char b[],int n),其功能是:删除以各字符串中指定下标的字符。其中,a指向原字符串,删除后的字符串存放在b所指的数组中,n中存放指定的下标。
void fun(char a[], char b[], int n)
{
a[n] = '\0';
strcpy(b, &a[0]);
strcat(b, &a[n+1]);
}
int main(void)
{
int n = 0;
char a[256] = {'\0'};
char b[256] = {'\0'};
print... |
C | /****************************************
> File Name: text.c
> Author: Lanotte
> Mail: ssy_lanotte@163.com
> Created Time: 2015年01月27日 星期二 14时22分40秒
> Function:
*****************************************/
#include <stdio.h>
int main()
{
printf("Helo");
return 0;
}
|
C | #include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include <unistd.h>
#include <time.h>
const long long N = 600851475143;
/**
* This program shows an approach with three functions to the 3rd problem of
* project euler. By further abstracting this logic, the steps of this
* problem get easier. There's still ... |
C | #include "civyobjectqueue.h"
#define Q_IS_EMPTY(q) (q->head == NULL)
typedef struct _cvobjectqueueentry {
CVCoroutine *routine;
CVObjectQEntry *previous;
CVObjectQEntry *next;
} CVObjectQEntry;
struct _cvobjectqueue {
CVObjectQEntry *head;
CVObjectQEntry *tail;
};
static void cv_init_object_qu... |
C | #include <stdio.h>
#include <stdlib.h>
#include "compearth.h"
/*!
* @brief Decomposes a general moment tensor into its isotropic and
* deviatoric components.
*
* @param[in] n Number of moment tensors.
* @param[in] M [6 x n] general moment tensors. The leading dimension
* is 6.... |
C | #ifndef MY_IO_UTILS_H
#define MY_IO_UTILS_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#define BF_SIZE 8
#define MAX_NUM 100
#define NUM_OF_LINE 8
void genRandArray(int* buffer, int dataSize) {
// seed
srand(time(NULL));
for (int counter = 0; count... |
C | #include <stdio.h>
#include <stdlib.h>
struct node {
int val;
struct node* next;
};
/* constructs a new node */
struct node* new_node(int val, struct node *next)
{
struct node* new_node = (struct node*) malloc(sizeof(struct node));
new_node->val = val;
new_node->next = next;
return new_node;
}
/* returns poin... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* draw2.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdbool.h>
bool mx_islower(int c);
bool mx_isupper(int c);
int mx_tolower(int c);
int mx_toupper(int c);
void mx_reverse_case(char *s);
void mx_reverse_case(char *s) {
char tmp[100];
for (int i = 0; s[i]; i++) {
if (mx_islower(s[i])) {
tmp[i] = s[i];
... |
C | #include <stdio.h>
unsigned int reverseBits(unsigned int n)
{
unsigned int i, result = 0;
for(i = 0; i < 32; i ++)
{
int tmp1 = (n >> i) << 31 >> i;
//int tmp2 = n >> (i+1);
//int tmp3 = (tmp1 | tmp2) >> i;
result = result | tmp1;
}
return result;
}
int main()
{
printf("%ud\n", reverseBits(43261596));
r... |
C | #include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
pthread_mutex_t mojmuteks=PTHREAD_MUTEX_INITIALIZER;
int buf[512];
void *prod(void *arg)
{
int i = 0;
while(true)
{
pthread_mutex_lock(&mojmuteks);
buf[i % 512] = i;
printf("prod umiescil %d ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_print_arg.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <string.h>
#include <unistd.h>
char buf[416];
char out[65536 + 4096] = "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\n";
int main(int argc, char **argv) {
const int o[16] = { 4, 7, 2, 11, 2, 7, 12, 2, 12, 7, 2, 11, 2, 7, 12, 2 };
char *t = out + 30;
unsigned long long i = 1, j = 1;
for (int... |
C | #include<stdio.h>
int main()
{//ABSOLUTE VALUE OF A NUMBER
int n;
printf("ABSOLUTE VALUE OF A NUMBER\nEnter number=");
scanf("%d",&n);
if(n<0)
n=n*-1;
printf("%d",n);
}
|
C |
//square of 12 is 144. 21 which is a reverse of 12 has a square 441 which is same as 144 reversed
//there are few numbers which have this property
//Program to find out whether any more such number exist in the range 10 to 100.
#include<stdio.h>
int getreverse(int n);
int main()
{
int num,revnum,sqrnum,r... |
C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
printf("Process ID of current process= %d\n",getpid());
printf("Process ID of parent process= %d\n",getppid());
printf("Real user ID of current process= %d\n",getuid());
printf("Effective user ID of current process= %d\n"... |
C | #include "bigint_internal.h"
#include <string.h>
#include <stdlib.h>
#include <assert.h>
// calculates the largest multiple of b that fits into a, returns the quotient
// and subtracts the appropriate amount from the remainder.
static WordType simpleDiv(size_t rlen, WordType* rbuf, size_t blen, const WordType* bbuf) {... |
C | #include <stdio.h>
int main(void)
{
double Year_Second = 3.156e+7;
printf("One year have %lf seconds.\n", Year_Second);
int ages;
printf("Enter your age: ");
scanf("%d", &ages);
printf("The age have %lf seconds.\n", ages * Year_Second);
return 0;
} |
C | /*
** put_fd.c for perfection in /home/skyrise/Work/Repositories/Epitech/IA/dante/generation/perfection/srcs/misc/
**
** Made by Buyumad Anas
** Login <buyuma_a@anas.buyumad@epitech.eu>
**
** Started on Tue Apr 26 15:49:22 2016 Buyumad Anas
** Last update Tue Apr 26 16:08:36 2016 Buyumad Anas
*/
#include <unistd.h>... |
C | // RadioFilter.cpp : Defines the entry point for the console application.
//
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
char *FindGoodPart(char *compPart);
int main(int argc, char *argv[])
{
printf("main ==>\n");
char currData[BUFSIZ];
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* builtin_unset.c :+: :+: :+: ... |
C | #include<stdio.h>
int main()
{
int b,c[50];
scanf("%d",&n);
int b,max;
for(b=0;b<n;b++)
{
scanf("%d",&c[b]);
}
max=a[0];
for(b=0;b<n;b++)
{
if(max<c[b])
{
max=c[b];
break;
}
}
printf("%d",max);
return 0;
}
|
C | //Single threaded test case to test error conditions
//Key not found, data request for more than 4KB
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <time.h>
#include <keyvalue.h>
#include <fcntl.h>
#include <assert.h>
int main(int argc, char *argv[])
{
int i = 0, number_of_threads = 1, num... |
C | /* By: Aijaz Ahmad Wani
email :aijazahmad9864@gmail.com
IMCA (SEM-2)
subject: DATA STRUCTURES
PROGARM:(a) : CALCULATE THE NUMBER OF STUDENTS WHO GET MORE THAN 60 MARKS
(b) : PRINT NAME AND MARKS OF STUDENTS WHO GET MORE THAN 60 MARKS*/
#include <stdio.h>
#include <stdlib.h>
struct student{
char name[10];
int marks;
... |
C | #include<stdio.h>
int main() {
while(1) {
float fahrenheit = 0;
scanf("%f", &fahrenheit);
if (fahrenheit == 0)
break;
float centigrade = ((fahrenheit - 32) / 9)*5;
printf("%f\n", centigrade);
}
return 0;
}
|
C | /*Inversion Count (n^2)
*
* @Prerna(1910990964)
*
* Assignment_7-SortingAlgorithms
*
*/
#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
int arr[n];
for(int i = 0; i < n; i++) {
scanf("%d",&arr[i]);
}
int inversions = 0;
for(int i = 0;i < n; i++) {
for(int j = i +... |
C | #include <stdio.h>
#include <stdlib.h>
#include "listadinordcab.h"
struct no{
int info;
struct no * prox;
};
Lista cria_lista() {
Lista cab;
cab = (Lista) malloc(sizeof(struct no));
if (cab != NULL) {
cab->prox = NULL;
cab->info = 0; }
return cab;
}
int lista_vazia(Lista lst) {
if (lst->prox== NULL)
return ... |
C | /*
============================================================================
Name : ex31.c
Author : Jonathan Geva - 304861347
Version :
Copyright : MINE ALL MINE!!!
Description : Server side - chomp game
============================================================================
*/
#inclu... |
C | #include <stdio.h>
#include <string.h>
int convert(char x)
{
return(x - 32);
}
int main()
{
char letra; scanf("%c", &letra);
printf("%c\n", convert(letra));
return(0);
}
|
C | /*
** EPITECH PROJECT, 2020
** str isprintable
** File description:
** project
*/
int my_str_isprintable(char const *str)
{
int i = 0;
int j = 0;
if (str[i] == '\0') {
return (1);
}
for ( ; str[i] != '\0' ; i++) {
if (str[i] > 31 && str[i] < 126) {
j++;
}
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <time.h>
#include <string.h>
#include "sort.h"
int* create_array(char category, size_t n);
int* create_array(char category, size_t n)
{
int *arr = NULL;
arr = (int *) malloc(n*sizeof(int));
//assert(arr != NULL);
if(category == 's')
{
for(u... |
C | #include <math.h>
#include <string.h>
#include "mex.h"
#include "flowlib.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
/* Matrices for inputs, temp variable, and output. */
double *Img1, *Img2, *Dx, *Dy; // Dx, Dy return values and Img1 and Img2
/* Sizes */
mwSignedI... |
C | /// \file
/// \brief Реализация функций из ArchipelagoCollection.h
/// \details Реализация функций из ArchipelagoCollection.h.
#include <malloc.h>
#include <assert.h>
#include <string.h>
#include "ArchipelagoCollection.h"
ArchipelagoCollection* ArchipelagoCollectionCreate()
{
ArchipelagoCollection* pCollection =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.