1 条题解

  • 0
    @ 2021-6-15 1:39:32

    C++ :

    #include<cstdio>
    #include<iostream>
    using namespace std;
    
    int n,ans[]={0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,8,9,6,9,29,39,38,65,88,128};
    
    int main()
    {
    	
    	while(cin>>n)
    	{
    	cout<<ans[n];
    	}
    	return(0);
    }
    

    Pascal :

    const b:array ['0'..'9'] of longint=(6,2,5,5,4,5,6,3,7,6);
    var a:array[0..2000] of longint;
        i,j,n,t:longint;s:string;
    begin
      fillchar(a,sizeof(a),0);
      t:=0;
      for i:=0 to 2000 do
       begin
        str(i,s);
        for j:=1 to length(s) do inc(a[i],b[s[j]]);
       end;
      readln(n);
      dec(n,4);
      for i:=0 to 1000 do
       for j:=0 to 1000 do
         if a[i]+a[j]+a[i+j]=n then inc(t);
       writeln(t);
    end.
    
    
    
    
    • 1

    信息

    ID
    265
    时间
    1000ms
    内存
    50MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者