language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include "shape.h"
e_shape shape_name(s_shape_grid* grid){
int nb_label_w = grid->label_w_size;
int nb_label_h = grid->label_h_size;
if(nb_label_w == 1 || nb_label_h == 1){
if(nb_label_w < nb_label_h){
if(is_stick_h(grid)) return STICK_H;
}
if(is_stick_v(grid)) re... |
C | #include "sobject_common.h"
#include "sobject.h"
int main(){
Object *obj;
const Error *error;
OBJECT_CTOR(Object, obj);
SET_ERROR(Object, obj, "Test");
if ((error = METHOD_CALL(Object, getError, obj))){
printf("Error string: %s\n", error->string);
printf("Error errno: %d\n", error->errno);
printf("Error f... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* alg_pivot.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
FILE *fp = fopen(argv[1], "r");
int i = 0;
int c;
while((c = fgetc(fp)) != EOF){
if (c >= 128 && c <= 255){
printf("%s: byte %d is non-ASCII\n", argv[1], i);
return 0;
}
... |
C | #include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[])
{
int num1,num2,diferenca;
printf("\nDigite o primeiro valor: ");
scanf("%d", &num1);
printf("\nDigite o segundo valor: ")... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int num_case;
int main(int argc, char **argv)
{
int cas;
int n, i;
double a0, an1, ci;
double sum;
scanf("%d", &num_case);
for (cas = 0; cas < num_case; cas++)
{
scanf("%d", &n);
scanf("%lf %lf", &a0, &an1);
an1 /= ((double)(n + 1));
... |
C | #include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char name1[20],name2[20];
printf("enter name1:");
scanf("%s",name1);
printf("enter name2:");
scanf("%s",name2);
if(!strcmp(name1,name2))
printf("yes");
else
printf("no");
getch();
} |
C | #include <stdio.h>
#include <math.h>
int main() {
int a, b, c;
double x, y;
scanf("%d%d%d%lf%lf", &a, &b, &c, &x, &y);
printf("%.3lf\n%.3lf\n%.3lf\n%.3lf\n", 300.0, (double)c*(double)sqrtl(a*a+b*b), 2.087, y+a%5*(int)(x+y)/2%4);
return 0;
} |
C | #include<stdio.h>
int t = 3;
void multiplica(int a[][t], int b[][t], int c[][t]){
for(int i=0; i<t; i++){
for(int j=0; j<t; j++){
int res = 0;
for(int k=0; k<t; ++k){
res+=a[i][k]*b[k][j];
}
c[i][j] = res;
}
}
}
voi... |
C | #include <stdio.h>
#include <stdlib.h>
//Copied from the tutorial 9 code
const int BLOCK_SIZE = 512;
void writeBlock(FILE* disk, int blockNum, char* data){
fseek(disk, BLOCK_SIZE*blockNum, SEEK_SET);
fwrite(data, BLOCK_SIZE, 1, disk);
}
char* readBlock(FILE* disk, int blockNUM, char* buffer){
fseek(disk, blockNUM *... |
C | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Main.c
* Author: Admin
*
* Created on May 18, 2021, 11:22 PM
*/
#include <stdio.h>
#include <stdlib.h>
#include <l... |
C | #include<stdio.h>
int main()
{
int score[20];
int scoreCount = 0;
int temp;
int i,j;
int newScore;
int oldScore;
printf("ɼ(-1):");
scanf("%d", &temp);
while (temp != -1) {
score[scoreCount++] = temp;
printf("ɼ(-1):");
scanf("%d", &temp);
}
for(i = 0; i < scoreCount; i++)
{
printf("%d ",score[i]... |
C | #include "config_rw_def.h"
#include "config_rw_lib.h"
/** Internal Functions **/
FILE *CfgFileOpen(SD_UINT8 *cfgfileName)
{
FILE *cfgfile = NULL;
if (cfgfileName != NULL)
{
cfgfile = fopen(PLAT_STR(cfgfileName), "r+");
if (cfgfile == NULL)
{
printf("CfgFileOpen: Failed to open preference file (%s).", ... |
C | #include <stdio.h>
#include <stdlib.h>
int frobcmp(const void *a, const void *b);
void* doubleMemSize(void* ptr, int* size);
int allocFailure();
int main() {
// start with list memory size at 8, double if needed
int listSize = 0;
int listMemSize = sizeof(char*) * 8;
char** wordList = (char**) mall... |
C | #include <stdio.h>
#include <fcntl.h>
int main(){
struct flock lock;
lock.l_type = F_RDLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 1;
lock.l_len = 1;
lock.l_pid = -1;
int fd = open("./1.txt",O_CREAT | O_RDWR , 0600);
int rc = fcntl(fd,F_SETLKW,&lock);
if(rc<0){
printf("lock 1.txt.offset.1 read fail\n");
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main()
{
int X, Cont=0;
scanf("%d", &X);
if((X / 2) != 0){
X += 1;
}
while(Cont<6){
printf("%d\n", X);
X += 2;
Cont++;
}
return 0;
} |
C | /*
* Author: Byron Kropf
* Contact: kropfb@onid.orst.edu
* Created: January 25 2012
* Last Modified: February 2 2012
*
* Explaination: Main file for the second assignment of CS311 which will
* read a text file and output all of the unique words in the file, in
* alphabetical order.
* Example c... |
C | #include"double linked list.h"
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void init(struct dlist* list)//p_headp_endΪȫֱ
{
list->p_head = NULL;
list->p_end = NULL;
}
//ûнڵ
int isempty(struct dlist* list)
{
return !(list->p_head) && !(list->p_end);//ûнڵ㷵1нڵ㷵0
}
//Ľڵ
int getsize(struct dlist* list)
{
if... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bwt.h"
#include "lcp.h"
#include "longpat.h"
#include "bittree.h"
#include "tipos.h"
#include "common.h"
#include "macros.h"
void show_bwt_lcp(uint n, uchar* src, uint* r, uint* h) {
int i, j;
printf("\n");
printf(" i r[] lcp \n");
forn(i, n) ... |
C | /*
* test-42.c
* Copyright (C) 2015 benjamin <benjamin@assus>
*
* Distributed under terms of the MIT license.
*/
#include <stdio.h>
#include <gtthread.h>
gtthread_mutex_t g_mutex;
void* worker(void* arg)
{
gtthread_t th2;
if(arg != NULL) {
gtthread_create(&th2, worker, NULL);
} else {
arg = (void*... |
C | #include "test1a.h"
int main(int argc, char * argv[])
{
struct font fonts[10]={{0, 12, LEFT, false, false, false}};;
char ch;
int num=0;
for(unsigned int i=1; i<10; i++) {
fonts[i]=fonts[0];
fonts[i].id=i;
}
show_font(&fonts[0]);
CHOOSE;
while(scanf("%c", &ch) == 1 && ch... |
C | #include <stdio.h>
#define TRUE 1
#define FALSE 0
#define MAX 1000000
int ePrimo (int valor, int count, int numPrimo[]);
int main(void){
int count = 1 ;
int valor;
int numPrimo[MAX];
numPrimo[0] = valor = 2;
while (count != (MAX)){
// valor++;
// if (valor%2 != 0){
if ... |
C | /** assmt2.c
*
* Created by Jiayin Cai
* (jiayinc@student.unimelb.edu.au)
* 02/10/2017
*
* Input a list of movie gross earnings data, and output
* statistics calculated on it.
*
* To run the program type :
* ./assmt2 < input_file
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <stri... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_utoa_base.c :+: :+: :+: ... |
C | #include "MyInclude.h"
/**
* Tableaux globaux utilisé pour faire des subtitutions
* et des permutations de bits.
*
* tabSubstitution : Associe une valeur sur 4 bits à une autre valeur
* sur 4 bits.
* invTabSubstitution : Tableau inverse de tabSubstitution.
*
* tabPermutation : Associe la p... |
C | /*
* $QNXLicenseC:
* Copyright 2007, QNX Software Systems. All Rights Reserved.
*
* You must obtain a written license from and pay applicable license fees to QNX
* Software Systems before you may reproduce, modify or distribute this software,
* or any work that includes all or part of this software. Free dev... |
C | #include <stdio.h>
#include <string.h>
long int compute(long int C, long int w[], long int v[], int n, int len, int loc)
{
unsigned char used[n], solution[n];
long int cur_value = 0;
long int cur_weight = 0;
long int max_value = 0;
long int weight_of_max = 0;
int done = 0;
int i;
bzero... |
C | #include <stdio.h>
// Function for binomial coefficient table
int bin_table(int val) {
for (int i = 0; i <= val; i++) {
printf("%2d", i);
int num = 1;
for (int j = 0; j <= i; j++) {
if (i != 0 && j != 0)
num = num * (i - j + 1) / j;
printf("%4d", num);
}
print... |
C | //Adrian-Valeriu Croitoru, 312CA
#include <stdio.h>
#include <stdlib.h>
int *init_array(int n);
int **init_matrix(int n, int *v);
char **init_matrix_char(int n, int *v, int **mat);
char **init_matrix_char_2(int n, int *v, char **mat_char);
void free_memory(int n, int *v, int **mat, char **mat_char, char **mat_char_2)... |
C | #include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include"Test.h"
int binary_search(const int arr[],const int data,int left,int right)
{
int mid=left+((right-left)>>1);
assert(arr);//ԣarrΪ
if(arr[mid]==data)
return mid;
else if(left >= right)//δҵ,rightֵΪszֵȥȺţֹԽ
{
return -1;
}
else if(arr[mid]<data)... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int counter(char *str, int len)
{
int x, a = 0, e = 0, i = 0, o = 0, u = 0, ch = 0, cnt = 0, sps = 0;
float ra, re, ri, ro, ru, rch, spsr;
for(x = 0; x < len; x++)
{
switch(*(str + x))
{
case 'a':
case 'A':
a++;
break;
case 'e':
case 'E':
... |
C | #include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct queue
{
int info;
struct queue *next;
};
struct queue *front,*rear,*curr,*dis;
void enqueue()
{
printf("Enter the Element to be Added\n");
curr=(struct queue*)malloc(sizeof(struct queue));
scanf("%d",&curr->info);
curr->next=NULL;
... |
C | #include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#define BYTE 256
#define KBYTE 1024
uint64_t number = 0, count[BYTE] = { 0 };
uint8_t buffer[KBYTE] = { 0 };
void tally(int file) {
int length;
while ((length = rea... |
C | #ifndef _SQLITE_MAIN_H
#define _SQLITE_MAIN_H
#include <stdio.h>
#include <string.h>
#include "sqlite3.h"/* sqlite 数据库操作第三方库头文件 */
#ifdef WIN32
#pragma comment(lib, "sqlite3.lib")
#endif
#ifndef boolean
#define boolean
/* 定义布尔型变量 */
typedef enum boolean {false, true} bool;
#endif
#ifndef BOOLEAN
#define BOOLEAN
/* 定... |
C | #include <stdio.h>
#include <stdlib.h> //malloc(), free(), system()
#include <string.h> //memset(),
#include <sys/types.h> //opendir(),
#include <dirent.h> //opendir(),
#include "common.h"
void hex_dump(char *data, int len)
{
int i = 0;
for (i = 0; i < len; i++)
{
if (!(i % LINE_DIS_NUM))
... |
C | #include<stdio.h>
int main()
{
int n, cnt=0;
scanf("%d", &n);
char arr[n][10];
for(int i=0; i<n; i++){
scanf("%s", arr[i]);
}
for(int i=0; i<n; i++){
if(arr[i][0]== 'O' && arr[i][1] == 'O'){
printf("YES\n");
arr[i][0]= '+';
arr[i][1]= '+';
for(int i=0; i<n; i++){
prin... |
C | #include "param.h"
#include "types.h"
#include "stat.h"
#include "user.h"
#include "syscall.h"
#include "memlayout.h"
#define PAGE_SIZE 4096
#define INFINITY_AND_BEYOND 100000
void
stackOverflow(){
stackOverflow();
}
void
allocToTheMoon(){
char* addr;
printf(1, "testing allocToTheMoon\n");
if (fork() == 0){
... |
C | /*
Student Name:Sambhav Siwakoti
Subject:Programming Fundamental
Roll No.:
Labsheet No.:2
Program:Write a C program to prime sum of two numbers,asked from user.
Date:16 Nov. 2016
*/
#include<stdio.h>
#include<conio.h>
int main(){
int a,b,sum;
printf("Enter the first number\n");
scanf("%d",&a);
pr... |
C | #include<stdlib.h>
#include<stdio.h>
struct node
{
int data;
struct node* link;
}*start=NULL;
typedef struct node NODE;
void create(int num)
{
NODE* temp=(NODE*)malloc(sizeof(NODE));
NODE* q;
temp->data=num;
temp->link=NULL;
if(start==NULL)
start=temp;
else
... |
C | /*
* Usage: new <object>
* Desc: Finds <object> in inventory, updates the file, and re-clones
* the <object> (destructing old object instance).
*/
object targ, newtarg;
string *tloc, loc;
int cmd_new(string arg) {
if(!arg) return 0;
targ = present(lower_case(arg), this_player());
if(targ) {
loc = basename... |
C | // Convert latitude and longitude to Maidenhead grid locators.
//
// adapted from Ossi Väänänen's code https://ham.stackexchange.com/questions/221/how-can-one-convert-from-lat-long-to-grid-square
// test cases lifted from https://gist.github.com/laemmy/maidenhead.py
//
#include "stdio.h"
#include "stdlib.h"
int main(... |
C | #include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
/*
This program provides a possible solution for first readers writers problem using mutex and semaphore.
I have used 10 readers and 5 producers to demonstrate the solution. You can always play with these values.
*/
sem_t wrt;
pthread_mutex_t mutex;
int c... |
C | #include "display_driver.h"
#include "GFXfont/Fonts/FreeMono9pt7b.h"
#include "GFXfont/Fonts/FreeSans9pt7b.h"
int main() {
disp_init();
disp_start_write();
disp_set_font(&FreeSans9pt7b);
disp_set_pos(0,15); // y-coordinate defines bottom (base) line of text
disp_write_str("Hello, world!");
ui... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "table.h"
#include "functions.h"
int check_table(Table** table){
if(*table){
return 1;
}
else{
printf("Error! No table found in memory.\n");
return 0;
}
}
void delete_table(Table** table){
if(check_table(table) != 0)
... |
C | /**
* \file dixon.c
* \brief An implementation of Dixon's Attack using bignums.
*
* Given a non-empty set B of primes, called factor-base, and
* given a non-empty set of random numbers R, s.t. ∀ r ∈ R, s ≡ r² (mod N) is B-smooth.
*
* Try to find
* U ⊂ R | (Πᵤ rᵢ)² ≡ Π s (mod N) and by defining x ≝ Πᵤ rᵢ, y ≝... |
C | /****************************************************************************/
/* */
/* Class implementing Interface for Course viewing system
Supported functionallity and Complexity, n being the number of courses in the system, m being the ove... |
C | #include <stdio.h>
#include <math.h>
double acosh(double d);
int main()
{
double a, x, g, f, y ;
printf ( "Введите x и a \n" );
scanf ( "%lf", &x );
scanf ( "%lf", &a );
g = (3*(-3*pow(a,2)+2*a*x+21*pow(x,2)))/(35*pow(a,2)+37*a*x+6*pow(x,2));
f = 1/(cos(3*pow(a,2)+5*a*x+2*pow(x,2)));
y = ... |
C | /*
* File: a16dc.c
* Purpose: Simple Driver or API for AdC16/PGA
* This file contains the following two functions:
* 1. ADC_Cal: calibrates the ADC
* 2. ADC_Config_Alt: Simply configures an ADC per a structure
*
* Typical usage: Fill the structure with the ADC and PGA register contents
* needed for... |
C | #include <stdio.h>
#include <stdlib.h>
extern char **environ;
int main()
{
char *range = getenv("HTTP_RANGE");
if (range)
{
printf("Content-Type: audio/wav\nContent-Range: %s\n\n", range);
printf("RI");
}
else
{
printf("Content-Type: audio/wav\n\n");
char **env;
for (env = environ; *env; ++env)
... |
C | #include<stdio.h>
#include <stdlib.h>
int main()
{
char s[10000];
int i, j, count;
scanf("%s", s);
for(i=0;i<strlen(s);i+=count)
{
count=1;
for(j=i+1;s[j]==s[i];j++)
{
count++;
}
printf("%c", s[i]);
if(count>1)
{
printf(... |
C | #include "mpi.h"
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
unsigned char r;
unsigned char g;
unsigned char b;
}pixel;
typedef struct {
char type;
int width;
int height;
int maxValue;
void* matrix;
}image;
int numtasks;
float IDENTITY[9... |
C | #include <stdio.h>
/**
* main - entry point.
*
* Return: 0.
*/
int main(void)
{
int a, b, first, second, third, fourth;
for (a = 0; a <= 99; a++)
{
first = a / 10;
second = a % 10;
for (b = a + 1; b <= 99; b++)
{
third = b / 10;
fourth = b % 10;
putchar(first + '0');
put... |
C | #include <stdio.h>
#include <stdlib.h>
#include "io.h"
void strip_comments(char * line) {
size_t len = strlen(line);
bool found_comment = false;
for (int i=0; i<len; i++) {
if (line[i] == '#') {
found_comment = true;
}
line[i] = found_comment ? '\0' : line[i];
}
}
char * trim_trailing_whitespace(char *... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int s, t, v;
while(scanf("%d %d", &v, &t)==2) {
if(t==0) printf("0\n");
else {
s= v*t*2;
printf("%d\n", s);
}
}
return 0;
}
|
C | /*
* matrix.c
*
* Created on: 02-Jan-2018
* Author: ccare
*/
#include<avr/io.h>
#include<util/delay.h>
#include"../AVRmatrix/DATABASE.h"
#include"../AVRmatrix/compare.h"
#define clk 0
#define data 1
#define lch 2
int p,fd[8];
int dataarray[8][8];
char d[9];
void datash(void);
void clock1(void);
void datal... |
C | //define error cancellation and include necessary libraries
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdbool.h>
//include main function
int main()
{
//declare variables
float number;
float total = 0;
char letter;
bool printTotal = true;
//print welcome statement and instructions
printf("He... |
C | /**
* @internal
* @file xorlist.c
* @author Kyle Laker (kyle@laker.email)
*
* @copyright Copyright (c) 2022
*
* An implementation of an XOR Linked List.
* "HMB" - Me when starting this
*
* @endinternal
*/
#include "list.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#incl... |
C | #include "transpose.h"
#include "sortn.h"
/* See MMX Note on www.intel.com. */
void
charm_sqr_transpose(char **out, int side)
{
int x, y;
for (y = 0; y < side; y++)
for (x = y + 1; x < side; x++)
SWAP(out[y][x], out[x][y]);
}
void
shortmatrix_sqr_transpose_16(short **out, int side)
{
int x, y;
for ... |
C | // Completes in 6.608 seconds
// Was it 1884?
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define P_IN int x, int y, int z, int w
#define P_ARGS x, y, z, w
#define N 40
#define loop_all(body) { \
for (int x = 0; x < N; x++) \
{ \
for (int y = 0; y < N; y++) \
{ \
for (int z... |
C | /*
** rotation.c for raytracer in /home/arbona/tek1/MUL/raytracer1
**
** Made by Thomas ARBONA
** Login <thomas.arbona@epitech.eu>
**
** Started on Tue Feb 14 20:06:00 2017 Thomas ARBONA
** Last update Tue Feb 14 20:22:32 2017 Thomas ARBONA
*/
#include <SFML/System/Vector3.h>
#include <math.h>
#include "util.h"
sta... |
C | #include <stdio.h>
#define SIZE 5
void findMinMax2D(int ar[SIZE][SIZE], int *min, int *max);
int main()
{
int A[5][5];
int i,j,min,max;
printf("Enter the matrix data (%dx%d): \n", SIZE, SIZE);
for (i=0; i<5; i++)
for (j=0; j<5; j++)
scanf("%d", &A[i][j]);
findMinMax2D(A, &min, &... |
C | #include <stdio.h>
int main(void) {
int c;
int spaces = 0;
while((c = getchar()) != EOF){
if(c == ' ' || c == '\t') {
spaces = 1;
} else if(c == '\n'){
spaces = 0;
putchar('\n');
} else {
if(spaces == 1) {
spaces = 0;
putchar('\n');
}
putchar(c);
... |
C | // BranchingFunctionsDelays.c Lab 6
// Runs on LM4F120/TM4C123
// Use simple programming structures in C to
// toggle an LED while a button is pressed and
// turn the LED on when the button is released.
// This lab will use the hardware already built into the LaunchPad.
// Daniel Valvano, Jonathan Valvano
//... |
C | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
void Ticker(char *s, int len)
{
int i;
char tausch;
if (s[0] != '\0')
{
for(i = 0; s[i+1] != '\0' ; i++)
{
tausch = s[i];
s[i] = s[i+1];
s[i+1]=tausch;
}
... |
C | /*
* QEMU Error Objects
*
* Copyright IBM, Corp. 2011
* Copyright (C) 2011-2015 Red Hat, Inc.
*
* Authors:
* Anthony Liguori <aliguori@us.ibm.com>
* Markus Armbruster <armbru@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2. See
* the COPYING.LIB file in the top-level dir... |
C | /*
** my_rra.c for emacs in /home/jules/CPE_2016_Pushswap
**
** Made by Jules Spender
** Login <jules.spender@epitech.eu@epitech.net>
**
** Started on Mon Nov 21 21:55:47 2016 Jules Spender
** Last update Thu Nov 24 16:10:01 2016 Jules Spender
*/
#include <stdlib.h>
int *my_rra(int *rendu, int Compteur, int i)
{... |
C | #include <stdio.h>
int main(){
int n;
scanf("%d", &n);
int arr[n];
int i;
for (i = 0; i < n; i++){
scanf("%d", &arr[i]);
}
max = max[0];
int indek_max = 0;
min = min[0];
int indek_min = 0;
for (i = 1; i < n; i++){
if(max < arr[i]){
max = arr[i];
indek_max = i;
... |
C | #include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
typedef struct //struct for 2 parameters
{
int * T;
int n;
int x;
} $params;
//Generates a tab of size N with numbers between 0 and 49,999,9... |
C | #include "../Models/Variables.h"
struct NodeName *createName(char name)
{
struct NodeName *temp = (NodeName *)malloc(sizeof(NodeName));
strcpy(temp->Name.Name, name);
strcpy(temp->Name.birth, birth);
return temp;
}
void pushNodeName(struct NodeName *temp)
{
if (!head)
{
... |
C | #include <stdio.h>
#define LENGTH(array) ( (sizeof(array)) / (sizeof(array[0])) )
void insertSort(int a[], int length) {
int i, j;
int insertRecord = 0;
for (i=1; i<length; i++)
{
//printf("i=%d, a[%d]=%d\n", i, i, a[i]);
if (a[i] < a[i-1])
{
insertRecord = a[i];
//将比in... |
C | #include<stdio.h>
#include<conio.h>
void main()
{
int r,k,res=0,n;
printf("\n enter the number");
scanf("%d",&n);
k=n;
while(n!=0)
{
r=n%10;
res=res*10+r;
n/=10;
}
if(k==res)
printf("\npalindrom");
else
printf("... |
C | #include "Queue/Queue.h"
void QueueCreate(Queue *q) {
/*
I.S.
q sembarang.
F.S.
q merupakan queue terdefinisi denga head(q) dan tail(q) menunjuk ke Nil.
*/
/* ALgoritma */
ListCreate(q);
}
bool QueueIsEmpty(Queue q) {
/*
Mengembalikan true jika q kosong (head(q) dan tai... |
C | #include "stm8l15x.h"
#include <stdio.h>
#include <math.h>
void adc_init(void);
void Delay(long);
void CLK_CONFIG_16MHZ_HSI(void);
void serial_init(void);
void tx_string(char* adc_data);
void voltage(uint16_t);
void main()
{
uint16_t adcVal;
CLK_CONFIG_16MHZ_HSI();
adc_init();
serial_init();
char adcSt... |
C | /* ************************************************************************** */
/* LE - / */
/* / */
/* polygon_supl.c .:: .:/ . .:: ... |
C | //Roll no.:20CY20031
//Name:Shubham Snehil
#include <stdio.h>
int main()
{
char noun[20];//for reading noun
int count;//for counting number of letters for extracting last and second last character
printf("\nEnter the noun:");
scanf("%s",&noun);
printf("\nThe entered noun is:%s",noun);
... |
C | /*
Title: rockPaperScissors
Description: Rock-paper-scissors game. Win 3 rounds.
Author: Veera Määttänen
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
void rules(char * userInput, int compInput, int *userWins, int *compWins);
int checkWinner(int userWins, int compWins);
int randomInt... |
C | /*
Stm32f4 kartı Cortex M4 işlemcisine sahiptir. Cortex M4 işlemcisi 24 bitlik sistem timerına sahiptir.
Bu timer kendine yüklenen değerden sıfıra doğru geriye sayarak çalışır ve sayac sıfıra ulaştığında kesme üretilir.
Bu kesme SysTick Timer kesmesidir.
PLL_M=8 PLL_P=2 PLL_Q=4 PLL_N=336 system_stm32f4xx.c(St... |
C | #include "alunoIST.h"
void Dummy(pessoa** turma= NULL, const int count =0);
int main()
{
pessoa** a = new pessoa*[5];
for (int i = 0; i < 5; ++i)
a[i]= new alunoIST(84390,"MEFT","Bravo",1997);
Dummy(a, 5);
delete [] *a;
delete a;
return 0;
}
void Dummy(pessoa** turma, const int count)
{
if(turma == N... |
C | #include <stdio.h>
#include <limits.h>
int main(){
printf("Character Ranges:\n");
printf("Minimum: %d\n", SCHAR_MIN);
printf("Maximum: %d\n", SCHAR_MAX);
printf("Unsigned Maximum: %d\n\n", UCHAR_MAX);
printf("Integer Ranges:\n");
printf("Minimum: %d\n", INT_MIN);
printf("Maximum: %d\n", INT_MAX);
printf("Uns... |
C | #include "utils.h"
#define STR(x) #x
#define STRINGIFY(x) STR(x)
#define panic(reason) __do_panic(reason, __FUNCTION__, __FILE__ ":" STRINGIFY(__LINE__))
#define trail(x) ((80 - (((int)x - 0xb8000) >> 1) % 80))
#define RESET_CAR() (car = 0xb8000)
#define LAST_STR() (car >= (short*)0xb8f00)
#define STR_SIZE 160
#def... |
C | #include <string.h>
/*------------------------------------------------------------------------
GetValStr()
Places characters until a ',' into a
dest string and returns the src string
after the ','
*/
char *
GetValStr(char * Src, char * Dest)
{
char * commaPos;
for (;*Src!='\0' && *Src!=',';Src++) {
... |
C | #include <stdio.h>
#include <signal.h>
#include <unistd.h>
volatile int handled = 0, sum = 0;
void
handler(int sig)
{
++sum;
}
int
main(void)
{
int sig = 0;
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGINT);
sigprocmask(SIG_BLOCK, &mask, NULL);
while (1) {
if (sigwait(&m... |
C | #include <stdio.h>
int main(viod)
{
char fname[40], lname[40];
printf("ֺϣÿո\n");
scanf("%s %s", fname, lname);
printf("%s,%s", fname, lname);
return 0;
}
|
C | #include <stdio.h>
typedef struct node1 {
int val, i;
}node1;
node1 maxqueue[1000000], minqueue[1000000], curr;
int cup[1000000], max[1000000], min[1000000];
typedef struct node2 {
double water;
int index;
}node2;
struct node2 cups[1000000], cur;
int top;
int main()
{
int n, k, i, j;
scanf("%d %d", &n, &k);
for (... |
C | /*
* steerif.c
*
* Created on: Apr 22, 2020
* Author: kychu
*/
#include "steerif.h"
status_t steerif_init(uint32_t period_us, uint32_t poswidth_us)
{
/* Timer handler declaration */
TIM_HandleTypeDef TimHandle;
/* Timer Output Compare Configuration Structure declaration */
TIM_OC_InitTypeDef sCo... |
C | #include "dictionary.h"
#include "hash.h"
#include "aiv_unit_test.h"
#include "asm_operation.h"
#include "math.h"
int tests_succeded = 0;
int tests_failed = 0;
int tests_executed = 0;
typedef struct random_struct{
char* name;
int age;
} random_struct_t;
TEST(asm_RDRAND){
float random1 = 0;
float rand... |
C | /*************************************************************************
> File Name: my_ls.c
> Author: limeng
> Mail: ldx19980108@gmail.com
> Created Time: 2017年07月20日 星期四 10时24分15秒
************************************************************************/
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#... |
C | #include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include <time.h>
#include "glove.h"
#define MAX_SIZE 20
static long rnd(long n) {
return ((long)rand()) % n;
}
void shuffle_array(COOC_REC* records, long len){
COOC_REC tmp;
long i,j;
for(i = 1; i < len; i++){
... |
C | #include <stdio.h>
int x = 1;
int y = 80;
int s = 0;
float sum = 0;
int main(void) {
do{
if (x%2 != 0)
{
sum += x;
s++;
}
x++;
}while(x <= y);
float result = sum/s;
printf("\nСереднє арифметичне всіх непарних чисел у діапазоні [1;80] = %f\n", result);
return 0;
}
|
C | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
int main() {
char nome[10], invertido[10];
int i;
scanf("%s", nome);
int n = strlen(nome) -1;
int x = n;
for(i=0; i<strlen(nome); i++){
invertido[n] = nome[i];
invertido[n] = tolower(invertid... |
C | #include <stdio.h>
#include <malloc.h>
#include <stdarg.h>
#include <ctype.h>
#include "unity.h"
#include "Error.h"
#include "TestParser.h"
#include "Exception.h"
#include "CExceptionConfig.h"
#include "CException.h"
void setUp(void) {}
void tearDown(void) {}
void test_strcompare(void)
{
char *str = "assign";
ch... |
C | /* David Oguns
* Computer Graphics II
* March 31, 2008
* output.h
* Ray Tracing Project
*
* This file contains the definition for the functions used for outputting buffers
* to an image file or to the screen.
*/
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "output.h... |
C | #include <stdio.h>
#include <math.h>
#include "common_multiple_divisor.h"
#include "factorization.h"
#include "sqrt.h"
int main() {
common_multiple_divisor(100, 20);
common_multiple_divisor(23, 13);
common_multiple_divisor(25, 15);
common_multiple_divisor(22, 21);
common_multiple_divisor(14, 21);... |
C | #include <stdio.h>
int main(void){
int i=0;
while(1){//while文の無限ループ
i++;
printf("こんにちは %d\n",i);
if(i==5){
break;
}
}
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "array_divide.h"
int* divide_array(int* array_given, int div_size, int array_length){
assert((array_length % div_size) == 0);
int i = 0;
int j = 0;
int k = 0;
int* mini_array;
int* sending_array = (int*)malloc((array_length/div... |
C | #include <stdio.h>
int main(void)
{
int i;
char c = 'a';
char d = 'A';
char str1[56] = "abcdefghijklmnopqrstuvwxyz";
char str2[26];
for (i = 0; i < 26; i++)
{
str2[i] = c;
c++;
}
if (strcmp(str1, str2) == 0)
{
printf("the strings are the same\n");
}
else
{
printf("the string... |
C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nlp.h"
//ATTENTION!
//Variant: 19
// , .
// ³
// .
// RESULT IS IN "task.txt"
int main(void){
char book[15000];
FILE* bookFile = fopen("book.txt", "r");
fread(book, sizeof(char), 15000,... |
C | #include <stdio.h>
typedef struct{
int nroSucursal;
char codVendedor[6];
int nroFactura;
float importe;
}ventas;
int maintxt(){
ventas v;
FILE *arch, *txt;
arch = fopen("ventas","wb");
txt = fopen("ventastxt.txt","r");
while(fscanf(txt,"%d %s %d %f",&v.nroSucursal,v.codVendedor,&v.nroFactura,&v... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "Lexico.h"
#include "Sintatico.h"
//FUNCAO MAIN
int main(int argc, char *argv[]){
FILE * F, *erros;
char palavra[200], buffer[200],classificacao[200];
//palavras reservadas
int contador=0, tamanho, controle =0,linha=1;
F = fopen(argv[1],"r");
erros ... |
C | #include <stdio.h>
#include <stdlib.h>
char *CompareString(char *string1, char *string2){
int size1=0,size2=0,i;
for(i=0;string1[i]!='\0';i++){
size1++;
}
for(i=0;string2[i]!='\0';i++){
size2++;
}
if(size1>size2){
return string1;
}
else
ret... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.