Skip to content

Instantly share code, notes, and snippets.

View 02015678's full-sized avatar

02015678 02015678

View GitHub Profile
@02015678
02015678 / 2013100302.cpp
Created January 20, 2015 16:40
[转载]C++中稀疏矩阵的一种实现
#include <iostream>
#include <iomanip>
using namespace std;
template<class T>
//三元组
struct Trituple
{
int row;
int col;
@02015678
02015678 / 2014090801.bat
Created January 20, 2015 16:36
在Visual Studio 2005/2008/2010下使用MSCOMM32
:: This Batch file is used to install MSCOMM32
::
@echo off
echo CLAIM: MSCOMM32 is belong to Microsoft Corporation
echo.
echo This batch file is licensed under CC-BY-SA 3.0
echo and is provided on an "AS IS" basis, use it on your own risk.
echo.
@02015678
02015678 / 2013120101.m
Created January 20, 2015 16:34
Matlab program for LU Factorization with partial (row) pivoting
function [L,U,P]=LU_pivot(A)
% LU factorization with partial (row) pivoting
% K. Ming Leung, 02/05/03
[n,n]=size(A);
L=eye(n); P=L; U=A;
for k=1:n
[pivot m]=max(abs(U(k:n,k)));
m=m+k-1;
if m~=k
@02015678
02015678 / 2007101103.pas
Created January 18, 2015 15:20
Liuhy's PASCAL Solution for NKPC3 Bowling Ball
program NK1704;
var
st:array [1..1000] of char;
score:array [0..10] of integer;
i,tt,line:integer;
qq,ch:char;
procedure main;
var
i,j,th:integer;
a:array [1..10,1..2] of integer;
@02015678
02015678 / 2007101102.pas
Last active August 29, 2015 14:13
PASCAL Solution for NKPC3 Bowling Ball
Const
ch1:set of char=['/','-','X','1'..'9']; {记分的有效符号}
Var
pnt,k,i,j:byte; {(总计)击球次数的指针:p(oi)nt}
ans:integer; {得分:ans(wer)}
a:array[1..11,1..21]OF char; {存储每一次记分字符的数组:a(rray)}
ch:char; {用于读取输入文件的字符变量:ch(ar)}
Function chk(k,pnt:byte):byte; {求(总计)第n次击球击倒的个数:ch(ec)k}
Begin
Case a[k,pnt] OF
@02015678
02015678 / 2007101101.c
Last active August 29, 2015 14:13
GCC Solution for NKPC3 Bowling Ball
#include<stdio.h>
int ans=-1;
char k=0,i,a[21];
short pts=-1;
char chk(short pts)
{
char tmp;
switch(a[pts])
{
case 'X':tmp=10;break;