Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#define NROWS 10
#define NCOLS 7
float col_ave(int x[NROWS][NCOLS], int col) {
float average;
int i, total = 0;
for (i = 0; i < NROWS; i++) {
@morganwilde
morganwilde / ViewControllerStudentsList.m
Last active December 29, 2015 16:09
UITableView with ALAssets
@interface ViewControllerStudentsList ()
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (strong, nonatomic) UIManagedDocument *document;
@property (nonatomic) NSInteger studentCount;
@property (strong, nonatomic) NSMutableArray *studentList;
@property (strong, nonatomic) NSMutableDictionary *studentPortraits;
@end
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
typedef int bool;
#define true 1
#define false 0
typedef struct{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
typedef int bool;
#define true 1
#define false 0
typedef struct{
#include <stdio.h>
int main() {
int inc = 0, dec = 0;
// incrementing a number
printf("inc = %d\n", inc);
inc++;
printf("inc (po inc++ operacijos) = %d\n", inc);
void Get (struct KNYGA a[], int *i)
{
int t;
for(t=0; t<*i; t++)
{
strcpy(a[t].pavadinimas, a[t+1].pavadinimas);
strcpy(a[t].autorius, a[t+1].autorius);
a[t].puslapiu = a[t+1].puslapiu;
a[t].metai = a[t+1].metai;
a[t].versta = a[t+1].versta;
void Print (struct KNYGA a[], int *i) {
// a - "struct KNYGA" tipo masyvas
// i - masyve "a" esanciu elementu/eiluciu skaicius
// k - dabartines spausdinamos eilutes/elemento skaicius
int k;
for (k=0; k<i; k++){
// for - ciklas, kuris vyksta tol, kol dabartinis elementas "k"
// nevirsyja viso masyvo elementu skaiciaus
/* Dovile Mikenaite, Ekonometrija, 2 grupe :
2. Su pasirinktais įrašais realizuoti ADT steko operacijas dinaminio dvikrypčio sąrašo pagrindu.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <conio.h>
//typedef int bool;
@morganwilde
morganwilde / gist:6767548
Last active December 24, 2015 07:59
Polynomial
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
long long powSafe(
long base,
int exponent,
long module
) {
long long result = 1;
#include <stdio.h>
#include <time.h>
int main() {
// time it
clock_t cstart = clock();
clock_t cend = 0;
int i, j, k;
int sum = 0;