Skip to content

Instantly share code, notes, and snippets.

@BeMg
BeMg / coding week4.c
Last active August 29, 2015 14:07
cholat
#include <stdio.h>
#include <stdlib.h>
int main()
{
int choclat,coupon,a,money,sumchoclat;
while(EOF!=scanf("%d",&money))
{
choclat = money;
sumchoclat = choclat;
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF)
{
if(a>b)
{
@BeMg
BeMg / UVA 10499.c
Created October 14, 2014 16:40
UVA 10499
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
b = 0;
while(scanf("%d",&a))
{
if(a<0) break;
@BeMg
BeMg / 3n+1.c
Last active August 29, 2015 14:08
ACM 100 3n+1
#include <stdio.h>
#include <stdlib.h>
int main()
{
long long int a,b,c,e,f;
long long int d = 1;
long long int temp = 0;
while(scanf("%lld %lld",&a,&b)!=EOF)
{
@BeMg
BeMg / 10409.c
Last active August 29, 2015 14:08
die game 10409
#include <stdio.h>
#include <stdlib.h>
int main()
{
int step;
while(scanf("%d",&step))
{
if(step == 0)break;
int dice[6]={1,2,3,4,5,6};
@BeMg
BeMg / 10018.c
Last active August 29, 2015 14:08
10018 reverse and add
#include <stdio.h>
#include <stdlib.h>
long long int get_reverse(long long int a)
{
long long int result = 0;
while(a!=0)
{
long long int digits = a%10;
@BeMg
BeMg / 10038.c
Last active August 29, 2015 14:08
10038 jolly jumper
#include <stdio.h>
#include <stdlib.h>
int main()
{
int column[3000];
int number;
while(scanf("%d",&number)!=EOF)
{
int i = 0;
@BeMg
BeMg / 10008.c
Last active August 29, 2015 14:08
10008 What's Cryptanalysis?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node_
{
char c;
long long int count;
};
typedef struct node_ node;
@BeMg
BeMg / ccu lab.c
Created November 5, 2014 15:25
week8 people choice door
#include <stdio.h>
#include <stdlib.h>
int main()
{
int door_num;
scanf("%d",&door_num);
int door[door_num];
int a = 0;
@BeMg
BeMg / move the stricks.c
Created November 8, 2014 14:54
move the stricks
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num;
scanf("%d",&num);
int n = num;
int sum = 0;
int highbox[num];