//Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and 
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
// same ids are connected.
// prefix 的格式要求是 acm-[一级标题编号].[二级标题编号][该代码片段的英文简称]
// description 的格式要求是 "插入 [该代码片段的中文名]"

{
    "高精度乘法": {
        "prefix": "acm-1.5普通写法",
        "body": [
            "#include<iostream>",
            "#include<cstring>",
            "#include<cstdio>",
            "using namespace std;",
            "int main(){",
            "    char a1[10005],b1[10005];",
            "    int a[100005],b[100005],c[100005],lena,lenb,lenc,i,j,x;",
            "    memset(a,0,sizeof(a));",
            "    memset(b,0,sizeof(b));",
            "    memset(c,0,sizeof(c));",
            "    gets(a1);gets(b1);",
            "    lena=strlen(a1);lenb=strlen(b1);",
            "    for(i=0;i<=lena-1;i++) a[lena-i]=a1[i]-48;",
            "    for(i=0;i<=lenb-1;i++) b[lenb-i]=b1[i]-48;",
            "\tfor(i=1;i<=lena;i++){",
            "\t    x=0;                                               ",
            "\t    for(j=1;j<=lenb;j++){",
            "\t        c[i+j-1]=a[i]*b[j]+x+c[i+j-1];",
            "\t        x=c[i+j-1]/10;",
            "\t        c[i+j-1] %= 10;",
            "\t    }",
            "\t    c[i+lenb]=x;                             ",
            "\t}",
            "\tlenc=lena+lenb;",
            "\twhile(c[lenc]==0&&lenc>1)lenc--;",
            "\tfor(i=lenc;i>=1;i--)cout<<c[i];",
            "\tcout<<endl;",
            "}",
            ""
        ],
        "description": "插入 高精度乘法"
    }
}