Skip to content

Instantly share code, notes, and snippets.

View chengluyu's full-sized avatar
😁
Working on a new project...

Luyu Cheng chengluyu

😁
Working on a new project...
View GitHub Profile
@chengluyu
chengluyu / gist:6219214
Created August 13, 2013 08:56
蛇形矩阵
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
const int MAX = 102;
const int STEP[4][2] = {{0, -1}, {-1, 0}, {0, 1}, {1, 0}};
int matrix[MAX][MAX] = {0};
int n, x, y, s = 0, sum = 0;
#include <iostream>
#include <cstdio>
using namespace std;
#define CONCAT(a, b) a##b
#define file_type CONCAT(FI, LE)
#define file_open CONCAT(fo, pen)
#define file_scanf CONCAT(fs, canf)
#include <iostream>
#include <cstdio>
using namespace std;
#define CONCAT(a, b) a##b
#define file_type CONCAT(FI, LE)
#define file_open CONCAT(fo, pen)
#define file_scanf CONCAT(fs, canf)