-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1168.cpp
More file actions
48 lines (46 loc) · 734 Bytes
/
1168.cpp
File metadata and controls
48 lines (46 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int n,i,num;
string st1;
scanf("%d",&n);
while(n){
cin>>st1;
num=0;
for(i=0;i<st1.length();i++){
if(st1[i]=='1'){
num=num+2;
}else{
if(st1[i]=='2'){
num=num+5;
}else{
if(st1[i]=='3'){
num=num+5;
}else{
if(st1[i]=='4'){
num=num+4;
}else{
if(st1[i]=='5'){
num=num+5;
}else{
if(st1[i]=='6'){
num=num+6;
}else{
if(st1[i]=='7'){
num=num+3;
}else{
if(st1[i]=='8'){
num=num+7;
}else{
if(st1[i]=='9'){
num=num+6;
}else{
num=num+6;
} } } } } } } } }
}
printf("%d leds\n",num);
n--;
}
return 0;
}