Monday, March 16, 2015

495A. Digital Counter (Codeforces)

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define pf printf
#define sf scanf

int main()
{
    int stick[11] = {2, 7, 2 , 3, 3, 4, 2, 5, 1 ,2};
    int n, x;
    cin >> n;
    int n1, n2;
    n1 = (n%10);
    n2 = (n/10);
    x = stick[n1]*stick[n2];
    cout << x << endl;
}

No comments:

Post a Comment

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...