Advertisement
Guest User

Untitled

a guest
May 25th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4.  
  5. {
  6.     int T,i;
  7.     long long int leds;
  8.     char n[i],ch;
  9.     scanf("%d",&T);
  10.     while(T--){
  11.         while(1){
  12.             scanf("%c",&ch);
  13.             if(ch=='0'){
  14.                 leds+=6;
  15.                 }else if(ch=='1'){
  16.                     leds+=2;
  17.                     }else if(ch=='2'){
  18.                         leds+=5;
  19.                             }else if(ch=='3'){
  20.                                 leds+=5;
  21.                                 }else if(ch=='4'){
  22.                                     leds+=4;
  23.                                     }else if(ch=='5'){
  24.                                         leds+=5;
  25.                                         }else if(ch=='6'){
  26.                                             leds+=6;
  27.                                             }else if(ch=='7'){
  28.                                                 leds+=3;
  29.                                                 }else if(ch=='8'){
  30.                                                     leds+=7;
  31.                                                     }else if(ch=='9'){
  32.                                                         leds+=6;
  33.                                                     }else if(ch=='\0' || ch=='\n'){
  34.                                                         break;
  35.                                                     }
  36.         }
  37.         printf("%lld leds\n",leds);
  38.     }
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement