Skip to content

Instantly share code, notes, and snippets.

View Abreto's full-sized avatar
🔋
Charging

Abreto Fu Abreto

🔋
Charging
View GitHub Profile
@Abreto
Abreto / astar2012j.c
Created May 29, 2012 15:08
AStar2012-J
#include <stdio.h>
int main(void)
{
int n = 0, m = 0;
int u = 0, d = 0, t = 0;
int l = 0, low = -1;
scanf("%d %d", &n, &m);
while(m--)
{
@Abreto
Abreto / A.cpp
Created June 2, 2012 03:37
AStar2012-C1
#include <iostream>
using namespace std;
class Line
{
public:
int xl, xr, y;
};
int main(void)
@Abreto
Abreto / A.cpp
Created June 3, 2012 03:56
AStar2012-C2
#include <iostream>
using namespace std;
int main(void)
{
int n = 0, i = 0, j = 0;
unsigned int *A = NULL;
long long max = 0, cmax = 0;
cin>>n;
@Abreto
Abreto / p1.c
Created August 27, 2012 10:46
RQNOJ
/* RQNOJ Problem 1. 明明的随机数. */
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i = 0, m = 0;
int N = 0, *data = NULL;
int *arr = NULL, max = 0, count = 0;
@Abreto
Abreto / p026.c
Created August 28, 2012 14:06
CXSJSX_OPENJUDGE_practice1
/* cxsjsx.openjudge.cn/practice1 Problem 026. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct _set
{
int *data;
int count;
int size;
@Abreto
Abreto / numtostr.c
Created October 4, 2012 16:15
用语言描述的三位数
/* Program E6.1 - print nature language for a number. */
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char map[][4] = {"零","一","二","三","四","五","六","七","八","九"};
int num = 0;
printf("Please enter a three-digit number: ");
@Abreto
Abreto / e6-2.c
Created October 5, 2012 03:05
分隔单词
/* Program E6-2. */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
int i = 0;
char str[100] = {0};
@Abreto
Abreto / e6-4.c
Created October 5, 2012 04:02
判断是否回文
/* Program E6-4 */
#include <stdio.h>
#include <string.h>
int main(void)
{
int i = 0, l = 0, r = 0;
char str[100];
gets(str);
@Abreto
Abreto / list.c
Created October 5, 2012 09:41
数据结构(用C语言描述)
/**
* 单链表之实现
*
* 星枵<[email protected]
* 20121005
**/
/** 双链表结点结构 */
typedef struct _listnode
{
@Abreto
Abreto / 售货员.c
Created October 6, 2012 15:31
枚举法练习
/* E1.2.4 - 售货员. Ural State University Problem Archive 1012 Conductor. */
#include <stdio.h>
int main(void)
{
int i = 0;
double P = 0, Q = 0;
scanf("%lf %lf", &P, &Q);