language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include<stdio.h>
int main(void) {
char xd[1] = {"5"};
int number = xd[0] - '0';
printf("\n%d\n", number);
return 0;
} |
C | //
// mysortstr.c
// lambda
//
// Created by Ксения Афанасьева on 12.11.17.
// Copyright © 2017 Ксения Афанасьева. All rights reserved.
//
#include "mysortstr.h"
int mysortstr(char arr[][STR_MAX_LENGTH], int n) {
if(n <= 0) {
return 1;
}
for(int i = 0; i < n-1; i++) {
for(int j = ... |
C | #include <stdio.h>
void func(int a, int *b)
{
printf("%d %d\n", a, *b);
}
int main(void)
{
int x = 0;
func(x++, &x);
return 0;
}
|
C | /*
============================================================================
Name : NKuckuckThreeNPlusOne.c
Author : Nicholas Kuckuck
Version :
Copyright : Simplified BSD License
Description :
============================================================================
*/
#include <stdio.h... |
C | #include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#define NUMSAMPLES 100000
inline unsigned long long int count() __attribute__((always_inline));
inline unsigned long long int count() {
unsigned int lo =0, hi=0;
__asm__ __volatile__ ( // serialize
"xorl %%eax,%%eax \n "
::: "%rax", ... |
C | #include <xc.h>
//set the timer in pragma config
#pragma config OSC = IRCIO, WDTEN = OFF //internal osciallator, WTD off
//include the LEDout function
void LEDout(int number) {
LATC = (number & 0b00111100) << 2; //set all the C pins we want to be a 8bit number
LATD = ((number & 0b11000000) >> 2) | ((number &... |
C | #include<stdio.h> /*˭Ȼõ˺֮͡*/
int main()
{
int jiu1,jiu2; /*jiu1Ⱦjiu2ҵȾ*/
int count[2]={0,0}; /*ҺȾ0ף1*/
int huihe; /*غ*/
int N1[200],N2[200]; /*廮ȭN1ףN2*/
int H1[200],H2[200]; /*庰H1,H2*/
int i;
int sum[200]; /*㿴˭ֵ˱Ȼ*/
scanf("%d %d",&jiu1,&jiu2);
scanf("%d",&huihe);
for(i=0;i<200;i++)
{
H1[i]=... |
C | #include <unistd.h> //Provides API for POSIX(or UNIX) OS for system calls
#include <stdio.h> //Standard I/O Routines
#include <stdlib.h> //For exit() and rand()
#include <pthread.h> //Threading APIs
#include <semaphore.h> //Semaphore APIs
sem_t cnt;
int sum=0;
void *thread(voi... |
C | #include "../includes/setTabMenuHeight.h"
int setTabMenuHeight(TabMenu *menu, unsigned int height)
{
if (!menu) {
fputs("Error : No menu provided\n", stderr);
return (0);
}
menu->menu_pos.h = height;
menu->tab_content_pos.h = height - (menu->header_pos.h + menu->tabs_preview_pos.h);
return (1);
}
|
C | #ifndef MLALIGN_INIT_SIMDWRAPPER_H
#define MLALIGN_INIT_SIMDWRAPPER_H
#include <assert.h>
#ifdef SIMD_ARCH_X86_SSE3
#include <xmmintrin.h>
const size_t VECSIZE = 2;
typedef __m128d dvec;
#elif defined(SIMD_ARCH_X86_AVX)
#include <immintrin.h>
const size_t VECSIZE = 4;
typedef __m256d dvec;
#else
#error("Specify... |
C | #include<stdio.h>
void reverse(long long int n,long long n1,long long int i)
{
long long int rev=0,rem;
while(n!=0)
{
rem=n%10;
rev=rev*10+rem;
n=n/10;
}
if(rev!=n1)
{
n=rev+n1;
n1=n;
i=i+1;
reverse(n,n1,i);
}
else
printf("%... |
C | "'You are provided with a number "N", Find the Nth term of the series: 1, 4, 9, 25, 36, 49, 64, 81, .......
(Print "Error" if N = negative value and 0 if N = 0).
Input Description:
An integer N is provided to you as the input.
Output Description:
Find the Nth term in the provided series.
Sample Input :
18
Sample Ou... |
C |
#define _CRT_SECURE_NO_WARNINGS
#include<Windows.h>
#include<stdio.h>
#pragma once
//!@brief FU蕪Ɏgp}N
enum E_COLOR{
BLUE = 0, //!<
GREEN, //!<
RED //!<
};
//!@brief 摜̏c̍őTCY
//!@details Ŏw肷邱
#define IMAGE_HEIGHT 50
//!@brief 摜̉̍őTCY
//!@details Ŏw肷邱
#define IMAGE_WIDTH 50
//!@brief `ʐ̏c̍őTCY
#define S... |
C | #include<stdio.h>
void greatestNum(int*,int*,int*,int*);
void main(){
int num1,num2,num3,g;
printf("\nEnter the 3 no.s\n");
scanf("%d %d %d",&num1,&num2,&num3);
greatestNum(&num1,&num2,&num3,&g);
printf("\nGreatest number is: %d\n",g);
}
void greatestNum(int*n1, int*n2, int*n3, int*g){
*... |
C |
#include "../tl_common.h"
#include "../mcu/clock.h"
#include "i2c.h"
#ifndef PIN_I2C_CN
#define PIN_I2C_CN GPIO_CN
#endif
#ifndef PIN_I2C_SCL
#define PIN_I2C_SCL GPIO_CK
#endif
#ifndef PIN_I2C_SDA
#define PIN_I2C_SDA GPIO_DI
#endif
static inline void i2c_wait(void){
}
void i2c_long_wait(void){
CLOCK_DLY_60... |
C | #include <stdio.h>
#include <string.h>
#define MaxLine 1024
int rmnewline(char line[MaxLine]){
int i;
while(line[i] != '\n')
i++;
line[i] = '\0';
return i;
}
int main(){
int i, j, Cnt;
char Word[1000][MaxLine], *ptr;
while(scanf("%s", Word[Cnt])!=EOF){
Cnt++;
}
for(... |
C | /*
* $Id$
*/
/************************************************************************
* *
* Copyright (C) 2003 *
* Internet2 *
* All Rights Reserved *
* *
************************************************************************/
/*
* File: arithm64.c
*
* Author... |
C | #include <stdio.h>
void troca(int *val1, int *val2);
int main(void)
{
int val1, val2;
printf("Coloque dois valores:\n> ");
scanf("%d %d", &val1, &val2);
troca(&val1, &val2);
printf("%d %d\n", val1, val2);
}
void troca(int *val1, int *val2) {
int aux;
aux = *val1;
*val1 = *val2;
*val2 = aux;
}
|
C | #include "libc/stdio.h"
#include <unistd.h> // for pipe, close, exec
#include <stdlib.h> // for free()
#include <errno.h>
#include "libc/cdefs.h"
static void do_child(int cfd, int rw, const char *cmd) __NORETURN;
static void do_child(int cfd, int rw, const char *cmd)
{
FILE *S;
int sfd; // stdin/stdout
if ... |
C | #include <stdio.h>
#include <stdlib.h>
int n;
int b[150]={0};
char a[600];
long long sum=0;
void print()
{
int i;
sum++;
for(i=1;i<=n;++i)
{
printf("%c",a[i]);
}
printf("\n");
}
void search(int i)
{
int j;
for( j='a';j<='z';++j)
{
if(b[j]!=0)
{
a[i]=j;
b[j]--;
if(i==n)
{
print();
}
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* array_utils.c :+: :+: :+: ... |
C | // =============================================================================
// <integer/convert/hexadecimal/deserialize/implicit/i32.c>
//
// 32-bit+ hexadecimal null-terminated string to integer conversion template.
//
// Copyright Kristian Garnét.
// --------------------------------------------------------------... |
C |
#include "tlb_hrchy_mng.h"
#include "addr.h"
#include "addr_mng.h"
#include "page_walk.h"
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include "error.h"
#include <stdbool.h>
//=========================================================================================================... |
C | #include <stdio.h>
#include <stdlib.h>
int main() {
float n1, n2, n3, media;
printf("Insira a primeira nota: ");
scanf("%f", &n1);
getchar();
printf("Insira a segunda nota: ");
scanf("%f", &n2);
getchar();
printf("Insira a terceira nota: ");
scanf("%f", &n3);
... |
C | /* Strukture */
#include <stdio.h>
typedef struct {
float x;
float y;
} tocka;
typedef double stanje;
int main(int argc, char **argv)
{
tocka a;
tocka *kaz;
stanje s = 4.3;
kaz = &a;
kaz->x=3.2;
a.y = -1.1;
printf("x: %g y: %g\n",kaz->y,a.x);
return 0... |
C | #include<iostream>
using namespace std;
int main()
{
int t;
unsigned long long int i,n;
cin>>t;
for(int j=1;j<=t;j++)
{
cin>>n;
if(n%2==0)
{
for(i=n/2;i>=1;i=i/2)
{
if((n%i==0)&&(i%2!=0))
{
cout<<"Case "<<j<<": "<<i<<endl;
break;
}
}
}
else
cout<<"Case "<<j<<": "<<n<<endl;
}
}
|
C | /*
* I DONT KNOW THE ORIGIN OF THIS SOURCE CODE FILE,
* THUS THE LICENSE AND AUTHOR ???
*
* Basile Fourcade: I've made some modifications in it.
*
* */
#ifndef __BUTTON_H__
#define __BUTTON_H__
// Button
#define NB_BUTTONS 1
#define LED_BUTTON_MODE_PIN 4
// Button timing variables
#define DEBOUNCE 10 //... |
C | #include<stdio.h>
#include<string.h>
int bigMOD(char *a, int b){
int len = strlen(a);
int mod = (a[0]-'0')%b;
int i=1;
for(;i<len;i++){
mod = (mod*10+(a[i]-'0'))%b;
}
return mod;
}
int getGCD(int a, int b){
while (b != 0) {
int t = b;
b = a % b;
a = t;
}
return a;
}
int main(){
int t;
scanf("%d",&... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_wstrjoin_leakless.c :+: :+: :+: ... |
C | #include <stdio.h>
int n;
int in[8001]; //has n-1
int out[8001]; //
int cmp(const void *a,const void *b){
return *(int*)a-*(int*)b;
}
int main(){
int i,j;
scanf("%d",&n);
for(i=0;i<n-1;i++){
scanf("%d",&in[i]);
}
for(i=0;i<n;i++) out[i]=i+1;
// for(i=0;i<n;i++) printf("out %d\n",out[i]);
for(i=n-2;i>... |
C | #include <stdio.h>
int main()
{
int a,b,N,d;
scanf("%d",&a);
while(a--)
{ scanf("%d",&N);
b=0;
while(N--)
{ scanf("%d",&d);
b+=d;}
printf("%d\n\n",b);
}
scanf("%d",&N);
b=0;
while(N--)
{ scanf("%d",&d);
b+=d;}
printf("%d\n... |
C | // demonstrates passing floating point arguments,
// returning a floating point value,
// and doing a calculation using the FPU register stack
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
int main ()
{
double f;
double w = 213.0;
double x = 43.0;
double y = 20.0;
double z = 1.2;
... |
C | #include "c_hmac_md5.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/md5.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <openssl/opensslv.h>
#include "common.h"
void crypto_hmac_md5(uint8_t *input, uint32_t inputLen, uint8_t *output) {
uint8_t hma... |
C | /* $ cc -Og -g -fsanitize=address,undefined test.c
* On x86-64, add -march=x86-64-v2 to test hardware implementation.
* This is free and unencumbered software released into the public domain.
*/
#include "crc32.h"
#include "crc32c.h"
#include "adler32.h"
#include "crc16x25.h"
#include <stdio.h>
#define COUNTOF(a) (... |
C | #include<stdio.h>
int main()
{
float cel,fr;
printf("enter the temprature in fr");
scanf("%f",&fr);
cel=5.0/9.0*(fr-32);
printf("temprature in cel=%f",cel);
return 0;
}
|
C | /*GPIO_InitTypeDef has 5 options:
GPIO_Pin: Choose pins you will use for set settings
GPIO_Mode: Choose mode of operation. Look down for options
GPIO_OType: Choose output type
GPIO_PuPd: Choose pull resistor
GPIO_Speed: Choose pin speed
*/
#include "stm32f4xx.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_gpio.h"... |
C | //common anode display in reverse
#include<pic.h> //header files
/*PRIVATE FUNCTION DECLARATION*/
void delay(unsigned int); //function to generate delay
//gfedcba
void main()
{
//1 will be off 0 will be ON
int n[10] = {0b1000000,0b1111001,0b0100100,0b0110000,0b0011001,0b0010010,0b0000010,0b1111000,0b0000000,0b0... |
C | #include<stdio.h>
#include<math.h>
int main()
{
int arr[10],n,i,count;
printf("Enter how many distance");
scanf("%d",&n);
printf("Enter the distance to be reached");
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<n;i++)
{
if(arr[i]<0)
{
printf("The distance can't be reached");
... |
C | #include "arvoreRN.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
/*int main()
{
arvore *inicio = (arvore*)malloc(sizeof(arvore));
inicio->raiz = NULL;
// Atribuição de valores
int valor1 = 12, valor2 = 2, valor3 = 13, valor4 = 32, valor5 = 1, valor6 = 10, valor7 = 4, valor8 = 0;
... |
C | #include<stdio.h>
int main()
{
int a,b,c,i,j,s=0,cnt=0,k=0;
scanf("%d %d %d",&a,&b,&c);
for(i=1;i<=a*c;i++)
{
if(i*b+b>=a)
{
s=i*b+b;
for(j=2;j<=c;j++)
{
if(s+b>=a*j)
{
cnt++;
s+=b;
}
else
{
s=0;
cnt=0;
break;
}
}
if(cnt==c-1)
{
k++;
pri... |
C | #include <stdio.h>
#define SOLVE_MODE 1
/**********************************************
Function Name : vSolveTraingle
Developer : Jack Kilby
First Breed : 2018-06-08
Update : 2018-06-08
Description : Solve Traingle by some known conditions
SOLVE_MODE == 1, means solve the traingle with 3 known sides.
Return ... |
C | // program C, care primeste ca si argumente nume de fisiere, pt fiecare argument se lanseaza cate un thread care
// a) determinam numarul de cuvinte din fisier si calculez media numarului de cuvinte.
#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
#include<string.h>
pthread_mutex_t m = PTHREAD_MUTEX_INITIAL... |
C | #include <sys/mman.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include "mem.h"
int m_error;
struct Node
{
int size;
struct Node *next;
};
struct Node *headFree = NULL;
struct Node *listPrev = NULL;
int init = 1;
int Mem_Init(int ... |
C | #ifndef SYM_VEC_H_
#define SYM_VEC_H_
#include <string.h>
#include <limits.h>
#include <ctype.h>
#define EPSILON 0
#define INT_IN_BITS ((signed)(8*sizeof(long)))
#define RE_SYM_VEC_LEN ((signed)((CHAR_MAX+1)/INT_IN_BITS))
typedef long SymbolVector[RE_SYM_VEC_LEN];
inline int legalChar(char c) { return isspace(c) ... |
C | #pragma once
//V̂̃f[^̍\
//V̂̎OW
typedef struct star_pos {
float px;
float py;
float pz;
};
//V̂̎Ox
typedef struct star_vel {
float vx;
float vy;
float vz;
};
//V̂̎Ox
typedef struct star_acc {
float ax;
float ay;
float az;
};
//V̂̏
typedef struct star_inf {
float m;
star_pos st_p;
star_vel st_v;
star_acc st... |
C | /* Программа 2 (06-1b.с) для иллюстрации работы с разделяемой памятью */
/* Мы организуем разделяемую память для массива из трех целых чисел.
Первый элемент массива является счетчиком числа запусков программы 1,
т. е. данной программы, второй элемент массива – счетчиком числа
запусков программы 2, третий элемент массив... |
C | #include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <getopt.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
#include <string.h>
#include <sched.h>
#include <stdint.h>
#include "SortedList.h"
int thdnum = 1;
int itenum = 1;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
int spin_lock = ... |
C | #include <stdio.h>
#include <omp.h>
#include <time.h>
#define INT_MAX 2147483647
double monte_carlo_pi()
{
const size_t N = 100000;
double step;
double x, pi, sum = 0.;
step = 1. / (double)N;
double start, end;
int circle_darts = 0;
omp_set_num_threads(2);
start = omp_get_wtime();
... |
C | #include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <semaphore.h>
#include <errno.h>
#include "helpers.h"
#define SA struct sockaddr
pthread_t* send_threads;
pthread_... |
C | #include "test_helper.h"
#include "rngs.h"
#include <math.h>
#include "dominion.h"
#include <stdio.h>
void printHand(struct gameState *game){
int currentPlayer = whoseTurn(game);
for (int i = 0; i < game->handCount[currentPlayer]; i++)
printf("Hand[%d]: %d\n", i, game->hand[currentPlayer][i]);
return... |
C | // #pragma once
// #include <SFML/System/Vector2.hpp>
//
// namespace Engine
// {
// class Vector2f : public sf::Vector2f
// {
// public:
// Vector2f()
// : Vector2f(0, 0)
// {
// }
//
// virtual ~Vector2f() = default;
//
// Vector2f(float X, float Y)
// : Vector2<float>(X, Y)
// {
// }
//
// /... |
C | /* Interesting! I am currently in the state where new shells seem
* to be ignoring SIGPIPE. The symptom is that when I start a new
* shell and run 'yes | head', it hangs. I suspect yes is inheriting
* the disposition and ignoring SIGPIPE. This probably has to do with
* the version of tmux I'm running. So this ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define HASH_SIZE 10000
struct hashnode {
struct hashnode *next;
int key;
int cnt;
};
struct hash_head {
struct hashnode *head;
};
struct hash_head *init() {
struct hash_head *db;
db = (struct hash_head*)malloc(sizeof(struct hash_he... |
C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
int x[30], count = 0;
int place(int k, int i)
{
int j;
for (j = 1; j <= k - 1; j++)
{
if ((x[j] == i) || ((abs(x[j] - i) == abs(j - k))))
return 0;
}
return 1;
}
void print_sol(int n)
{
int i, j;
count++;
printf... |
C | //Marcus Rolim
//ALGORITMO SELECTION SORT
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define MAX 100000
// INDICE DE FUNES
void bubbleSort(int *vetor);
//FIM INDICE DE FUNES
// INCIO DO MAIN
int main(){
int vetor[MAX];
bubbleSort(vetor);
return 0;
}
//FIM DO MAIN
// ESTRUTURAS DAS FUNES
voi... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "mem_managment.h"
void set_rand_num(int **matrix, int size)
{
srand(time(NULL)); /* Initialization, should only be called once */
for(int i = 0; i < size; i++)
{
for(int j = 0; j < size; j++)
... |
C | #ifndef Misc_H
#define Misc_H
#define debug true
#include <Arduino.h>
#include <Wire.h>
void debug_msg(String msg)
{
if (debug)
{
Serial.print("DEBUG ::\t");
Serial.println(msg);
}
}
float toDegree(float radian)
{
return 57.29578 * radian;
}
float toRadian(float degree)
{
return 0... |
C | #include <stdlib.h>
#include "f_header.inc"
/* This program edits all .100 data files and generates weather */
/* statistics for placement in the site.100 file */
/* Globals */
FILE *infp, *outfp, *deffp;
/* MAIN */
void main()
{
int answer, done, i;
/* Print title and date */
printf("\n DayCent 4.5 File Up... |
C | #define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define OPEN_OUTPUT (O_RDWR | O_CREAT | O_TRUNC)
#define OPEN_INPUT (O_RDONLY)
#define FILE_PERMS (S_IRUSR | S... |
C | #include <stdio.h>
#include <math.h>
int main ()
{
int a=0, b=0, A, i=1;
scanf("%d", &a); A=a;
scanf("%d", &b);
for (i=1;i < b;i++)
{
a += A;
}
printf("%d\n", a);
a = A;
i = 1;
while (i < b)
{
a +=A;
i++;
}
printf("%d", a);... |
C | /*
* Copyright (c) 1986, 1990 by The Trustees of Columbia University in
* the City of New York. Permission is granted to any individual or
* institution to use, copy, or redistribute this software so long as it
* is not sold for profit, provided this copyright notice is retained.
*/
/*
* program to move file a ... |
C | #include "syscall.h"
#include "stdio.h"
#include "stdlib.h"
#define BUFSIZE 1024
#define BUFSIZE2 300
char buf[BUFSIZE];
char buf2[BUFSIZE2];
int main(int argc, char** argv)
{
testCreatWriteClose();
testOpenClose();
testRead();
exit(0);
}
<<<<<<< .mine
int testCreatWriteClose() {
char * fileName = "/Users/will... |
C | //Strong no is a number in which sum of factorial of individual digits is equal to the number
#include<stdio.h>
void strong(int n)
{
int fact=1,i,sum=0,j;
for(i)
for(j=1;j<=n;j++)
{
fact=fact*i
}
}
int main()
{
int a;
printf("Enter no. :");
scanf("%d",&a);
str... |
C | #include <stdlib.h>
#include <stdio.h>
#include "task.h"
#include "schedulers.h"
#include "list.h"
#include "cpu.h"
struct node *head = NULL, *tail = NULL;
int size = 0;
void add(char *name, int priority, int burst) {
Task *temp = malloc(sizeof(struct node));
temp->name = name;
temp->priority = priority;
temp-... |
C |
/*one-pass algorithm to calculate the covariance*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
/*
x -- the variable which is to calculate it's variance
length -- the length of the x, it is int
var -- the variance of x that we need, it is double
mx -- mean of x
my -- mean of y
mxprev -... |
C | #include <stdio.h>
#include <setjmp.h>
#include <sched.h>
#define JUMP_PARENT 0x00
#define JUMP_CHILD 0xA0
#define JUMP_INIT 0xA1
struct clone_t {
char stack[4096] __attribute__((aligned(16)));
char stack_ptr[0];
jmp_buf *env;
int jmpval;
};
static int child_func(void *arg) __attribute__ ((noinline));
static in... |
C | #include "termhdr.h"
/*
** Set input file descriptor and type-ahead descriptor.
** If fd < 0, only the type-ahead descriptor is set.
**
** Written by Kiem-Phong Vo
*/
#if __STD_C
int typeahead(int fd)
#else
int typeahead(fd)
int fd;
#endif
{
if(fd < 0)
_ahead = fd;
else tinputfd(fd);
return OK;
}
|
C | #include <stdlib.h>
#include <stdio.h>
#include "dado.h"
#include <assert.h>
/* Gera $l$ observaes de acordo com o modelo $(a, e)$.
A matriz de transio de estados $a$ possui dimenses $N \times N$.
A matriz de emisso de smbolos $e$ possui dimenses $N \times M$.
A funo imprime uma seqncia de $l$ observaes de a... |
C | #include <math.h>
#include <stdio.h>
int main(){
double x1;
double x2;
double x3;
if(-15.0 <= x1 && x1 <= 15 && -15.0 <= x2 && x2 <= 15.0 && -15.0 <= x3 && x3 <= 15) {
double res=2*x1*x2*x3 + 3*x3*x3 - x2*x1*x2*x3 + 3*x3*x3 - x2;
if(-56010.0001 >= res || res >= 58740.0)
printf("Solved 75");
... |
C | /*******************************************************************
* Filename: parcer.c
* PURPOSE:
* Recursive Descent Predictive Parser (RDPP) for the PLATYPUS 2.0 language.
* CST8152, Assignment #3
*
*
* Created by: Frederic Desjardins
* Student#: 040941359
* Date: December 13th... |
C | /** @file
* Udostępnia funkcje wypisującą kolorową planszę
*/
#ifndef ENHANCED_PRINT
#define ENHANCED_PRINT
#include <stdlib.h>
#include "basic_manipulations.h"
/** @brief Wypisuje planszę do gry gamma z autorsko pokolorowanymi polami
* Wypisuje planszę kolorując pola na które gracz @p player może wykon... |
C | /*
Author: hutterj
Date: 2017.02.07
File: unittest1.c
Purpose: Perform unit tests of function buyCard in dominion.c
Rules of buyCard:
supplyPos must be valid (be within game spec)
cannot buy if less than one buy available
cannot buy if no cards in specified supply pile left
cannot buy is card's price is more than ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../inc/maze2.h"
#include "../inc/set.h"
#include "../inc/floodfill.h"
#include "../inc/motion.h"
#include "../inc/sensor.h"
#include "../inc/exploration.h"
#include "../inc/tests.h"
U8 BitCount(U8 n)
{
U8 count = 0;
while (n != 0)
{
... |
C | //priority q using array,ok
#include<stdio.h>
#include<conio.h>
struct pqueue
{ int data;
int priority;
};
struct pqueue a[50];
int front=-1,rear=-1,max=50;
void qinsert(int,int);
int qdelete();
void create();
void additem();
void display();
void main()
{ int c,i;
do
{ clrscr();
printf("\t\tM E N U");
p... |
C | #include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char name1[15]="Hello ";
char name2[15]="World !";
clrscr();
printf("name1 =%s \t name2=%s",name1,name2);
strcat(name1,name2);
printf("\n After using the String cat Function");
printf("\n String at Name1 is %s ",name1);
getch();
}
|
C | /* 5-12.c
#include <stdio.h>
int main(int argc, char* argv[ ])
{
int i=0;
printf("ڿ : %d \n", argc);
for(i=0; i<argc; i++)
{
printf("argv[%d] : %s \n", i, argv[i]);
}
return 0;
}
*/ |
C | #include "ft_printf.h"
#include "ft_printfn.h"
void ft_putchar_fd(char var, int fd)
{
write(fd, &var, fd);
}
static void ft_wrap_fd(t_mask *mask, int fd)
{
int cnt;
cnt = 0;
if (mask->prec)
mask->wrapper.padding_sym = ' ';
while (cnt < mask->wrapper.sym_amnt)
{
write(fd, &(mask->wrapper.padding_sym), 1);
... |
C | /**************************************************************
* Subject: Numerical Methods & Programming
* Purpose: Numerical Integration
* Technique: Weddle's Rule
* N.B.: Assumed given a function f(x), change the
* definition of f(x) to match required function
* or introduce an array if to compute using
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsplit.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <math.h>
//lista 5 exercicio 9
int main()
{
float a, b, c, d, x1, x2;
printf("\nInsira os coeficientes da equacao de 2 grau.: \n");
scanf("%f%f%f", &a, &b, &c);
if(a!=0){
d = pow(b,2.0)-4.0*a*c;
if(d==0.0){
printf("\nUma raiz\n");
x1=-... |
C | #include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "em_general.h"
int main(int argc, char **argv) {
// number of arguments main takes
if (argc != 2) {
perror("Error: Invalid arguments\n");
exit(EXIT_FAILURE);
}
FILE *file;
file = fopen(argv[1]... |
C | /*
viet chuong trinh nhao day so thuc x1, x2,..,xn (0<n<100)
Tim phan tu am lon nhat
*/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
main()
{
int i, n, dem = 0;
float *a, max = -3.4e38;
do
{
printf("Nhap so phan tu cua mang n = ");
scanf("%d", &n);
}while(n<=0 || n>=100);
... |
C | struct words
{
int len;
char word[20];
};
int main()
{
int n,i,size,count=0;;
struct words *a;
scanf("%d",&n);
a=(struct words *)malloc(sizeof(struct words)*n);
for (i=0;i<n;i++)
{
size=0;
scanf("%s",&(a+i)->word);
for (size=0;(a+i)->word[size]!='\0';size+... |
C | #include "path.h"
inherit FORESTROOM;
void setup()
{
set_light(80);
add_property("no_undead",1); set_short("Realm of the Elf: High Forest");
set_long("\n Realm of the Elf: High Forest.\n\n"
" This looks like a peaceful well guarded part of the forest. "
"There are lots of strange beautiful pla... |
C | #include<stdio.h>
#include<stdlib.h>
struct grafos{
int nVertices, ehPonderado, *grau;
int **arestas, **pesos;
};
typedef struct grafos Grafos;
typedef struct{
int **mat;
Grafos *gr;
}Estados;
struct pilha{
int n;
struct pilha *prox;
};
typedef struct pilha Pilha;
Grafos* criaGrafo(int vert... |
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 | #include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "rom/uart.h"
#include "include/flipdot.h"
#include "include/snake.h"
#include "include/fill.h"
#include "include/text.h"
static const char* TAG = "Snak... |
C | /* external dependencies
* ────────────────────────────────────────────────────────────────────────── */
#include "tasty_regex_run.h"
#include "tasty_regex_utils.h"
/* helper macros
* ────────────────────────────────────────────────────────────────────────── */
#ifdef __cplusplus
# define NULL_POINTER nullptr /* us... |
C | #include <stdio.h>
#define TRUE 1
#define FALSE 0
/* contig: collapse contiguous spaces into a single space */
int main()
{
int c, inspace = FALSE;
while ((c = getchar()) != EOF) {
if (c == ' ') {
if (!inspace) {
inspace = TRUE;
} else {
continue;
}
}
else if (c != ' ' && inspace)
inspace... |
C | #include <stdio.h>
#include <string.h>
/*
* Program Name: convertLowerCase.c
* Author(s): Rehan Nagoor Mohideen
* Student ID: 1100592
* Purpose: Convert all alphabetic characters to lower case. Returns the number of characters converted from upper case to low
*/
int convertLowerCase ( char *line ){
int i;
int... |
C | #include <msp430.h>
#include <libTimer.h>
#include "lcdutils.h"
#include "lcddraw.h"
#include "p2switches.h"
#define LED_GREEN BIT6 // P1.6
short redrawScreen = 1;
u_int fontFgColor = COLOR_GREEN;
u_char helloCol = 10;
u_char nextHelloCol =10;
signed char helloVelocity = 1; // move one pixel to right
vo... |
C |
#include<stdio.h>
#include<stdlib.h>
#include<string>
struct Node{
int size;
int top;
char *arr;
};
int isFull(struct Node *ptr){
int top = ptr->top;
int size = ptr->size;
if(top==size-1){
// printf("The stack is now full");
return 1;
}else{
return 0;
}
}
int isEmpty(struct Node *ptr){
int ... |
C | #define _WINSOCK_DEPRECATED_NO_WARNINGS
//ͷļݲִСд
#include<stdio.h>
#include<WinSock2.h>
#pragma comment(lib, "ws2_32.lib")
int main(void)
{
//
//typedef unsigned short WORD;
WORD wdVersion = MAKEWORD(2, 2); //ֽڷ汾ţֽڷŸ汾
WSADATA wdMsgStr;
//ִгɹ᷵0
//ЩʵǺ궨
int nRes = WSAStartup(wdVersion, &wdMsgStr);
//봦
if... |
C | /* include if_nametoindex */
#include "unpifi.h"
#include "unproute.h"
unsigned int
if_nametoindex(const char *name)
{
unsigned int idx, namelen;
char *buf, *next, *lim;
size_t len;
struct if_msghdr *ifm;
struct sockaddr *sa, *rti_info[RTAX_MAX];
struct sockaddr_dl *sdl;
if ( (buf = net_rt_iflist(0, 0,... |
C | #include <stdio.h>
struct fun
{
int x;
} a = { 32 };
void pfun2(struct fun **z)
{
}
void pfun(struct fun *z)
{
pfun2(&z);
printf("%d\n", z->x);
}
int main(int argc, char **argv)
{
pfun(&a);
return 0;
}
|
C | #include<stdio.h>
int strend(char *s,char *t,int l,int m);
void main()
{
int l,m;
char a[20],b[10];
printf("enter the string a :");
gets(a);
printf("enter the string b :");
gets(b);
l=strlen(a);
m=strlen(b);
strend(a,b,l,m);
}
int strend(char *s,char *t,int l,int m)
{... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct binary_search_tree
{
int item;
int h;
struct binary_search_tree *right;
struct binary_search_tree *left;
}binary_search_tree;
binary_search_tree* create_empty_bst()
{
return NULL;
}
binary_search_tree* create_binary_search_tree(int item, binary_search_tree *... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h> //strlen
#include<sys/socket.h>
#include<arpa/inet.h> //inet_addr
#include<pthread.h>
#define Buffer_size 200
volatile sig_atomic_t flag = 0;
int sockfd = 0;
void str_overwrite_stdout() {
printf("%s", "> ");
fflush(stdout);
}
void str_trim_lf (char* ... |
C | #include <stdlib.h>
#include "team.h"
struct Team create_team(int population, char* names[], int* favorites) {
// struct Person member;
struct Team output;
int i;
output.population = population;
output.people = malloc(sizeof(struct Person) * population);
for (i = 0; i < population; i++) {
output.people[i].favor... |
C | //Michael Morris
//CS 3060-001 Spring 2015
//Assignment #3
/* Promise of Originality
I promise that this source code file has, in it's entirety, been
writthen by myself and by no other person or persons. If at any time an
exact copy of this source code is found to be used by another person
this term, I understand that ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.