language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include <stdio.h>
#include <stdlib.h>
#include "lista.h"
void mostra_int(void *x);
int compara_int(void *x, void *y);
void mostra_tudoXXX(Conjuntos m);
int main() {
int lin, i, x, op;
printf("Digite o numero de conjuntos: ");
scanf("%d", &lin);
Conjuntos m, sub, a, b;
int rep1, rep2;
inicial... |
C | #include <stdio.h>
void NhapMang(int a[], int n){
for(int i = 0;i < n; ++i){
printf("\nNhap phan tu a[%d] = ", i);
scanf("%d", &a[i]);
}
}
void XuatMang(int a[], int n){
for(int i = 0;i < n; ++i){
printf("\nPhan tu a[%d] = %d", i, a[i]);
}
}
float tinhtb(int a[], int n){
f... |
C | #include "particle.h"
particle* Particle(){
particle* p = (particle*) malloc(NUM_P*sizeof(particle));
for (int i = 0; i < NUM_P; i++){
p[i].x = RandomReal(244);
p[i].y = RandomReal(244);
p[i].theta = RandomReal(2 * M_PI);
p[i].weight = 1.0 / NUM_P;
}
return p;
}
void ParticlePred(particle* p, ... |
C | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#define N 10
int s2_in_s1(char* s2, char* s1, int n);
int main() {
char s1[N + 1];
char s2[N + 1];
int i, let = 0, num = 0;
printf("Inserire stringa n1\n");
gets(s1);
printf("Inserire stringa n2\n");
gets(s2);
if(s2_in... |
C | #include "holberton.h"
/**
* _strncpy - cpoies a string of n char
* @dest: the final string
* @src: the string to copy from
* @n: the number of char to copy
* Return: the final output
*/
char *_strncpy(char *dest, char *src, int n)
{
int i;
for (i = 0; i < n && src[i] != '\0'; i++)
dest[i] = src[i];
w... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define Rozmiar_Tablicy 21
#define Min 1
#define Max 13
#define Rozmiar_Histograma 11
void WypelnijTablice(int *tab, int min, int max);
int SumaTablicy(int *tab);
float SredniaTablicy(int *tab);
void GenerujHistogram(int *tab, int *hist);
void WypiszTablice... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
double **value; /* 数値 */
int row; /* 行の数 */
int column; /* 列の数 */
} matrix_t;
int s_strlen(char *); /* 文字列の長さを測る関数 */
void s_strcpy(char *, char *); /* 文字列をコピーする関数 */
c... |
C | #include "spm.h"
/* Count the number of variables */
int
Vars_Num(pset set)
{
register unsigned tmp, val;
register int i = cube.last_word[cube.num_binary_vars-1], j=0, k;
register int ind = 0, num = BPI >> 1, total=0;
while (++j < i) {
tmp = set[j];
for (k = 0; k < num; k++, ind++) {
val = tmp... |
C | /* Exercise 4-14. Define a macro swap(t,x,y)
of type t. (Block structure will help.) */
#include <stdio.h>
#define swap(t,x,y) t _temp; _temp = x; x = y; y = _temp;
int main()
{
int x=10;
int y=2;
printf("%d, %d \n", x, y);
swap(int ,x,y);
printf("%d, %d \n", x, y);
} |
C | #include <stdio.h>
#include <string.h>
int main(){
char flag[10] = {'0','1','1','1','1','1','1','0'};
char string[20];
char string2[20];
int i,j = 0,count,length;
printf("Enter the string: ");
scanf("%s",string);
length = strlen(string);
count = 0;
for(i = 0;... |
C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#define PAT_SIZE 50
#define POPEN_FMT "/bin/ls -d %s 2> /dev/null"
#define PCMD_BUF_SIZE (sizeof(POPEN_FMT) + PAT_SIZE)
int main(int argc, char **argv) {
char pat[PAT_SIZE];
char popenCmd[PCMD_BUF_S... |
C | #include <stdio.h>
#include <math.h>
#define RAD_TO_DEG (45.0/atan(1))
int main(void)
{
double w, h, r, theta;
printf("غ ̸ ԷϽÿ:");
scanf("%lf %lf", &w, &h);
r = sqrt(w * w + h * h);
theta = RAD_TO_DEG * atan2(h, w);
printf("= %f = %f\n", r, theta);
}
|
C | /*
NOTE(chuck): This code is inspired heavily by Handmade Hero https://handmadehero.org/
and its community. If you're wondering why I've even bothered to handroll some of the
things in here, it's because I'm learning and trying out a lot of things. I'm interested
in getting more serious about becoming a better program... |
C | /**************************************************************
1674번
jongtae0509
C
정확한 풀이코드 길이:205 byte(s)
수행 시간:0 ms
메모리 :1120 kb
****************************************************************/
#include<stdio.h>
int main(){
int a,b,c,d,e,f,g,h,i,j;
scanf("%1d%1d%1d%1d%1d%1d%1d%1d%1d%1d",&a,&b,&c,&d,&e,&f,&g,&h... |
C | #include <stdbool.h>
#define MAX_MARCA 20
#define MAX_MODELO 20
#define T 39
typedef struct car
{
char marca[MAX_MARCA + 1]; // 21 Bytes
char modelo[MAX_MODELO + 1]; // 21 Bytes
short cilindrada; // 2 Bytes
int ano_i, ano_r; // 2 * 2 Bytes
} car_t; // To... |
C | /*! \file cyk.c
* \brief Алгоритм Кока-Янгера-Касами
* Для корректной работы необходим файл грамматики нужного формата
* и строка, принадлежность которой языку и определяется в
* результате работы алгоритма
*/
#include "cyk.h"
#include "load_product.h"
/*!
* \brief Инициали... |
C | #include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
};
struct node *head = NULL;
void insertLast( int item)
{
struct node *new = (struct node*) malloc(sizeof(struct node));
new->data = item;
new->next = NULL;
if (head == NULL)
{
head = new;
return;
}
struct node *temp = hea... |
C | #include<stdio.h>
#include<string.h>
void main()
{
char str[]="INDIA";
int l=strlen(str);
int i;
for(i=0;i<=l;i++)
{
printf("%c\n",str[i]);
}
}
|
C | #include<stdio.h>
#include<stdlib.h>
/* #include <windows.h> */
#include <locale.h>
#include "../../libs/voltar.h"
#include "../../libs/structs.h"
#include "../../libs/Mensagem.h"
#include "../../libs/cabSys.h"
int GerarId(){
FILE *StoreFile;
StoreFile = fopen("./data/estoque.dat", "r"); /* Abre o... |
C | #include <stdio.h>
#include <stdlib.h>
#define IN 1
#define OUT 2
/* take arr of ints, the size of the number of words, with each element the
* length of the word, and print a line of #'s */
void
print_histogram(int word_lengths[], int word_count)
{
for(int i = 0; i < word_count; i++) {
for(int j = 0; j < wor... |
C | #ifndef CONTROLLER_H
#define CONTROLLER_H
/* Define */
/* Masks for Sensor parsing */
#define SMASK1 1
#define SMASK2 2
#define SMASK3 4
#define SMASK4 8
#define SMASK5 16
#define SMASK6 32
#define SMASK7 64
#define SMASK8 128
/* Number of trains that can be waiting to reverse */
#define MAX_REVERSE_QUEUE 4
/*
* sys... |
C | #include <string.h>
#include "arcci.h"
#include "sds.h"
#include "dict.h"
#include "cli_cmd.h"
#include "cli_info_parser.h"
#define NOTUSED(V) ((void) V)
static dict *
getDictOfInfoAll (arc_t * arc, sds * err, int timeout)
{
int argc;
sds *argv;
sds out;
unsigned raw_mode = 1;
dict *d;
argv = sdssplitar... |
C | /**
* @description: 1060 爱丁顿数
* @param {type}
* @return:
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int cmp(const void *a, const void *b)
{
return (*(int *)a - *(int *)b);
}
int main(void)
{
int testnum;
int testbuf[100002];
int result = 0;
scanf("%d",... |
C | #ifndef RECORD_H_INCLUDED
#define RECORD_H_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct RECORD;
typedef struct RECORD Record;
struct RECORD
{
int year;
int month;
long long salary;
struct RECORD *next;
};
int recordfile_is_null(const char * recordfilenam... |
C | #include <stdio.h>
int main() {
char a='x', br='x';
int key=0, scrm=0, rk=1;
long int t=0;
// 0
printf("Voce acaba de acordar em uma prisao\n");
scanf("%c", &br);
printf("O ambiente esta muito escuro\n");
scanf("%c", &br);
printf("Uma goteira pinga algumas vezes dentro da sua camiseta suja\n");
scanf("%c... |
C | /*
Programa clock.c
Desenvolvido por Lucas Ferreira dos Santos
*/
#include <stdio.h>
#include <time.h>
int main (void) {
clock_t t0, tf;
int i=0;
double tempo_gasto;
t0 = clock ();
while (i<=100000) {
printf("Contador: %i \n",i);
i++;
}
tf = clock();
tempo... |
C | #include <assert.h>
#include <dwarf.h>
#include <dwarfw.h>
#include <stdbool.h>
#include "leb128.h"
#include "pointer.h"
#include "write.h"
#define OPCODE_LOW_MASK 0x3F
size_t dwarfw_cie_write_advance_loc(struct dwarfw_cie *cie, uint32_t delta,
FILE *f) {
size_t n, written = 0;
assert(delta % cie->code_alignment... |
C | //==============================================//
// //
// MesinKata //
// //
//----------------------------------------------//
// File : mesinkata.h */ //
//--------------... |
C | // DP + TRIE
// failed too much times, more careful, for corner cases !!!
#define N 26
typedef struct _Node
{
int e;
int f;
struct _Node* n[N];
} Node;
Node* cNode()
{
Node* n = malloc(sizeof(Node));
n->e = n->f = 0;
return n;
}
void aNode(Node* r, char* s, int id)
{
int i = 0;
int c =... |
C |
#include <stdio.h>
//FUNC Int i = c::exportedbacktoc_returns_int_one() DO
int exportedbacktoc_returns_int_one();
//FUNC Int i = c::exportedbacktoc_returns_int_plus_one(Int i) DO
int exportedbacktoc_returns_int_plus_one(int);
//FUNC Double d = c::exportedbacktoc_returns_doubles_summed(Double d1, Double d2) DO
double e... |
C | #include<stdio.h>
int main() {
int n, p = 1;
printf("Introduceti n:");
scanf("%d", &n);
printf("2^%d=%d", n, p = ( p << n ) );
return 0;
}
|
C | //使用fork函数创建子进程
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/types.h>
int main(void)
{
printf("main函数开始执行\n");
pid_t pid=fork();
if(-1==pid)
perror("fork"),exit(-1);
if(0==pid) //子进程
{
printf("我是子进程%d,我的父进程是%d\n",getpid(),getppid());
sleep(1);
printf("我是子进程%d,我的父进程是%d\n",getpid(),g... |
C | #include <stdio.h>
int main()
{
char charType;
int integerType;
float floatType;
double doubleType;
printf("Size of char: %ld byte\n",sizeof(charType)); // charType ũ Ʈ
printf("Size of int: %ld bytes\n",sizeof(integerType)); // integerType ũ Ʈ
printf("Size of float: %ld bytes\n",sizeof(floatType)); // floatTy... |
C | #define INIT_HASH_SIZE 4096
// Represent an element in a hash table.
typedef struct Hash {
int key;
struct Hash *next;
} Hash;
Hash **InitHash() {
Hash **h = (Hash**)calloc(INIT_HASH_SIZE, sizeof(Hash*));
assert(h);
return h;
}
Hash *NewHash(int key) {
Hash *h = (Hash*)malloc(sizeof(Hash));
... |
C | #include "binary_trees.h"
/**
* binary_tree_depth - function that measures the depth
* of a node in a binary tree
* @tree: a pointer to the parent node of the node.
* Return: the depth of the tree or 0.
*/
size_t binary_tree_depth(const binary_tree_t *tree)
{
int p_depth;
if (tree == NULL || !tree->parent)
re... |
C | // PROBLEM //
The RPS world championship is here. Here two players A and B play the game. You need to determine who wins.
Both players can choose moves from the set {R,P,S}.
The game is a draw if both players choose the same item.
The winning rules of RPS are given below:
Rock crushes scissor
Scissor cuts paper
Paper ... |
C | #include <stdio.h>
#include <sys/stat.h>
#include <errno.h>
#include <inttypes.h>
int main(int argc, char const *argv[]) {
uint64_t total_size = 0;
struct stat st;
for (int i = 1; i < argc; ++i) {
errno = 0;
lstat(argv[i], &st);
if (errno == 0 && S_ISREG(st.st_mode) && !S_ISLNK(st.... |
C | #include "menu.h"
#include <string.h>
int ask_menu(int is_login){
// 파라미터 : 로그인여부 (0 No, 1Yes)
// 리턴값 : 선택한 메뉴번호
// 메뉴번호 : 1. Sign up 2. Log in 3. Log out 0. Exit
#ifdef DEBUG_MODE
printf("DEBUG : ask_menu()\n");
#endif
int menu;
char command[16];
printf(">");
scanf("%s", command);
if((strcmp(command, "joi... |
C | #include "example.h"
#include "trochili.h"
#if (EVB_EXAMPLE == CH4_SEMAPHORE_EXAMPLE1)
/* û̲߳ */
#define THREAD_LED_STACK_BYTES (256)
#define THREAD_LED_PRIORITY (5)
#define THREAD_LED_SLICE (20)
#define THREAD_CTRL_STACK_BYTES (512)
#define THREAD_CTRL_PRIORITY (6)
#define THREAD_CTRL_SLICE (20... |
C | #include<stdio.h>
void main()
{
int f1=0,f2=1,f3,i=1,n;
printf("Enter the no");
scanf("%d",&n);
printf("%d%d",f1,f2);
while(i<=n)
{
f3=f1+f2;
i++;
printf("%d",f3);
f1=f2;
f2=f3;
}
getch();
} |
C | /**
* @file Command.c
* @author Patrick Henz
* @date 12-11-2019
* @brief Function definition file for Command library.
* @details Function definitions file for Command library. This file also contains hidden global variables to
* be used by the following functions.
**/
#include "../include/Command.h"
/**
... |
C | #ifndef ZED_BUFFER_H
#define ZED_BUFFER_H
#include <stdint.h>
#include "error.h"
typedef struct Piece {
uint64_t start;
uint64_t end;
struct Piece *next;
} zed_Piece;
zed_Piece *zed_PieceCreate(uint64_t, uint64_t);
uint64_t zed_PieceLength(zed_Piece *);
void zed_PieceDelete(zed_Piece *);
typedef enum... |
C | #include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <errno.h>
#include <bitmap.h>
#include "../include/back_store.h"
#define BLOCK_SIZE 1024 //2^10 bytes = 1 KB blocks
#define NUM_BLOCKS 65536 //2^16 blocks
#define FBM_BLOCKS 8 //NUM_BLOCKSbit... |
C | #include<stdio.h>
void swap(int*, int*);
void exchange(int*, int*, int*);
int main(void){
int x, y, z;
printf("Please input 3 number: ");
scanf("%d, %d, %d", &x, &y, &z);
exchange(&x, &y, &z);
printf("%d, %d, %d\n", x, y, z);
return 0;
}
void swap(int* pt1, int* pt2){
int t;
t = *pt1;
*pt1 = *pt2;
*pt2 =... |
C | #include <stdio.h>
void ft_sort_int_tab(int *tab, int size);
int main(void)
{
int array[10] = {2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 0};
int size = 9;
ft_sort_int_tab(array, size);
int i = 0;
while (i <= size)
{
printf("%d ", array[i]);
... |
C | /* Copyright (c) 2014, Giuseppe Argentieri <giuseppe.argentieri@ts.infn.it>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above cop... |
C | #include <stdio.h>
#include <stdlib.h>
#define LARGE 300010
long long arr_ans[LARGE];
void merge(long long arr[] , int l , int u, int mid){
int start = l , end = mid + 1, p = 0;
while(start<=mid && end<=u){
if(arr[start]<=arr[end]){
arr_ans[p] = arr[start];
start++;
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* commands_for_checker.c :+: :+: :+: ... |
C | /*************************************************************************
> File Name: ./src/o.c
> Author: Arwen
> Mail:745529725@qq.com
> Created Time: Mon 26 Jan 2015 09:42:25 PM CST
************************************************************************/
#include"c.h"
int dayofyear(int year, int month, int ... |
C | //
// Created by 张兴 on 2020/12/26.
//
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
//1、全局变量检测增强
//int a; //没有赋值,当做声明
//int a = 10; //赋值,当做定义
/*此代码在c++下编译失败,在c下编译通过*/
//2、函数检测增强
int getRectS(w, h)
{
}
void test02()
{
getRectS(10, 10, 10);
}
//3、类型转换检测增强
void test03()
{
char * p = malloc(sizeof(64... |
C | #include<stdio.h>
int main()
{ char SEL,F,M;
int NOT=0;
int ACUMH=0;
int ACUMF=0;
int CONT=0;
int CONTF=0;
int CONTH=0;
int V,J;
while(CONT<8){
printf("\n\t\t\t\t MENU \n\n\n");
printf("\n\t\t\t\t 1. OPCION M ");
printf("\n\t\t\t\t 1. OPCION F ");
... |
C | #include <exec/types.h>
#include "cs8900.h"
/*****************************************************************************
*
* peek
*
*****************************************************************************/
UBYTE peek (ULONG addr) {
ULONG *ptr;
ULONG value;
// Dummy read
ptr = (ULONG *)0x40000000;
... |
C | /*
* led.h
*
* Created on: Sep 12, 2020
* Author: akram
*/
#ifndef INC_LED_H_
#define INC_LED_H_
#include <stdio.h>
#include "stm32f4xx.h"
#define LED_PORT (GPIOD)
#define LED_ORANGE_PIN (13)//(GPIO_PIN_13)
#define LED_GREEN_PIN (12)
#define LED_RED_PIN (14)
#define LED_BLUE_PIN (15)
#define LED_ORANGE... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
int main(void){
pid_t pid;
int ret;
pid = fork();
if((int)pid == -1){
fprintf(stderr, "fork: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
if((int)pid == 0){
printf("this is child, pi... |
C | //ȭ鿡 ϴ
#include "tetris.h"
void IntroDrawer()
{
int x = 5;
int y = 2;
Gotoxy(x + 1, y + 0); printf("١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١ڡ١");
Gotoxy(x + 1, y + 2); printf(" \n"); Sleep(20);
Gotoxy(x + 1, y + 3); printf(" \n"); Sleep(20);
Gotoxy(x + 1, y + 4); printf(" ... |
C | //-----------------------------------------------------------------------------
// Thomas Brochard
// pa5
// FindPath.c
//----------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "Graph.h"
#define MAX_LEN 250
int main(int argc, char ... |
C | //
// Created by byd on 17-12-1.
//
#ifndef _DENSECRF_UTIL_H
#define _DENSECRF_UTIL_H
inline float fast_log2(float val) {
int* const exp_ptr = reinterpret_cast<int*> (&val);
int x = *exp_ptr;
const int log_2 = ((x >> 23) & 255) - 128;
x &= ~(255 << 23);
x += 127 << 23;
*exp_ptr = x;
retur... |
C | #include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <math.h>
#include <string.h>
typedef struct
{
int input;
int next_state;
}transition;
int n, syms;
int compare (const void *a, const void *b)
{ return ( *(int*)a - *(int*)b ); }
void eclosure(transition **tr, int *v, int *e, int *i, int *k... |
C | /**
* @file menu.h
* @brief Command-line Interface library header.
* @authors Ismael Coelho Medeiros (14/0083162)
*
* This file contains all the function signatures used in the menus
* and in the user choices processing.
*/
#ifndef _MENU_H
#define _MENU_H
#include <stdio.h>
#include "class.h"
/**
* @brief ... |
C | #include<stdio.h>
#include<math.h>
void printBinary(int n)
{
if(n==0)
{
printf("0");
return;
}
else if(n==1)
{
printf("1");
return;
}
else
printBinary(n>>1);
printf("%d",n&1);
}
int rightRotate(int x,int n)
{
int t;
int left=log2(x);
... |
C | ////////////////////////////////////////
// servoPot.c
// reads a pot and translates it to
// a servos position.
// Wiring: Jumper P8.19 to a servo signal through a 220ohm resistor
// Hook a potentiometers variable voltage to P9.03
////////////////////////////////////////
#i... |
C | #include <limits.h>
#include "hutil.h"
unsigned int pow_uint (const unsigned int base, const unsigned int exp)
{
unsigned int result = base;
const unsigned int limit = UINT_MAX/base;
for (unsigned int i=1; i<exp; ++i) {
if (result <= limit)
result *= base;
else
re... |
C | #include<stdio.h>
#include<math.h>
int main()
{
long long i=1,t,sal,tax;
scanf("%lld",&t);
while(i<=t)
{
scanf("%lld",&sal);
if(sal<=180000)
tax=0;
else if(sal<=200000)
tax=2000;
else if(sal<=480000)
tax=ceil((sal-180000)*.1);
else if(sal<=... |
C | #include <stdio.h>
/*
* The C function we need to wrap. They're actually both the
* same function, but I was trying things and depending on what
* I was trying, they might have been different
*/
int c_to_wrap(char *s, float f) {
// printf(" C : %s() %f (%p)\n",__func__, f, f);
printf(" C ... |
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 | /* Arguments cannot be passed by reference */
void swap(int *x, int *y) {
int temp;
temp = *x;
*x = *y;
*y = temp;
return;
}
int main ()
{
int c = 1, d = 2;
swap(&c,&d);
} |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_get_sq_size.c :+: :+: :+: ... |
C | #include <stdio.h>
int main()
{
int a;
int b;
int sum;
a = 50;
b = 60;
sum = a + b;
printf("Sum is %d", sum);
return 0;
|
C | /*
* main.c
*
* Created on: Mar 6, 2012
* Author: MrThai
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "library.h"
int main(int argc, char **argv) {
if (argc !=2) {
printf("re-enter data");
exit(0);
}
char filename[30];
strcpy(filename,argv[1]);
node *list;
list=createLis... |
C | /* Library for direct interfacing to the RGB lamp. */
/* Copyright 2013 Boris Gjenero. Released under the MIT license. */
#include <stdlib.h>
//#include <stdio.h>
#include <math.h>
#ifdef WIN32
#include <windows.h>
#endif
#include "serio.h"
#include <stdio.h>
#define BUILDING_LIBRGBLAMP
#include "librgblamp.h"
/*** W... |
C | //11.1. Write a program that read and display read and display a 2D array
#include <stdio.h>
int main()
{
int i, j, row1, row2, col1, col2;
printf("Give row1 size: ");
scanf("%d", &row1);
printf("Give column1 size: ");
scanf("%d", &col1);
printf("Give row2 size: ");
scanf("%d", &row2... |
C | #pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NDEBUG
#define CONTAINERS_CHECK_ENABLED 1
#endif
//
// Array
//
// This array type is implemented as a "stretchy buffer" (https://github.com/nothings/stb/blob/master/stretchy_buffer.h).
// Basical... |
C | #include<stdio.h>
#include<string.h>
void vowels(char*);
void main()
{
char *str = "please please";
vowels(str);
}
void vowels(char *str)
{
char s[100];
int i,j=0;
for(i=0;str[i] != '\0'; i++)
{
if(str[i] =='a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o'|| str[i] == 'u')
{
i++;
}
else
{
s[... |
C | /* Write an alternative version of squeeze(s1,s2) that deletes each
character in s1 that matches any character in the string s2. */
#include <stdio.h>
void squeeze(char s1[], char s2[]);
int main()
{
char tests1[] = "herp";
char tests2[] = "derp";
/* printf("Squeezing %s from %s gives us: \n", tests1, tests2); ... |
C | #include <stdio.h>
int main(){
int n,sum=0,i;
for(i=1;i<=100;i++){
sum=sum+i;
if(sum>=2000) break;
}
printf("sum = %d\n",sum);
return 0;
}
|
C | #pragma warning(disable : 4996)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAXCHAR 100000
typedef struct ListChar
{
char letter;
int occ;
struct ListChar* next;
} ListChar;
typedef struct Node
{
char letter;
int occ;
struct Node* rig... |
C | #include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
int *temp;
void barrier(int pipes[][2], int pipe_id, int type)
{
int i;
/* ---------------- BARRIER ---------------- */
if (type == -1)
{
for (i = 1; i < 6; i++)
{
read(pipes[0][0], temp, sizeof(temp));
}
for (i =... |
C | /*
### Dimmer microcontrolado com PIC ###
uC: PIC 16f876A
Ciclo de mquina: 200ns
Plataforma de desenvolvimento do software: MikroC PRO for PIC v.4.15.0.0
Data de inicio: 12 Outubro de 2019
ltima atualizao: 28 Outubro de 2019
OBS: No recomendado fazer a chamada de uma funo dentro da pilha de
interru... |
C | #include <stdio.h>
#include <stdbool.h>
#include <string.h>
void swap(char* a, char* b) {
char c = *a;
*a = *b;
*b = c;
}//меняет местами значения адресов
unsigned int minInd(const char* number, char min_larger_than_number) {
int masLen = (int)strlen(number);
char min = '9';
int min_index = -1... |
C | #include "shell_command.h"
#include <dirent.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static const char *help_commands[HELP_COMMAND_NUM] = {
"h[elp]",
"d[ir]",
"q[uit]",
"hi[story]",
"du[mp] [start, end]",
"e[dit] address, value",
"f[ill] start, end, value",
"reset",
... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct node {
int value ;
struct node* next ;
} node ;
node* getnewnode() ;
node* insertbeg( node* , int);
void displayll( node* );
node* reverse( node* );
int middle( node* );
int main(){
int ch , n , temp ;
node* start = NULL ;
printf("1.... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ARRAY_SIZE 256
int main(void) {
// 1
char s1[ARRAY_SIZE] = "howdy"; // this copies the char contents to the array s1
char * s2 = "howdy"; // this points to the string literal 'howdy' in READ ONLY MEMORY
printf("s1: value = %s, addre... |
C | #include <stdio.h>
#include <omp.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <math.h>
#include <string.h>
struct temperature{
int r;
int g;
int b;
};
struct temperature convert(float temperature); // converts temperature to rgb
void iteration(float ** field, float ** field_backup); // calculatio... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_rrb.c :+: :+: :+: ... |
C | int main(char *str) {
int i;
while(1) {
for (i = 0x1ffff; i--;);
print_uart0(str);
}
return 0;
}
void imprime(int n) {
int i, j, pot, digitos;
char str[16], *ptr, c;
if (n <= 0) return;
i = n / 10;
digitos = 1;
while (i > 0) {
i = i / 10;
digitos++;
}
ptr = str;
while (digitos > 0) {
i = n;
... |
C | /*
* sieve32.c ( List 5-29 )
* Copyright (C) Teruhisa Kamachi and ASCII Corp. 1994
* All rights reserved.
*
* ̃t@Ćw͂߂ēǂ486xiAXL[oŋǁjɌfڂ
* vÖꕔłBvOe◘p@ɂĂ͖{
* LqQƂĂB
*/
/*
* List 5-29 sieve32̃CvO
* [sieve32.c 1/1] (page 186)
*/
#include <stdio.h>
#include <stdlib.h>
#i... |
C | #include <stdio.h>
#include <string.h>
int main(){
int ch;
int output=0;
FILE *fp;
//־ļ
fp=fopen("/var/log/kern.log","r");
if(fp==NULL){//Ϣ -1
printf("Can't open log file!\n");
return -1;
}
//ȡ־ļ
fseek(fp,0,SEEK_SET);//ļָضλļͷ
ch=fgetc(fp);
//ҵںģ¼ͷ
while(ch!=EOF){
//¼ͷΪ"&#&"
if(ch=='&'){
... |
C | //take two nums from user and send to them to function and check return value is same or not
#include<stdio.h>
int addchecker(int a,int b);
int main()
{
int a=0,b=0,c=0;
printf("Enter a two num\n");
scanf("%d%d",&a,&b);
int add=a+b;
int iret=addchecker(a,b);
if(add==iret)
{
... |
C | /*
C0222 : Programming Methodology
Lab 01
E/16/069
M.D.S.De Silva
*/
#include<stdio.h>
#include<math.h>
#include<complex.h>
int main(){
double a,b,c = 0;
double complex critic,sol1,sol2=0;
printf("Enter the coefficients : ");
scanf("%lf %lf %lf",&a,&b,&c);
critic = (b*b) -(4*a*c);
... |
C | #include<unistd.h>
#include<stdio.h>
#include<sys/types.h>
#include<stdlib.h>
int main(void)
{
int pid;
printf("Before fork:\n");
pid = fork();
if(pid > 0)
{
sleep(3);
printf("Parent process Id: %d \n Parent's parent process Id: %d \n Child Pid:%d\n", getpid(), getppid(),pid);
}
else if(pid == 0)
{
pri... |
C | /*
** change_ant.c for change_ant in /home/nonnen_p/CPE_2015_Lemin/src
**
** Made by paul nonnenmacher
** Login <nonnen_p@epitech.net>
**
** Started on Mon Apr 18 16:18:02 2016 paul nonnenmacher
** Last update Wed Apr 20 13:45:29 2016 paul nonnenmacher
*/
#include "lemin.h"
int *change_ant(int *ant, t_map *ants,... |
C | #include "RTL.h"
#include "stm32f10x.h"
#include "rtc.h"
#include "dbg.h"
#define YEAR_BASE 2015
//· 1 2 3 4 5 6 7 8 9 10 11 12
// 31 29 31 30 31 30 31 31 30 31 30 31
// 31 28 31 30 31 30 31 31 30 31 30 31
/**
* @brief жǷ
* @param year:
* @retval 1 0
*/
u8 Is_Leap_Year(u16 year)
{
i... |
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 i , pos;
float Nbr , max ;
max=1;
for (i=1;i<=6;i++)
{
printf("Saisir Un Nombre:");
scanf("%f",&Nbr);
if (Nbr>max)
{
... |
C | # include <stdio.h>
# include <stdlib.h>
int i = 1;
typedef struct node
{
int code;
int sequence;
int flag;
struct node *next;
}Node, *CLinkList;
void CreateCLinkList(CLinkList L, int n)
{
Node *r = L, *s;
int i, code;
for (i = 1; i <= n; i++)
{
s = (Node*)m... |
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: olivera
*
* Created on 18 de agosto de 2018, 07:52 PM
*/
#include <stdio.h>
#includ... |
C | //
// Created by ali on 28.12.2020.
//
#include "../layers/math_operations.h"
#include "divtest.h"
//void div_by_scalar(const fp_t *input_channel, const uint16_t height, const uint16_t width, const fp_t denominator, fp_t* output_channel){
// a division by scalar layer
// for (int i=0; i<height*width; i++)
// ... |
C | #include "timers.h"
typedef struct gstr_timerInit_t{
uint8_t en_mode;
uint8_t en_OC0;
uint8_t en_prescal;
uint8_t u8_initialValue;
uint8_t u8_outputCompare;
uint8_t u8_assynchronous;
uint8_t en_interruptMask;
}gstr_timerInit_t;
static gstr_timerInit_t timer0;
static gstr_timerInit_t t... |
C | #include <stdio.h>
void test();
int main(int argc, char **argv)
{
printf("pointer....\n");
int x = 10;
printf("x value : %d\n", x);
printf("x address : %p\n", &x);
int y = x;
printf("y value : %d\n", y);
printf("y address : %p\n", &y);
int *ptx;
ptx = &x;
printf("ptx address : %p\n", ptx);
printf("siz... |
C | /* Write a program to reverse the given number */
#include<stdio.h>
int main(){
int aNumber, reverse=0, temp1, temp2;
printf("\n Enter a number to reverse it : ");
scanf("%d",&aNumber);
temp1 = aNumber;
while(temp1!=0){
temp2 = temp1%10;
reverse = temp2+reverse*10;
... |
C | // Name : Kesha Shah
// Id : 201101228
// Coding Theory - Decoding with a binary Hamming Code.
#include<stdio.h>
#include<math.h>
int main()
{
// n -> length of codeword
// k -> basis dimension
// d -> minimum distance
// r -> a positive integer >=2
// q -> qary code
int n,k,d,r,q;
char d_cont,h_cont;
int ne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.