您的位置:首页 > 其它

Codeforces 495 A. Digital Counterr && Codeforces Round #282 (Div. 2)

2014-12-14 10:48 381 查看
题目链接:http://codeforces.com/problemset/problem/495/A

解题思路:Codeforces官方题解:

For each digit x you
can count the number of digits y that
because of some broken sticks x is
shown instead of y by
hand. for example when x = 3, y can
be 3, 8 and 9.
Let's denote this number by ax.
Then if the input is xy (the
first digit shown in the counter is x and
the second is y)
the answer will be ax × ay.

水题,小心一点别数错就行了。



AC代码:

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a[]={2,7,2,3,3,4,2,5,1,2};
    int n;
    while(scanf("%d",&n)!=EOF)
        printf("%d\n",a[n/10]*a[n%10]);
    return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐