1 solutions
-
0
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
Information
- ID
- 19949
- Time
- 1000ms
- Memory
- 50MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By